@gopowerteam/table-render 0.0.173 → 0.0.175
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 +437 -435
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/es/index.mjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref 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 b, 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[
|
|
14
|
-
}
|
|
15
|
-
function
|
|
16
|
-
const t =
|
|
17
|
-
const n = e.filter((
|
|
18
|
-
return n.length > 0 ? a.map((
|
|
19
|
-
i.formatter &&
|
|
20
|
-
}),
|
|
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
|
+
}
|
|
15
|
+
function et(e) {
|
|
16
|
+
const t = b([]), r = (a) => {
|
|
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,
|
|
@@ -31,15 +31,15 @@ function et(e) {
|
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
33
|
function br(e) {
|
|
34
|
-
const t = H(), r =
|
|
35
|
-
function
|
|
36
|
-
var n,
|
|
37
|
-
const a = (
|
|
34
|
+
const t = H(), r = b();
|
|
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,48 @@ function ht(e) {
|
|
|
309
309
|
});
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const gt = {
|
|
313
313
|
size: 30
|
|
314
314
|
};
|
|
315
315
|
function bt(e) {
|
|
316
|
-
e = {
|
|
317
|
-
...
|
|
316
|
+
return e = {
|
|
317
|
+
...gt,
|
|
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`,
|
|
344
|
+
margin: "auto"
|
|
347
345
|
}
|
|
348
|
-
}, [f(
|
|
346
|
+
}, [f(He, {
|
|
347
|
+
preview: e == null ? void 0 : e.preview,
|
|
348
|
+
width: "100%",
|
|
349
|
+
height: "100%",
|
|
350
|
+
fit: "contain",
|
|
351
|
+
src: o,
|
|
349
352
|
alt: "image",
|
|
350
|
-
style:
|
|
351
|
-
src: c
|
|
353
|
+
style: l
|
|
352
354
|
}, null)]) : f(I, null, null);
|
|
353
355
|
}
|
|
354
356
|
});
|
|
@@ -356,125 +358,125 @@ function bt(e) {
|
|
|
356
358
|
function K(e) {
|
|
357
359
|
return Re() ? (qe(e), !0) : !1;
|
|
358
360
|
}
|
|
359
|
-
function
|
|
361
|
+
function O(e) {
|
|
360
362
|
return typeof e == "function" ? e() : Pe(e);
|
|
361
363
|
}
|
|
362
364
|
const W = typeof window < "u" && typeof document < "u";
|
|
363
365
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
364
|
-
const
|
|
366
|
+
const wt = Object.prototype.toString, vt = (e) => wt.call(e) === "[object Object]", Ct = () => {
|
|
365
367
|
};
|
|
366
|
-
function
|
|
368
|
+
function kt(e) {
|
|
367
369
|
let t;
|
|
368
370
|
function r() {
|
|
369
371
|
return t || (t = e()), t;
|
|
370
372
|
}
|
|
371
373
|
return r.reset = async () => {
|
|
372
|
-
const
|
|
373
|
-
t = void 0,
|
|
374
|
+
const u = t;
|
|
375
|
+
t = void 0, u && await u;
|
|
374
376
|
}, r;
|
|
375
377
|
}
|
|
376
|
-
function
|
|
378
|
+
function xt(e, t) {
|
|
377
379
|
var r;
|
|
378
380
|
if (typeof e == "number")
|
|
379
381
|
return e + t;
|
|
380
|
-
const
|
|
382
|
+
const u = ((r = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : r[0]) || "", a = e.slice(u.length), n = Number.parseFloat(u) + t;
|
|
381
383
|
return Number.isNaN(n) ? e : n + a;
|
|
382
384
|
}
|
|
383
|
-
function
|
|
385
|
+
function St(e, t, r = {}) {
|
|
384
386
|
const {
|
|
385
|
-
immediate:
|
|
386
|
-
} = r, a =
|
|
387
|
+
immediate: u = !0
|
|
388
|
+
} = r, a = b(!1);
|
|
387
389
|
let n = null;
|
|
388
|
-
function
|
|
390
|
+
function l() {
|
|
389
391
|
n && (clearTimeout(n), n = null);
|
|
390
392
|
}
|
|
391
393
|
function i() {
|
|
392
|
-
a.value = !1,
|
|
394
|
+
a.value = !1, l();
|
|
393
395
|
}
|
|
394
|
-
function o(...
|
|
395
|
-
|
|
396
|
-
a.value = !1, n = null, e(...
|
|
397
|
-
},
|
|
396
|
+
function o(...d) {
|
|
397
|
+
l(), a.value = !0, n = setTimeout(() => {
|
|
398
|
+
a.value = !1, n = null, e(...d);
|
|
399
|
+
}, O(t));
|
|
398
400
|
}
|
|
399
|
-
return
|
|
401
|
+
return u && (a.value = !0, W && o()), K(i), {
|
|
400
402
|
isPending: se(a),
|
|
401
403
|
start: o,
|
|
402
404
|
stop: i
|
|
403
405
|
};
|
|
404
406
|
}
|
|
405
|
-
function
|
|
407
|
+
function Mt(e) {
|
|
406
408
|
var t;
|
|
407
|
-
const r =
|
|
409
|
+
const r = O(e);
|
|
408
410
|
return (t = r == null ? void 0 : r.$el) != null ? t : r;
|
|
409
411
|
}
|
|
410
412
|
const N = W ? window : void 0, me = W ? window.navigator : void 0;
|
|
411
413
|
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 = [],
|
|
414
|
+
let t, r, u, a;
|
|
415
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, u, a] = e, t = N) : [t, r, u, a] = e, !t)
|
|
416
|
+
return Ct;
|
|
417
|
+
Array.isArray(r) || (r = [r]), Array.isArray(u) || (u = [u]);
|
|
418
|
+
const n = [], l = () => {
|
|
417
419
|
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
|
-
() => [
|
|
420
|
+
}, i = (s, m, h, w) => (s.addEventListener(m, h, w), () => s.removeEventListener(m, h, w)), o = Ee(
|
|
421
|
+
() => [Mt(t), O(a)],
|
|
420
422
|
([s, m]) => {
|
|
421
|
-
if (
|
|
423
|
+
if (l(), !s)
|
|
422
424
|
return;
|
|
423
|
-
const h =
|
|
425
|
+
const h = vt(m) ? { ...m } : m;
|
|
424
426
|
n.push(
|
|
425
|
-
...r.flatMap((w) =>
|
|
427
|
+
...r.flatMap((w) => u.map((S) => i(s, w, S, h)))
|
|
426
428
|
);
|
|
427
429
|
},
|
|
428
430
|
{ immediate: !0, flush: "post" }
|
|
429
|
-
),
|
|
430
|
-
o(),
|
|
431
|
+
), d = () => {
|
|
432
|
+
o(), l();
|
|
431
433
|
};
|
|
432
|
-
return K(
|
|
434
|
+
return K(d), d;
|
|
433
435
|
}
|
|
434
|
-
function
|
|
435
|
-
const e =
|
|
436
|
+
function Tt() {
|
|
437
|
+
const e = b(!1), t = H();
|
|
436
438
|
return t && A(() => {
|
|
437
439
|
e.value = !0;
|
|
438
440
|
}, t), e;
|
|
439
441
|
}
|
|
440
442
|
function U(e) {
|
|
441
|
-
const t =
|
|
443
|
+
const t = Tt();
|
|
442
444
|
return L(() => (t.value, !!e()));
|
|
443
445
|
}
|
|
444
446
|
function q(e, t = {}) {
|
|
445
|
-
const { window: r = N } = t,
|
|
447
|
+
const { window: r = N } = t, u = U(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
|
|
446
448
|
let a;
|
|
447
|
-
const n =
|
|
448
|
-
n.value =
|
|
449
|
+
const n = b(!1), l = (d) => {
|
|
450
|
+
n.value = d.matches;
|
|
449
451
|
}, i = () => {
|
|
450
|
-
a && ("removeEventListener" in a ? a.removeEventListener("change",
|
|
451
|
-
}, o =
|
|
452
|
-
|
|
452
|
+
a && ("removeEventListener" in a ? a.removeEventListener("change", l) : a.removeListener(l));
|
|
453
|
+
}, o = ze(() => {
|
|
454
|
+
u.value && (i(), a = r.matchMedia(O(e)), "addEventListener" in a ? a.addEventListener("change", l) : a.addListener(l), n.value = a.matches);
|
|
453
455
|
});
|
|
454
456
|
return K(() => {
|
|
455
457
|
o(), i(), a = void 0;
|
|
456
458
|
}), n;
|
|
457
459
|
}
|
|
458
|
-
function
|
|
460
|
+
function _t(e, t = {}) {
|
|
459
461
|
function r(s, m) {
|
|
460
|
-
let h =
|
|
461
|
-
return m != null && (h =
|
|
462
|
+
let h = O(e[O(s)]);
|
|
463
|
+
return m != null && (h = xt(h, m)), typeof h == "number" && (h = `${h}px`), h;
|
|
462
464
|
}
|
|
463
|
-
const { window:
|
|
465
|
+
const { window: u = N, strategy: a = "min-width" } = t;
|
|
464
466
|
function n(s) {
|
|
465
|
-
return
|
|
467
|
+
return u ? u.matchMedia(s).matches : !1;
|
|
466
468
|
}
|
|
467
|
-
const
|
|
468
|
-
get: () => a === "min-width" ?
|
|
469
|
+
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, {
|
|
470
|
+
get: () => a === "min-width" ? l(m) : i(m),
|
|
469
471
|
enumerable: !0,
|
|
470
472
|
configurable: !0
|
|
471
473
|
}), s), {});
|
|
472
|
-
function
|
|
473
|
-
const s = Object.keys(e).map((m) => [m,
|
|
474
|
+
function d() {
|
|
475
|
+
const s = Object.keys(e).map((m) => [m, l(m)]);
|
|
474
476
|
return L(() => s.filter(([, m]) => m.value).map(([m]) => m));
|
|
475
477
|
}
|
|
476
478
|
return Object.assign(o, {
|
|
477
|
-
greaterOrEqual:
|
|
479
|
+
greaterOrEqual: l,
|
|
478
480
|
smallerOrEqual: i,
|
|
479
481
|
greater(s) {
|
|
480
482
|
return q(() => `(min-width: ${r(s, 0.1)})`, t);
|
|
@@ -500,9 +502,9 @@ function Tt(e, t = {}) {
|
|
|
500
502
|
isInBetween(s, m) {
|
|
501
503
|
return n(`(min-width: ${r(s)}) and (max-width: ${r(m, -0.1)})`);
|
|
502
504
|
},
|
|
503
|
-
current:
|
|
505
|
+
current: d,
|
|
504
506
|
active() {
|
|
505
|
-
const s =
|
|
507
|
+
const s = d();
|
|
506
508
|
return L(() => s.value.length === 0 ? "" : s.value.at(-1));
|
|
507
509
|
}
|
|
508
510
|
});
|
|
@@ -510,44 +512,44 @@ function Tt(e, t = {}) {
|
|
|
510
512
|
function ue(e, t = {}) {
|
|
511
513
|
const {
|
|
512
514
|
controls: r = !1,
|
|
513
|
-
navigator:
|
|
514
|
-
} = t, a = U(() =>
|
|
515
|
+
navigator: u = me
|
|
516
|
+
} = t, a = U(() => u && "permissions" in u);
|
|
515
517
|
let n;
|
|
516
|
-
const
|
|
518
|
+
const l = typeof e == "string" ? { name: e } : e, i = b(), o = () => {
|
|
517
519
|
n && (i.value = n.state);
|
|
518
|
-
},
|
|
520
|
+
}, d = kt(async () => {
|
|
519
521
|
if (a.value) {
|
|
520
522
|
if (!n)
|
|
521
523
|
try {
|
|
522
|
-
n = await
|
|
524
|
+
n = await u.permissions.query(l), he(n, "change", o), o();
|
|
523
525
|
} catch {
|
|
524
526
|
i.value = "prompt";
|
|
525
527
|
}
|
|
526
528
|
return n;
|
|
527
529
|
}
|
|
528
530
|
});
|
|
529
|
-
return
|
|
531
|
+
return d(), r ? {
|
|
530
532
|
state: i,
|
|
531
533
|
isSupported: a,
|
|
532
|
-
query:
|
|
534
|
+
query: d
|
|
533
535
|
} : i;
|
|
534
536
|
}
|
|
535
|
-
function
|
|
537
|
+
function $t(e = {}) {
|
|
536
538
|
const {
|
|
537
539
|
navigator: t = me,
|
|
538
540
|
read: r = !1,
|
|
539
|
-
source:
|
|
541
|
+
source: u,
|
|
540
542
|
copiedDuring: a = 1500,
|
|
541
543
|
legacy: n = !1
|
|
542
|
-
} = e,
|
|
544
|
+
} = e, l = U(() => t && "clipboard" in t), i = ue("clipboard-read"), o = ue("clipboard-write"), d = L(() => l.value || n), s = b(""), m = b(!1), h = St(() => m.value = !1, a);
|
|
543
545
|
function w() {
|
|
544
|
-
|
|
546
|
+
l.value && v(i.value) ? t.clipboard.readText().then((y) => {
|
|
545
547
|
s.value = y;
|
|
546
548
|
}) : s.value = j();
|
|
547
549
|
}
|
|
548
|
-
|
|
549
|
-
async function S(y =
|
|
550
|
-
|
|
550
|
+
d.value && r && he(["copy", "cut"], w);
|
|
551
|
+
async function S(y = O(u)) {
|
|
552
|
+
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
553
|
}
|
|
552
554
|
function x(y) {
|
|
553
555
|
const C = document.createElement("textarea");
|
|
@@ -561,33 +563,33 @@ function _t(e = {}) {
|
|
|
561
563
|
return y === "granted" || y === "prompt";
|
|
562
564
|
}
|
|
563
565
|
return {
|
|
564
|
-
isSupported:
|
|
566
|
+
isSupported: d,
|
|
565
567
|
text: s,
|
|
566
568
|
copied: m,
|
|
567
569
|
copy: S
|
|
568
570
|
};
|
|
569
571
|
}
|
|
570
572
|
const Ot = " ";
|
|
571
|
-
function
|
|
573
|
+
function Lt(e) {
|
|
572
574
|
return e == null ? void 0 : e.replace(/(\d{3})\d*(\d{4})/g, "$1****$2");
|
|
573
575
|
}
|
|
574
576
|
function ie(e, t) {
|
|
575
577
|
return e == null ? void 0 : e.replace(/\*/g, "M").replace(/\B(?=(?:\S{4})+$)/g, t ?? Ot).replace(/M/g, "*");
|
|
576
578
|
}
|
|
577
|
-
function
|
|
578
|
-
const t =
|
|
579
|
-
return k("phone", (
|
|
580
|
-
const n = `phone_${Math.random().toString(36).slice(2)}`,
|
|
579
|
+
function jt(e) {
|
|
580
|
+
const t = $t();
|
|
581
|
+
return k("phone", (u, a) => {
|
|
582
|
+
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
583
|
function h() {
|
|
582
584
|
window.focus(), t.copy(i).then(() => {
|
|
583
|
-
|
|
585
|
+
Ie.success({
|
|
584
586
|
content: "复制成功",
|
|
585
587
|
duration: 1e3
|
|
586
588
|
});
|
|
587
589
|
});
|
|
588
590
|
}
|
|
589
591
|
function w() {
|
|
590
|
-
const v = document.querySelectorAll(`.${
|
|
592
|
+
const v = document.querySelectorAll(`.${l}.content`);
|
|
591
593
|
v.length > 0 && v.forEach((y) => {
|
|
592
594
|
const C = y;
|
|
593
595
|
if (C.innerText.includes("****"))
|
|
@@ -613,12 +615,12 @@ function Lt(e) {
|
|
|
613
615
|
style: "display:flex;align-items:center;gap:4px;"
|
|
614
616
|
}, [f("div", {
|
|
615
617
|
"data-encrypt": s,
|
|
616
|
-
class: `${
|
|
618
|
+
class: `${l} content`,
|
|
617
619
|
style: "use-select:none;font-family: monospace;cursor:pointer;font-variant-numeric: tabular-nums;padding-right: 2px;"
|
|
618
620
|
}, [e != null && e.safe ? s : m]), (e == null ? void 0 : e.safe) && (e == null ? void 0 : e.allowPreview) && f("i", {
|
|
619
621
|
class: "preview-icon",
|
|
620
622
|
title: "显示完整号码",
|
|
621
|
-
style:
|
|
623
|
+
style: d,
|
|
622
624
|
onClick: x
|
|
623
625
|
}, [f("svg", {
|
|
624
626
|
width: o,
|
|
@@ -639,7 +641,7 @@ function Lt(e) {
|
|
|
639
641
|
"stroke-width": "4",
|
|
640
642
|
"stroke-linejoin": "round"
|
|
641
643
|
}, null)])]), (e == null ? void 0 : e.allowDial) && f("i", {
|
|
642
|
-
style:
|
|
644
|
+
style: d,
|
|
643
645
|
title: "拨出号码",
|
|
644
646
|
onClick: j
|
|
645
647
|
}, [f("svg", {
|
|
@@ -667,7 +669,7 @@ function Lt(e) {
|
|
|
667
669
|
"stroke-width": "4",
|
|
668
670
|
"stroke-linejoin": "round"
|
|
669
671
|
}, null)])]), (e == null ? void 0 : e.allowCopy) && f("i", {
|
|
670
|
-
style:
|
|
672
|
+
style: d,
|
|
671
673
|
title: "复制号码",
|
|
672
674
|
onClick: h
|
|
673
675
|
}, [f("svg", {
|
|
@@ -691,22 +693,22 @@ function Lt(e) {
|
|
|
691
693
|
}, null)])])]);
|
|
692
694
|
});
|
|
693
695
|
}
|
|
694
|
-
function
|
|
696
|
+
function Rt(e) {
|
|
695
697
|
return k("render", (r) => e(r));
|
|
696
698
|
}
|
|
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,
|
|
699
|
+
function qt(e) {
|
|
700
|
+
return k("tag", (r, u) => {
|
|
701
|
+
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
702
|
return f("div", {
|
|
701
703
|
style: {
|
|
702
704
|
display: "flex",
|
|
703
705
|
flexWrap: "wrap"
|
|
704
706
|
}
|
|
705
707
|
}, [n.slice(0, a).map((s, m) => {
|
|
706
|
-
const h = typeof
|
|
708
|
+
const h = typeof l == "function" ? l(s, m) : l[m % l.length], w = typeof i == "function" ? i(s, m) : i[m % i.length];
|
|
707
709
|
return f("span", {
|
|
708
710
|
style: {
|
|
709
|
-
minWidth:
|
|
711
|
+
minWidth: d ? `${d}px` : "unset",
|
|
710
712
|
textAlign: "center",
|
|
711
713
|
margin: "2px",
|
|
712
714
|
padding: "2px 5px",
|
|
@@ -725,11 +727,11 @@ function ce(e) {
|
|
|
725
727
|
if (typeof e == "number")
|
|
726
728
|
return `${e}px`;
|
|
727
729
|
}
|
|
728
|
-
function
|
|
729
|
-
var
|
|
730
|
-
return typeof e == "function" ? (
|
|
730
|
+
function Pt(e, t, r) {
|
|
731
|
+
var u, a;
|
|
732
|
+
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
733
|
}
|
|
732
|
-
function
|
|
734
|
+
function zt(e, t) {
|
|
733
735
|
if (typeof e != "function") {
|
|
734
736
|
if (typeof (e == null ? void 0 : e.color) == "function")
|
|
735
737
|
return e == null ? void 0 : e.color(t);
|
|
@@ -741,35 +743,35 @@ function Et(e, t) {
|
|
|
741
743
|
if (typeof e != "function")
|
|
742
744
|
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
745
|
}
|
|
744
|
-
function
|
|
746
|
+
function Yt(e, t) {
|
|
745
747
|
let r = "";
|
|
746
|
-
const
|
|
747
|
-
return
|
|
748
|
+
const u = zt(e, t), a = Et(e, t);
|
|
749
|
+
return u && (r += `color:${u};`), a && (r += `font-size:${a};`), r;
|
|
748
750
|
}
|
|
749
|
-
function
|
|
750
|
-
return k("text", (r,
|
|
751
|
-
const a =
|
|
751
|
+
function At(e) {
|
|
752
|
+
return k("text", (r, u) => {
|
|
753
|
+
const a = Pt(e || {}, u, r), n = Yt(e || {}, r);
|
|
752
754
|
return f("span", {
|
|
753
755
|
style: n
|
|
754
756
|
}, [a]);
|
|
755
757
|
});
|
|
756
758
|
}
|
|
757
|
-
function
|
|
758
|
-
const t = (e == null ? void 0 : e.backgroundColor) ?? "#f5f5f5", r = (e == null ? void 0 : e.foregroundColor) ?? "#1677ff",
|
|
759
|
-
return k("progress", (
|
|
759
|
+
function Bt(e) {
|
|
760
|
+
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";
|
|
761
|
+
return k("progress", (l, i) => {
|
|
760
762
|
var h;
|
|
761
|
-
const o = T(
|
|
763
|
+
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
764
|
return f("div", {
|
|
763
765
|
style: `background-color:${t};position:relative;min-height: 20px;text-align: center;border-radius: 2px;overflow:hidden;`
|
|
764
766
|
}, [f("div", {
|
|
765
767
|
style: `background-color: ${r};position:absolute;left:0;top:0;right;0;width: ${m};height: 100%;`
|
|
766
|
-
}, null),
|
|
768
|
+
}, null), u && f("div", {
|
|
767
769
|
style: `position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:${a}`
|
|
768
770
|
}, [m])]);
|
|
769
771
|
});
|
|
770
772
|
}
|
|
771
|
-
function
|
|
772
|
-
return k("serial", (r,
|
|
773
|
+
function Dt(e) {
|
|
774
|
+
return k("serial", (r, u, a) => {
|
|
773
775
|
const n = {
|
|
774
776
|
color: typeof (e == null ? void 0 : e.color) == "function" ? e.color(r) : e == null ? void 0 : e.color,
|
|
775
777
|
fontWeight: (e == null ? void 0 : e.weight) || "normal",
|
|
@@ -782,38 +784,38 @@ function Bt(e) {
|
|
|
782
784
|
disableViewMode: !0
|
|
783
785
|
});
|
|
784
786
|
}
|
|
785
|
-
function
|
|
787
|
+
function Vt() {
|
|
786
788
|
return {
|
|
787
|
-
dropdown:
|
|
788
|
-
text:
|
|
789
|
-
dict:
|
|
790
|
-
tag:
|
|
791
|
-
render:
|
|
792
|
-
phone:
|
|
789
|
+
dropdown: yt,
|
|
790
|
+
text: At,
|
|
791
|
+
dict: ht,
|
|
792
|
+
tag: qt,
|
|
793
|
+
render: Rt,
|
|
794
|
+
phone: jt,
|
|
793
795
|
image: bt,
|
|
794
|
-
currency:
|
|
795
|
-
date:
|
|
796
|
-
button:
|
|
797
|
-
progress:
|
|
798
|
-
serial:
|
|
796
|
+
currency: ut,
|
|
797
|
+
date: st,
|
|
798
|
+
button: at,
|
|
799
|
+
progress: Bt,
|
|
800
|
+
serial: Dt
|
|
799
801
|
};
|
|
800
802
|
}
|
|
801
803
|
function G(e, t) {
|
|
802
804
|
if (!(e != null && e.render))
|
|
803
805
|
return;
|
|
804
806
|
const r = e.render({
|
|
805
|
-
...
|
|
807
|
+
...Vt()
|
|
806
808
|
// ...(Table?.$override?.table || {}),
|
|
807
809
|
});
|
|
808
810
|
return {
|
|
809
811
|
render: ({
|
|
810
|
-
record:
|
|
812
|
+
record: u,
|
|
811
813
|
rowIndex: a
|
|
812
|
-
}) => r(
|
|
814
|
+
}) => r(u, e, {
|
|
813
815
|
...t || {},
|
|
814
816
|
rowIndex: a
|
|
815
817
|
}),
|
|
816
|
-
[
|
|
818
|
+
[nt]: r.$type,
|
|
817
819
|
disableColumnMode: r.$disableColumnMode,
|
|
818
820
|
disableViewMode: r.$disableViewMode,
|
|
819
821
|
isRender: r.$type === "render",
|
|
@@ -824,50 +826,50 @@ function de({
|
|
|
824
826
|
columns: e,
|
|
825
827
|
columnsOptions: t,
|
|
826
828
|
columnsGroups: r,
|
|
827
|
-
pageMode:
|
|
829
|
+
pageMode: u,
|
|
828
830
|
collapsedColumns: a,
|
|
829
831
|
events: n
|
|
830
832
|
}) {
|
|
831
|
-
const
|
|
833
|
+
const l = e.map((i) => ({
|
|
832
834
|
...t || {},
|
|
833
835
|
...i
|
|
834
|
-
})).map((i) =>
|
|
835
|
-
return
|
|
836
|
+
})).map((i) => It(i, u, a, n)).filter(Boolean);
|
|
837
|
+
return Ht(l, r);
|
|
836
838
|
}
|
|
837
|
-
function
|
|
838
|
-
const r = [],
|
|
839
|
-
if ("children" in n && (n.children = n.children.map(
|
|
840
|
-
const
|
|
839
|
+
function Ft(e, t) {
|
|
840
|
+
const r = [], u = (n) => {
|
|
841
|
+
if ("children" in n && (n.children = n.children.map(u)), "key" in n) {
|
|
842
|
+
const l = t.find((i) => {
|
|
841
843
|
var o;
|
|
842
844
|
return ((o = Object.getOwnPropertyDescriptor(i, "key")) == null ? void 0 : o.value) === n.key;
|
|
843
845
|
});
|
|
844
|
-
if (
|
|
845
|
-
return r.push(
|
|
846
|
+
if (l)
|
|
847
|
+
return r.push(l), l;
|
|
846
848
|
}
|
|
847
849
|
return n;
|
|
848
|
-
}, a =
|
|
850
|
+
}, a = u(e);
|
|
849
851
|
if (r != null && r.length && a) {
|
|
850
|
-
const n = Math.min(...r.map((
|
|
851
|
-
r.forEach((
|
|
852
|
-
const i = t.indexOf(
|
|
852
|
+
const n = Math.min(...r.map((l) => t.indexOf(l)));
|
|
853
|
+
r.forEach((l) => {
|
|
854
|
+
const i = t.indexOf(l);
|
|
853
855
|
t.splice(i, 1);
|
|
854
856
|
}), t.splice(n, 0, a);
|
|
855
857
|
}
|
|
856
858
|
}
|
|
857
|
-
function
|
|
859
|
+
function Ht(e, t = []) {
|
|
858
860
|
return t.forEach((r) => {
|
|
859
|
-
|
|
861
|
+
Ft(r, e);
|
|
860
862
|
}), e;
|
|
861
863
|
}
|
|
862
|
-
function
|
|
864
|
+
function It(e, t, r, u) {
|
|
863
865
|
const {
|
|
864
866
|
render: a,
|
|
865
867
|
disableColumnMode: n
|
|
866
868
|
} = G(e, {
|
|
867
869
|
previewing: !1,
|
|
868
|
-
emits:
|
|
870
|
+
emits: u
|
|
869
871
|
}) || {};
|
|
870
|
-
if (!(n || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !r.value.find((
|
|
872
|
+
if (!(n || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !r.value.find((l) => l.key === e.key && l.collapsed === !0))
|
|
871
873
|
return {
|
|
872
874
|
dataIndex: e.index || e.key,
|
|
873
875
|
title: e.title,
|
|
@@ -886,10 +888,10 @@ function Ht(e, t, r, l) {
|
|
|
886
888
|
render: a
|
|
887
889
|
};
|
|
888
890
|
}
|
|
889
|
-
function
|
|
890
|
-
return new
|
|
891
|
+
function Kt() {
|
|
892
|
+
return new Xe.Workbook();
|
|
891
893
|
}
|
|
892
|
-
function
|
|
894
|
+
function Wt(e, t = "Sheet1") {
|
|
893
895
|
return e.addWorksheet(t, {
|
|
894
896
|
headerFooter: {
|
|
895
897
|
firstHeader: "",
|
|
@@ -897,29 +899,29 @@ function Kt(e, t = "Sheet1") {
|
|
|
897
899
|
}
|
|
898
900
|
});
|
|
899
901
|
}
|
|
900
|
-
function
|
|
902
|
+
function Nt(e, t) {
|
|
901
903
|
e.columns = t;
|
|
902
904
|
}
|
|
903
|
-
function
|
|
905
|
+
function Ut(e, t) {
|
|
904
906
|
e.addRows(t);
|
|
905
907
|
}
|
|
906
|
-
async function
|
|
908
|
+
async function Gt({
|
|
907
909
|
columns: e,
|
|
908
910
|
rows: t,
|
|
909
911
|
filename: r
|
|
910
912
|
}) {
|
|
911
|
-
const
|
|
912
|
-
|
|
913
|
-
const n = await
|
|
914
|
-
|
|
913
|
+
const u = Kt(), a = Wt(u);
|
|
914
|
+
Nt(a, e), Ut(a, t);
|
|
915
|
+
const n = await u.xlsx.writeBuffer(), l = new Blob([n]);
|
|
916
|
+
Zt(l, r || `${V().format("YYYY-MM-DD HH:mm:ss")}.xlsx`);
|
|
915
917
|
}
|
|
916
|
-
function
|
|
918
|
+
function Zt(e, t) {
|
|
917
919
|
const r = document.createElement("a");
|
|
918
920
|
r.download = t || "download", r.href = URL.createObjectURL(e), r.click(), setTimeout(() => {
|
|
919
921
|
URL.revokeObjectURL(r.href);
|
|
920
922
|
}, 1e3);
|
|
921
923
|
}
|
|
922
|
-
function
|
|
924
|
+
function Jt(e, t) {
|
|
923
925
|
const r = {};
|
|
924
926
|
return e.filter((a) => a.exportable !== !1).map((a) => ({
|
|
925
927
|
options: a,
|
|
@@ -927,25 +929,25 @@ function Zt(e, t) {
|
|
|
927
929
|
content: typeof a.exportable == "object" ? a.exportable.content : void 0
|
|
928
930
|
})).forEach((a) => {
|
|
929
931
|
var i;
|
|
930
|
-
const n = (i = a.render) == null ? void 0 : i.render,
|
|
932
|
+
const n = (i = a.render) == null ? void 0 : i.render, l = () => {
|
|
931
933
|
var o;
|
|
932
934
|
switch (!0) {
|
|
933
935
|
case !!a.content:
|
|
934
936
|
return a.content && a.content(t);
|
|
935
937
|
case !!n: {
|
|
936
|
-
const
|
|
938
|
+
const d = document.createElement("div"), s = Ye(() => n && n({
|
|
937
939
|
record: t
|
|
938
940
|
}));
|
|
939
|
-
return Ae(s,
|
|
941
|
+
return Ae(s, d), (o = s.el) == null ? void 0 : o.innerText;
|
|
940
942
|
}
|
|
941
943
|
default:
|
|
942
944
|
return T(t, a.options);
|
|
943
945
|
}
|
|
944
946
|
};
|
|
945
|
-
r[a.options.key] =
|
|
947
|
+
r[a.options.key] = l();
|
|
946
948
|
}), r;
|
|
947
949
|
}
|
|
948
|
-
function
|
|
950
|
+
function Qt(e) {
|
|
949
951
|
switch (!0) {
|
|
950
952
|
case typeof e == "number":
|
|
951
953
|
return e / 6;
|
|
@@ -955,31 +957,31 @@ function Jt(e) {
|
|
|
955
957
|
return 30;
|
|
956
958
|
}
|
|
957
959
|
}
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
var
|
|
960
|
+
function Xt(e, t, r) {
|
|
961
|
+
const u = e.filter((n) => n.exportable !== !1).map((n) => {
|
|
962
|
+
var l, i;
|
|
961
963
|
return {
|
|
962
964
|
key: n.key,
|
|
963
|
-
header: ((
|
|
964
|
-
width: ((i = n.exportable) == null ? void 0 : i.width) ||
|
|
965
|
+
header: ((l = n.exportable) == null ? void 0 : l.header) || n.title,
|
|
966
|
+
width: ((i = n.exportable) == null ? void 0 : i.width) || Qt(n.width)
|
|
965
967
|
};
|
|
966
|
-
}), a = t.map((n) =>
|
|
967
|
-
|
|
968
|
-
columns:
|
|
968
|
+
}), a = t.map((n) => Jt(e, n));
|
|
969
|
+
Gt({
|
|
970
|
+
columns: u,
|
|
969
971
|
rows: a,
|
|
970
972
|
filename: r
|
|
971
973
|
});
|
|
972
974
|
}
|
|
973
|
-
function
|
|
975
|
+
function pt() {
|
|
974
976
|
return {
|
|
975
|
-
exportExcel:
|
|
977
|
+
exportExcel: Xt
|
|
976
978
|
};
|
|
977
979
|
}
|
|
978
980
|
class Z {
|
|
979
981
|
constructor(t) {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
982
|
+
$(this, "sort", {});
|
|
983
|
+
$(this, "defaultSort", {});
|
|
984
|
+
$(this, "before", (t) => {
|
|
983
985
|
t.paramsQuery = {
|
|
984
986
|
...t.paramsQuery || {},
|
|
985
987
|
sort: this.stringify(this.sort)
|
|
@@ -1000,9 +1002,9 @@ class Z {
|
|
|
1000
1002
|
* @param key 排序关键字
|
|
1001
1003
|
*/
|
|
1002
1004
|
remove(t) {
|
|
1003
|
-
const r = Object.entries(this.sort).filter(([
|
|
1004
|
-
this.sort = {}, r && r.forEach(([
|
|
1005
|
-
this.sort[
|
|
1005
|
+
const r = Object.entries(this.sort).filter(([u]) => u !== t);
|
|
1006
|
+
this.sort = {}, r && r.forEach(([u, a]) => {
|
|
1007
|
+
this.sort[u] = a;
|
|
1006
1008
|
});
|
|
1007
1009
|
}
|
|
1008
1010
|
/**
|
|
@@ -1015,35 +1017,35 @@ class Z {
|
|
|
1015
1017
|
* 转换排序对象为字符串
|
|
1016
1018
|
*/
|
|
1017
1019
|
stringify(t) {
|
|
1018
|
-
return typeof t != "object" ? [] : (t instanceof Z && (t = t.sort), Object.entries(t).map(([r,
|
|
1020
|
+
return typeof t != "object" ? [] : (t instanceof Z && (t = t.sort), Object.entries(t).map(([r, u]) => `${r},${u}`));
|
|
1019
1021
|
}
|
|
1020
1022
|
}
|
|
1021
|
-
const
|
|
1022
|
-
function
|
|
1023
|
+
const er = 300;
|
|
1024
|
+
function tr(e) {
|
|
1023
1025
|
const t = e, r = t == null ? void 0 : t.querySelector(".arco-scrollbar-container.arco-table-body");
|
|
1024
1026
|
if (!r)
|
|
1025
1027
|
return;
|
|
1026
|
-
let
|
|
1028
|
+
let u, a = !1, n;
|
|
1027
1029
|
r.addEventListener("mousedown", () => {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1030
|
+
u = setTimeout(() => {
|
|
1031
|
+
u && (r.style.cursor = "grab", r.style.userSelect = "none", a = !0);
|
|
1032
|
+
}, er);
|
|
1031
1033
|
}), r.addEventListener("mouseup", () => {
|
|
1032
|
-
clearTimeout(
|
|
1033
|
-
}), r.addEventListener("mousemove", (
|
|
1034
|
+
clearTimeout(u), u && (u = void 0, a = !1, r.style.cursor = "", r.style.userSelect = "", n = void 0);
|
|
1035
|
+
}), r.addEventListener("mousemove", (l) => {
|
|
1034
1036
|
if (a)
|
|
1035
1037
|
if (n === void 0)
|
|
1036
|
-
n =
|
|
1038
|
+
n = l.clientX;
|
|
1037
1039
|
else {
|
|
1038
|
-
const i = n -
|
|
1039
|
-
n =
|
|
1040
|
+
const i = n - l.clientX;
|
|
1041
|
+
n = l.clientX, r.scrollLeft += i;
|
|
1040
1042
|
}
|
|
1041
1043
|
});
|
|
1042
1044
|
}
|
|
1043
|
-
function
|
|
1045
|
+
function rr(e) {
|
|
1044
1046
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Be(e);
|
|
1045
1047
|
}
|
|
1046
|
-
const
|
|
1048
|
+
const nr = /* @__PURE__ */ B({
|
|
1047
1049
|
props: {
|
|
1048
1050
|
record: {
|
|
1049
1051
|
type: Object,
|
|
@@ -1077,7 +1079,7 @@ const rr = /* @__PURE__ */ B({
|
|
|
1077
1079
|
}
|
|
1078
1080
|
},
|
|
1079
1081
|
setup(e) {
|
|
1080
|
-
const t = H(), r =
|
|
1082
|
+
const t = H(), r = b(0), u = e.columns.filter((n) => typeof n.visiable == "boolean" ? n.visiable : typeof n.visiable == "function" ? n.visiable() : !0).map((n) => ({
|
|
1081
1083
|
options: n,
|
|
1082
1084
|
renderer: G(n, {
|
|
1083
1085
|
previewing: !0
|
|
@@ -1085,16 +1087,16 @@ const rr = /* @__PURE__ */ B({
|
|
|
1085
1087
|
})).filter(({
|
|
1086
1088
|
options: n
|
|
1087
1089
|
}) => {
|
|
1088
|
-
var
|
|
1089
|
-
return !((
|
|
1090
|
+
var l;
|
|
1091
|
+
return !((l = e.exclude) != null && l.includes(n.key));
|
|
1090
1092
|
}).filter(({
|
|
1091
1093
|
renderer: n
|
|
1092
1094
|
}) => !(n != null && n.disableViewMode));
|
|
1093
1095
|
function a() {
|
|
1094
1096
|
var n;
|
|
1095
1097
|
if (t) {
|
|
1096
|
-
const
|
|
1097
|
-
r.value = Math.floor(
|
|
1098
|
+
const l = (n = t.proxy) == null ? void 0 : n.$el;
|
|
1099
|
+
r.value = Math.floor(l.offsetWidth / e.minWidth);
|
|
1098
1100
|
}
|
|
1099
1101
|
}
|
|
1100
1102
|
return A(() => {
|
|
@@ -1103,19 +1105,19 @@ const rr = /* @__PURE__ */ B({
|
|
|
1103
1105
|
let n;
|
|
1104
1106
|
return f("div", {
|
|
1105
1107
|
class: "preview-container"
|
|
1106
|
-
}, [f(
|
|
1108
|
+
}, [f(Ke, {
|
|
1107
1109
|
column: r.value,
|
|
1108
1110
|
bordered: !0,
|
|
1109
1111
|
align: "left",
|
|
1110
1112
|
layout: e.layout
|
|
1111
|
-
},
|
|
1112
|
-
label:
|
|
1113
|
+
}, rr(n = u.map((l) => f(We, {
|
|
1114
|
+
label: l.options.title
|
|
1113
1115
|
}, {
|
|
1114
1116
|
default: () => {
|
|
1115
1117
|
var i, o;
|
|
1116
|
-
return [(i =
|
|
1118
|
+
return [(i = l.renderer) != null && i.render ? (o = l.renderer) == null ? void 0 : o.render({
|
|
1117
1119
|
record: e.record
|
|
1118
|
-
}) : T(e.record,
|
|
1120
|
+
}) : T(e.record, l.options)];
|
|
1119
1121
|
}
|
|
1120
1122
|
}))) ? n : {
|
|
1121
1123
|
default: () => [n]
|
|
@@ -1123,12 +1125,12 @@ const rr = /* @__PURE__ */ B({
|
|
|
1123
1125
|
};
|
|
1124
1126
|
}
|
|
1125
1127
|
});
|
|
1126
|
-
function
|
|
1128
|
+
function ar(e, t, {
|
|
1127
1129
|
tableForm: r,
|
|
1128
|
-
tableEvents:
|
|
1130
|
+
tableEvents: u
|
|
1129
1131
|
}) {
|
|
1130
1132
|
const a = e.refreshable || e.exportable || t.slots.actions, n = !!(r != null && r.length) && a;
|
|
1131
|
-
return a || n ? () => f(I, null, [n && f(
|
|
1133
|
+
return a || n ? () => f(I, null, [n && f(Ne, {
|
|
1132
1134
|
margin: 0
|
|
1133
1135
|
}, null), a && f("div", {
|
|
1134
1136
|
class: "table-actions",
|
|
@@ -1144,19 +1146,19 @@ function nr(e, t, {
|
|
|
1144
1146
|
}, [f(ae, null, {
|
|
1145
1147
|
default: () => [e.refreshable && f(P, {
|
|
1146
1148
|
type: "primary",
|
|
1147
|
-
onClick: () =>
|
|
1149
|
+
onClick: () => u("reload")
|
|
1148
1150
|
}, {
|
|
1149
|
-
default: () => [
|
|
1151
|
+
default: () => [E("刷新")]
|
|
1150
1152
|
}), e.exportable && f(P, {
|
|
1151
1153
|
type: "primary",
|
|
1152
|
-
onClick: () =>
|
|
1154
|
+
onClick: () => u("export")
|
|
1153
1155
|
}, {
|
|
1154
|
-
default: () => [
|
|
1156
|
+
default: () => [E("导出")]
|
|
1155
1157
|
}), e.collapsable && f(P, {
|
|
1156
1158
|
type: "primary",
|
|
1157
|
-
onClick: () =>
|
|
1159
|
+
onClick: () => u("collapse")
|
|
1158
1160
|
}, {
|
|
1159
|
-
default: () => [
|
|
1161
|
+
default: () => [E("显示")]
|
|
1160
1162
|
})]
|
|
1161
1163
|
})]), f("div", {
|
|
1162
1164
|
class: "customs"
|
|
@@ -1165,9 +1167,9 @@ function nr(e, t, {
|
|
|
1165
1167
|
})])])]) : () => {
|
|
1166
1168
|
};
|
|
1167
1169
|
}
|
|
1168
|
-
function
|
|
1170
|
+
function lr(e, t, {
|
|
1169
1171
|
tableForm: r,
|
|
1170
|
-
tableEvents:
|
|
1172
|
+
tableEvents: u,
|
|
1171
1173
|
formInstance: a
|
|
1172
1174
|
}) {
|
|
1173
1175
|
return r != null && r.length ? () => f("div", {
|
|
@@ -1176,7 +1178,7 @@ function ar(e, t, {
|
|
|
1176
1178
|
form: r,
|
|
1177
1179
|
ref: (n) => a && (a.value = n),
|
|
1178
1180
|
searchable: !0,
|
|
1179
|
-
onSubmit: () =>
|
|
1181
|
+
onSubmit: () => u("reload", {
|
|
1180
1182
|
reset: !0
|
|
1181
1183
|
})
|
|
1182
1184
|
}, e.formOptions), {
|
|
@@ -1184,49 +1186,49 @@ function ar(e, t, {
|
|
|
1184
1186
|
})]) : () => {
|
|
1185
1187
|
};
|
|
1186
1188
|
}
|
|
1187
|
-
function
|
|
1189
|
+
function ur(e, t, {
|
|
1188
1190
|
tableSource: r
|
|
1189
1191
|
}) {
|
|
1190
|
-
const
|
|
1192
|
+
const u = b([]);
|
|
1191
1193
|
function a() {
|
|
1192
|
-
|
|
1194
|
+
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
1195
|
}
|
|
1194
1196
|
function n() {
|
|
1195
1197
|
re(() => {
|
|
1196
|
-
e.checkboxRows !== void 0 && (
|
|
1198
|
+
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
1199
|
});
|
|
1198
1200
|
}
|
|
1199
|
-
function
|
|
1200
|
-
const
|
|
1201
|
+
function l() {
|
|
1202
|
+
const d = typeof e.selection == "string" ? {
|
|
1201
1203
|
type: e.selection
|
|
1202
1204
|
} : e.selection;
|
|
1203
|
-
switch (
|
|
1205
|
+
switch (d == null ? void 0 : d.type) {
|
|
1204
1206
|
case "radio":
|
|
1205
1207
|
return {
|
|
1206
1208
|
title: "选择",
|
|
1207
1209
|
width: 80,
|
|
1208
|
-
selectedRowKeys:
|
|
1209
|
-
...
|
|
1210
|
+
selectedRowKeys: u.value,
|
|
1211
|
+
...d
|
|
1210
1212
|
};
|
|
1211
1213
|
case "checkbox":
|
|
1212
1214
|
return {
|
|
1213
1215
|
width: 80,
|
|
1214
1216
|
showCheckedAll: !0,
|
|
1215
|
-
selectedRowKeys:
|
|
1216
|
-
...
|
|
1217
|
+
selectedRowKeys: u.value,
|
|
1218
|
+
...d
|
|
1217
1219
|
};
|
|
1218
1220
|
}
|
|
1219
1221
|
}
|
|
1220
|
-
function i(
|
|
1222
|
+
function i(d, s, m) {
|
|
1221
1223
|
const {
|
|
1222
1224
|
type: h
|
|
1223
|
-
} =
|
|
1225
|
+
} = l() || {};
|
|
1224
1226
|
switch (h) {
|
|
1225
1227
|
case "radio":
|
|
1226
1228
|
t.emit("update:radio-key", s), t.emit("update:radio-row", m);
|
|
1227
1229
|
break;
|
|
1228
1230
|
case "checkbox":
|
|
1229
|
-
t.emit("update:checkbox-keys",
|
|
1231
|
+
t.emit("update:checkbox-keys", d), t.emit("update:checkbox-rows", d.map((w) => {
|
|
1230
1232
|
var S;
|
|
1231
1233
|
return r.value.find((x) => x[e.rowKey] === w) || ((S = e.checkboxRows) == null ? void 0 : S.find((x) => x[e.rowKey] === w));
|
|
1232
1234
|
}));
|
|
@@ -1235,32 +1237,32 @@ function lr(e, t, {
|
|
|
1235
1237
|
}
|
|
1236
1238
|
function o() {
|
|
1237
1239
|
re(() => {
|
|
1238
|
-
t.emit("update:checkbox-keys",
|
|
1240
|
+
t.emit("update:checkbox-keys", u.value), t.emit("update:checkbox-rows", u.value.map((d) => {
|
|
1239
1241
|
var s;
|
|
1240
|
-
return r.value.find((m) => m[e.rowKey] ===
|
|
1242
|
+
return r.value.find((m) => m[e.rowKey] === d) || ((s = e.checkboxRows) == null ? void 0 : s.find((m) => m[e.rowKey] === d));
|
|
1241
1243
|
}));
|
|
1242
1244
|
});
|
|
1243
1245
|
}
|
|
1244
1246
|
return n(), {
|
|
1245
|
-
selectedRowKeys:
|
|
1246
|
-
rowSelection:
|
|
1247
|
+
selectedRowKeys: u,
|
|
1248
|
+
rowSelection: l(),
|
|
1247
1249
|
onSelect: i,
|
|
1248
1250
|
onSelectAll: o,
|
|
1249
1251
|
resetSelection: a,
|
|
1250
1252
|
reloadSelection: n
|
|
1251
1253
|
};
|
|
1252
1254
|
}
|
|
1253
|
-
function
|
|
1255
|
+
function ir(e, t, {
|
|
1254
1256
|
pageService: r,
|
|
1255
|
-
tableEvents:
|
|
1257
|
+
tableEvents: u
|
|
1256
1258
|
}) {
|
|
1257
1259
|
function a(i) {
|
|
1258
|
-
r && (r.pageIndex = i,
|
|
1260
|
+
r && (r.pageIndex = i, u("reload"));
|
|
1259
1261
|
}
|
|
1260
1262
|
function n(i) {
|
|
1261
|
-
r && (r.pageSize = i,
|
|
1263
|
+
r && (r.pageSize = i, u("reload"));
|
|
1262
1264
|
}
|
|
1263
|
-
const
|
|
1265
|
+
const l = _t({
|
|
1264
1266
|
mobile: 0,
|
|
1265
1267
|
tablet: 640,
|
|
1266
1268
|
desktop: 1024
|
|
@@ -1270,7 +1272,7 @@ function ur(e, t, {
|
|
|
1270
1272
|
style: {
|
|
1271
1273
|
padding: "10px 0"
|
|
1272
1274
|
}
|
|
1273
|
-
}, [f(
|
|
1275
|
+
}, [f(Ue, {
|
|
1274
1276
|
current: r.pageIndex,
|
|
1275
1277
|
"onUpdate:current": (i) => r.pageIndex = i,
|
|
1276
1278
|
"page-size": r.pageSize,
|
|
@@ -1281,7 +1283,7 @@ function ur(e, t, {
|
|
|
1281
1283
|
"show-total": !0,
|
|
1282
1284
|
"show-page-size": !0,
|
|
1283
1285
|
size: "small",
|
|
1284
|
-
simple:
|
|
1286
|
+
simple: l.smaller("desktop").value,
|
|
1285
1287
|
onChange: (i) => a(i),
|
|
1286
1288
|
onPageSizeChange: (i) => n(i),
|
|
1287
1289
|
style: {
|
|
@@ -1290,7 +1292,7 @@ function ur(e, t, {
|
|
|
1290
1292
|
}, null)]) : () => {
|
|
1291
1293
|
};
|
|
1292
1294
|
}
|
|
1293
|
-
const
|
|
1295
|
+
const cr = /* @__PURE__ */ B({
|
|
1294
1296
|
props: {
|
|
1295
1297
|
collapsedColumns: {
|
|
1296
1298
|
type: Array,
|
|
@@ -1298,24 +1300,24 @@ const ir = /* @__PURE__ */ B({
|
|
|
1298
1300
|
}
|
|
1299
1301
|
},
|
|
1300
1302
|
setup(e) {
|
|
1301
|
-
const t = D(), r =
|
|
1303
|
+
const t = D(), r = b(e.collapsedColumns.map((a) => ({
|
|
1302
1304
|
label: a.title,
|
|
1303
1305
|
value: a.key,
|
|
1304
1306
|
disabled: !1
|
|
1305
|
-
}))),
|
|
1306
|
-
return
|
|
1307
|
+
}))), u = b(e.collapsedColumns.filter((a) => a.collapsed).map((a) => a.key));
|
|
1308
|
+
return Je(() => {
|
|
1307
1309
|
const a = e.collapsedColumns.map((n) => ({
|
|
1308
1310
|
key: n.key,
|
|
1309
1311
|
title: n.title,
|
|
1310
|
-
collapsed:
|
|
1312
|
+
collapsed: u.value.includes(n.key)
|
|
1311
1313
|
}));
|
|
1312
1314
|
t.close(a);
|
|
1313
1315
|
}), () => f("div", {
|
|
1314
1316
|
class: "table-collapsed-render"
|
|
1315
|
-
}, [f(
|
|
1317
|
+
}, [f(Ge, {
|
|
1316
1318
|
data: r.value,
|
|
1317
|
-
"default-value":
|
|
1318
|
-
onChange: (a) =>
|
|
1319
|
+
"default-value": u.value,
|
|
1320
|
+
onChange: (a) => u.value = [...a],
|
|
1319
1321
|
title: ["显示列", "隐藏列"],
|
|
1320
1322
|
style: {
|
|
1321
1323
|
justifyContent: "center"
|
|
@@ -1324,7 +1326,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1324
1326
|
default: () => [De(f("template", null, null), [[Ve("slot"), "source"]])]
|
|
1325
1327
|
})]);
|
|
1326
1328
|
}
|
|
1327
|
-
}),
|
|
1329
|
+
}), dr = /* @__PURE__ */ B({
|
|
1328
1330
|
props: {
|
|
1329
1331
|
value: {
|
|
1330
1332
|
type: Object,
|
|
@@ -1341,8 +1343,8 @@ const ir = /* @__PURE__ */ B({
|
|
|
1341
1343
|
},
|
|
1342
1344
|
setup(e) {
|
|
1343
1345
|
const t = D();
|
|
1344
|
-
function r(
|
|
1345
|
-
e.onSubmit && e.onSubmit(
|
|
1346
|
+
function r(u) {
|
|
1347
|
+
e.onSubmit && e.onSubmit(u), t.close(u);
|
|
1346
1348
|
}
|
|
1347
1349
|
return () => f("div", {
|
|
1348
1350
|
class: "edit-form-container"
|
|
@@ -1353,7 +1355,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1353
1355
|
onSubmit: r
|
|
1354
1356
|
}, null)]);
|
|
1355
1357
|
}
|
|
1356
|
-
}),
|
|
1358
|
+
}), sr = /* @__PURE__ */ B({
|
|
1357
1359
|
props: {
|
|
1358
1360
|
// 数据主键
|
|
1359
1361
|
rowKey: {
|
|
@@ -1502,10 +1504,10 @@ const ir = /* @__PURE__ */ B({
|
|
|
1502
1504
|
},
|
|
1503
1505
|
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
1506
|
setup(e, t) {
|
|
1505
|
-
const r = Math.random().toString(32).slice(2).toUpperCase(),
|
|
1506
|
-
key:
|
|
1507
|
-
title:
|
|
1508
|
-
collapsed: !!
|
|
1507
|
+
const r = Math.random().toString(32).slice(2).toUpperCase(), u = b(), a = b(), n = b(), l = b(), [i, o] = et(e.columns), d = b(!1), s = e.form ?? tt(e.columns), m = S(), h = j(), w = b(e.columns.map((c) => ({
|
|
1508
|
+
key: c.key,
|
|
1509
|
+
title: c.title,
|
|
1510
|
+
collapsed: !!c.collapsed
|
|
1509
1511
|
})));
|
|
1510
1512
|
function S() {
|
|
1511
1513
|
switch (!0) {
|
|
@@ -1530,144 +1532,144 @@ const ir = /* @__PURE__ */ B({
|
|
|
1530
1532
|
}
|
|
1531
1533
|
})();
|
|
1532
1534
|
function j() {
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1535
|
+
const c = e.columns.find((g) => !!g.sortable);
|
|
1536
|
+
if (c || e.sortable)
|
|
1535
1537
|
return new Z({
|
|
1536
1538
|
...e.sortable || {},
|
|
1537
|
-
...
|
|
1538
|
-
[
|
|
1539
|
+
...c ? {
|
|
1540
|
+
[c.key]: c.sortable
|
|
1539
1541
|
} : {}
|
|
1540
1542
|
});
|
|
1541
1543
|
}
|
|
1542
|
-
function v(
|
|
1544
|
+
function v(c) {
|
|
1543
1545
|
const {
|
|
1544
|
-
exportExcel:
|
|
1545
|
-
} =
|
|
1546
|
-
|
|
1546
|
+
exportExcel: g
|
|
1547
|
+
} = pt();
|
|
1548
|
+
g((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
1549
|
}
|
|
1548
|
-
function y(
|
|
1549
|
-
let
|
|
1550
|
+
function y(c) {
|
|
1551
|
+
let g;
|
|
1550
1552
|
switch (!0) {
|
|
1551
|
-
case !!(
|
|
1552
|
-
|
|
1553
|
+
case !!(c != null && c.key):
|
|
1554
|
+
g = i.value.find((_) => _[e.rowKey] === (c == null ? void 0 : c.key));
|
|
1553
1555
|
break;
|
|
1554
|
-
case !!(
|
|
1555
|
-
|
|
1556
|
+
case !!(c != null && c.record):
|
|
1557
|
+
g = c == null ? void 0 : c.record;
|
|
1556
1558
|
break;
|
|
1557
1559
|
}
|
|
1558
|
-
if (!
|
|
1560
|
+
if (!g)
|
|
1559
1561
|
throw new Error("未找到需要预览的数据");
|
|
1560
|
-
return n.value.open(
|
|
1561
|
-
record:
|
|
1562
|
+
return n.value.open(nr, {
|
|
1563
|
+
record: g,
|
|
1562
1564
|
columns: e.columns
|
|
1563
1565
|
}, {
|
|
1564
|
-
title: (
|
|
1565
|
-
mode: (
|
|
1566
|
+
title: (c == null ? void 0 : c.title) || "详情",
|
|
1567
|
+
mode: (c == null ? void 0 : c.mode) || "dialog"
|
|
1566
1568
|
});
|
|
1567
1569
|
}
|
|
1568
|
-
function C(
|
|
1569
|
-
let
|
|
1570
|
+
function C(c) {
|
|
1571
|
+
let g;
|
|
1570
1572
|
switch (!0) {
|
|
1571
|
-
case !!(
|
|
1572
|
-
|
|
1573
|
+
case !!(c != null && c.key):
|
|
1574
|
+
g = i.value.find((_) => _[e.rowKey] === (c == null ? void 0 : c.key));
|
|
1573
1575
|
break;
|
|
1574
|
-
case !!(
|
|
1575
|
-
|
|
1576
|
+
case !!(c != null && c.record):
|
|
1577
|
+
g = c == null ? void 0 : c.record;
|
|
1576
1578
|
break;
|
|
1577
1579
|
}
|
|
1578
|
-
if (!
|
|
1580
|
+
if (!g)
|
|
1579
1581
|
throw new Error("未找到需要编辑的数据");
|
|
1580
|
-
return n.value.open(
|
|
1581
|
-
value:
|
|
1582
|
-
form:
|
|
1583
|
-
onSubmit:
|
|
1582
|
+
return n.value.open(dr, {
|
|
1583
|
+
value: g,
|
|
1584
|
+
form: c == null ? void 0 : c.form,
|
|
1585
|
+
onSubmit: c.onSubmit
|
|
1584
1586
|
}, {
|
|
1585
|
-
title: (
|
|
1586
|
-
mode: (
|
|
1587
|
+
title: (c == null ? void 0 : c.title) || "编辑",
|
|
1588
|
+
mode: (c == null ? void 0 : c.mode) || "dialog",
|
|
1587
1589
|
footer: !0,
|
|
1588
1590
|
form: "form"
|
|
1589
1591
|
});
|
|
1590
1592
|
}
|
|
1591
|
-
function M(
|
|
1593
|
+
function M(c) {
|
|
1592
1594
|
var p, ee;
|
|
1593
1595
|
if (!e.dataLoad)
|
|
1594
1596
|
return Promise.reject();
|
|
1595
|
-
|
|
1596
|
-
const
|
|
1597
|
+
c != null && c.reset && (m && m.reset(), h && h.reset(), (p = u.value) == null || p.resetSorters());
|
|
1598
|
+
const g = {
|
|
1597
1599
|
...((ee = a.value) == null ? void 0 : ee.formSource) || {}
|
|
1598
1600
|
};
|
|
1599
|
-
Object.keys(
|
|
1600
|
-
[null, void 0, ""].includes(
|
|
1601
|
+
Object.keys(g).forEach((te) => {
|
|
1602
|
+
[null, void 0, ""].includes(g[te]) && delete g[te];
|
|
1601
1603
|
});
|
|
1602
1604
|
const _ = e.dataLoad({
|
|
1603
|
-
form:
|
|
1605
|
+
form: g,
|
|
1604
1606
|
page: m,
|
|
1605
1607
|
sort: h,
|
|
1606
1608
|
update: o
|
|
1607
1609
|
});
|
|
1608
|
-
return Y(_) ? (
|
|
1609
|
-
|
|
1610
|
+
return Y(_) ? (d.value = !0, Promise.resolve(_).finally(() => {
|
|
1611
|
+
d.value = !1;
|
|
1610
1612
|
}), _) : Promise.resolve();
|
|
1611
1613
|
}
|
|
1612
1614
|
function ye() {
|
|
1613
|
-
n.value.open(
|
|
1615
|
+
n.value.open(cr, {
|
|
1614
1616
|
collapsedColumns: w.value
|
|
1615
1617
|
}, {
|
|
1616
1618
|
title: "显示列",
|
|
1617
1619
|
size: "small",
|
|
1618
1620
|
footer: !0
|
|
1619
|
-
}).then((
|
|
1620
|
-
w.value =
|
|
1621
|
+
}).then((c) => {
|
|
1622
|
+
w.value = c;
|
|
1621
1623
|
});
|
|
1622
1624
|
}
|
|
1623
|
-
const
|
|
1624
|
-
type:
|
|
1625
|
+
const ge = (c, {
|
|
1626
|
+
type: g
|
|
1625
1627
|
}) => {
|
|
1626
|
-
switch (
|
|
1628
|
+
switch (g) {
|
|
1627
1629
|
case "drag": {
|
|
1628
|
-
o(
|
|
1630
|
+
o(c), t.emit("change", c);
|
|
1629
1631
|
break;
|
|
1630
1632
|
}
|
|
1631
1633
|
}
|
|
1632
|
-
}, R =
|
|
1634
|
+
}, R = rt({
|
|
1633
1635
|
reload: M,
|
|
1634
1636
|
preview: y,
|
|
1635
1637
|
export: v,
|
|
1636
1638
|
edit: C,
|
|
1637
1639
|
collapse: ye
|
|
1638
1640
|
});
|
|
1639
|
-
function
|
|
1640
|
-
!h || x === "client" || (
|
|
1641
|
+
function be(c, g) {
|
|
1642
|
+
!h || x === "client" || (g ? h.update(c, g === "descend" ? "desc" : "asc") : h.remove(c), R("reload"));
|
|
1641
1643
|
}
|
|
1642
|
-
const J =
|
|
1644
|
+
const J = b(de({
|
|
1643
1645
|
columns: e.columns,
|
|
1644
1646
|
columnsOptions: e.columnsOptions,
|
|
1645
1647
|
columnsGroups: e.columnsGroups,
|
|
1646
1648
|
pageMode: x,
|
|
1647
1649
|
collapsedColumns: w,
|
|
1648
1650
|
events: R
|
|
1649
|
-
})),
|
|
1651
|
+
})), z = {
|
|
1650
1652
|
tableEvents: R,
|
|
1651
1653
|
tableForm: s,
|
|
1652
1654
|
tableSource: i,
|
|
1653
1655
|
formInstance: a,
|
|
1654
1656
|
pageService: m,
|
|
1655
1657
|
formOptions: e.formOptions
|
|
1656
|
-
}, we =
|
|
1658
|
+
}, we = lr(e, t, z), ve = ar(e, t, z), Ce = ir(e, t, z), {
|
|
1657
1659
|
selectedRowKeys: Q,
|
|
1658
1660
|
rowSelection: X,
|
|
1659
1661
|
onSelect: ke,
|
|
1660
1662
|
onSelectAll: xe,
|
|
1661
1663
|
reloadSelection: Se,
|
|
1662
1664
|
resetSelection: Me
|
|
1663
|
-
} =
|
|
1665
|
+
} = ur(e, t, z), Te = L(() => ({
|
|
1664
1666
|
rowKey: e.rowKey,
|
|
1665
1667
|
size: e.size,
|
|
1666
1668
|
bordered: e.bordered,
|
|
1667
1669
|
hoverable: e.hoverable,
|
|
1668
1670
|
stripe: e.stripe,
|
|
1669
1671
|
scroll: {
|
|
1670
|
-
x: e.columns.reduce((
|
|
1672
|
+
x: e.columns.reduce((c, g) => c += typeof g.width != "number" ? Math.max(g.title.length * 16, 80) : g.width, 0),
|
|
1671
1673
|
y: e.height ?? "100%"
|
|
1672
1674
|
},
|
|
1673
1675
|
rowSelection: X,
|
|
@@ -1693,29 +1695,29 @@ const ir = /* @__PURE__ */ B({
|
|
|
1693
1695
|
});
|
|
1694
1696
|
}
|
|
1695
1697
|
return A(() => {
|
|
1696
|
-
|
|
1698
|
+
l.value && (l.value.id = `table-${r}`), e.autoLoad && M(), e.grabbable && l.value && tr(l.value);
|
|
1697
1699
|
}), {
|
|
1698
1700
|
tableId: r,
|
|
1699
|
-
tableInstance:
|
|
1701
|
+
tableInstance: u,
|
|
1700
1702
|
tableSource: i,
|
|
1701
1703
|
tableOptions: Te,
|
|
1702
1704
|
tableColumns: J,
|
|
1703
1705
|
tableEvents: R,
|
|
1704
1706
|
tableForm: s,
|
|
1705
|
-
tableLoading:
|
|
1707
|
+
tableLoading: d,
|
|
1706
1708
|
modalInstance: n,
|
|
1707
|
-
tableRenderElement:
|
|
1709
|
+
tableRenderElement: l,
|
|
1708
1710
|
formSource: se(L(() => {
|
|
1709
|
-
var
|
|
1710
|
-
return (
|
|
1711
|
+
var c;
|
|
1712
|
+
return (c = a == null ? void 0 : a.value) == null ? void 0 : c.formSource;
|
|
1711
1713
|
})),
|
|
1712
1714
|
formInstance: a,
|
|
1713
1715
|
reload: M,
|
|
1714
1716
|
preview: y,
|
|
1715
1717
|
edit: C,
|
|
1716
1718
|
export: v,
|
|
1717
|
-
onSorterChange:
|
|
1718
|
-
onTableChange:
|
|
1719
|
+
onSorterChange: be,
|
|
1720
|
+
onTableChange: ge,
|
|
1719
1721
|
renders: {
|
|
1720
1722
|
renderTableForm: we,
|
|
1721
1723
|
renderTableActions: ve,
|
|
@@ -1738,7 +1740,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1738
1740
|
class: "table-body"
|
|
1739
1741
|
}, [f("div", {
|
|
1740
1742
|
class: "table-body-wrapper"
|
|
1741
|
-
}, [f(
|
|
1743
|
+
}, [f(Ze, fe({
|
|
1742
1744
|
loading: this.tableLoading,
|
|
1743
1745
|
data: this.tableSource,
|
|
1744
1746
|
columns: this.tableColumns,
|
|
@@ -1757,7 +1759,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1757
1759
|
"auto-fill": this.autoFill
|
|
1758
1760
|
},
|
|
1759
1761
|
ref: (t) => this.tableRenderElement = t
|
|
1760
|
-
}, [f(
|
|
1762
|
+
}, [f(Qe, {
|
|
1761
1763
|
ref: (t) => this.modalInstance = t
|
|
1762
1764
|
}, {
|
|
1763
1765
|
default: () => [f("div", {
|
|
@@ -1766,23 +1768,23 @@ const ir = /* @__PURE__ */ B({
|
|
|
1766
1768
|
})]);
|
|
1767
1769
|
}
|
|
1768
1770
|
});
|
|
1769
|
-
function
|
|
1771
|
+
function wr(e) {
|
|
1770
1772
|
return e;
|
|
1771
1773
|
}
|
|
1772
|
-
function
|
|
1774
|
+
function vr(e) {
|
|
1773
1775
|
return e;
|
|
1774
1776
|
}
|
|
1775
|
-
const
|
|
1777
|
+
const Cr = {
|
|
1776
1778
|
install(e, t) {
|
|
1777
|
-
e.component("TableRender",
|
|
1779
|
+
e.component("TableRender", sr);
|
|
1778
1780
|
}
|
|
1779
1781
|
};
|
|
1780
1782
|
export {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1783
|
+
sr as TableRender,
|
|
1784
|
+
Sr as TableRenderResolver,
|
|
1785
|
+
Cr as default,
|
|
1786
|
+
wr as defineColumns,
|
|
1787
|
+
vr as defineTableLoad,
|
|
1788
|
+
rt as useEvents,
|
|
1787
1789
|
br as useTable
|
|
1788
1790
|
};
|