@gopowerteam/table-render 0.0.174 → 1.0.0
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/config/provide.config.d.ts +0 -1
- package/dist/cjs/defines/define-columns.d.ts +0 -1
- package/dist/cjs/defines/define-table-load.d.ts +0 -1
- package/dist/cjs/hooks/index.d.ts +1 -1
- package/dist/cjs/hooks/use-events.d.ts +0 -1
- package/dist/cjs/hooks/use-export.d.ts +0 -1
- package/dist/cjs/hooks/use-table.d.ts +2 -3
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.ts +4 -5
- package/dist/cjs/install.d.ts +0 -1
- package/dist/cjs/interfaces/index.d.ts +3 -3
- package/dist/cjs/interfaces/pageable-options.d.ts +1 -1
- package/dist/cjs/interfaces/sortable-options.d.ts +3 -3
- package/dist/cjs/interfaces/table-column-options.d.ts +2 -3
- package/dist/cjs/interfaces/table-column-render.d.ts +0 -1
- package/dist/cjs/interfaces/table-load-params.d.ts +1 -2
- package/dist/cjs/table-columns/currency/index.d.ts +0 -1
- package/dist/cjs/table-columns/date/index.d.ts +0 -1
- package/dist/cjs/table-columns/dict/index.d.ts +0 -1
- package/dist/cjs/table-columns/dropdown/index.d.ts +0 -1
- package/dist/cjs/table-columns/image/index.d.ts +0 -1
- package/dist/cjs/table-columns/phone/index.d.ts +0 -1
- package/dist/cjs/table-columns/progress/index.d.ts +0 -1
- package/dist/cjs/table-columns/render/index.d.ts +0 -1
- package/dist/cjs/table-columns/serial/index.d.ts +0 -1
- package/dist/cjs/table-columns/tag/index.d.ts +0 -1
- package/dist/cjs/table-columns/text/index.d.ts +0 -1
- package/dist/cjs/table-render/index.d.ts +1419 -323
- package/dist/cjs/table-render/table-actions-render.d.ts +0 -1
- package/dist/cjs/table-render/table-collapsed-render.d.ts +3 -4
- package/dist/cjs/table-render/table-column-render.d.ts +11 -6
- package/dist/cjs/table-render/table-edit-render.d.ts +4 -5
- package/dist/cjs/table-render/table-form-render.d.ts +0 -1
- package/dist/cjs/table-render/table-pagination-render.d.ts +0 -1
- package/dist/cjs/table-render/table-selection-render.d.ts +3 -4
- package/dist/cjs/table-render/table-view-render.d.ts +6 -7
- package/dist/cjs/utils/create-column-render.d.ts +0 -1
- package/dist/cjs/utils/create-table-form.d.ts +0 -1
- package/dist/cjs/utils/create-table-source.d.ts +0 -1
- package/dist/cjs/utils/get-column-value.d.ts +4 -5
- package/dist/cjs/utils/index.d.ts +1 -1
- package/dist/cjs/utils/page.service.d.ts +0 -1
- package/dist/cjs/utils/set-column-value.d.ts +4 -5
- package/dist/cjs/utils/sort.service.d.ts +0 -1
- package/dist/es/config/provide.config.d.ts +0 -1
- package/dist/es/defines/define-columns.d.ts +0 -1
- package/dist/es/defines/define-table-load.d.ts +0 -1
- package/dist/es/hooks/index.d.ts +1 -1
- package/dist/es/hooks/use-events.d.ts +0 -1
- package/dist/es/hooks/use-export.d.ts +0 -1
- package/dist/es/hooks/use-table.d.ts +2 -3
- package/dist/es/index.d.ts +4 -5
- package/dist/es/index.mjs +1117 -1089
- package/dist/es/install.d.ts +0 -1
- package/dist/es/interfaces/index.d.ts +3 -3
- package/dist/es/interfaces/pageable-options.d.ts +1 -1
- package/dist/es/interfaces/sortable-options.d.ts +3 -3
- package/dist/es/interfaces/table-column-options.d.ts +2 -3
- package/dist/es/interfaces/table-column-render.d.ts +0 -1
- package/dist/es/interfaces/table-load-params.d.ts +1 -2
- package/dist/es/table-columns/currency/index.d.ts +0 -1
- package/dist/es/table-columns/date/index.d.ts +0 -1
- package/dist/es/table-columns/dict/index.d.ts +0 -1
- package/dist/es/table-columns/dropdown/index.d.ts +0 -1
- package/dist/es/table-columns/image/index.d.ts +0 -1
- package/dist/es/table-columns/phone/index.d.ts +0 -1
- package/dist/es/table-columns/progress/index.d.ts +0 -1
- package/dist/es/table-columns/render/index.d.ts +0 -1
- package/dist/es/table-columns/serial/index.d.ts +0 -1
- package/dist/es/table-columns/tag/index.d.ts +0 -1
- package/dist/es/table-columns/text/index.d.ts +0 -1
- package/dist/es/table-render/index.d.ts +1419 -323
- package/dist/es/table-render/table-actions-render.d.ts +0 -1
- package/dist/es/table-render/table-collapsed-render.d.ts +3 -4
- package/dist/es/table-render/table-column-render.d.ts +11 -6
- package/dist/es/table-render/table-edit-render.d.ts +4 -5
- package/dist/es/table-render/table-form-render.d.ts +0 -1
- package/dist/es/table-render/table-pagination-render.d.ts +0 -1
- package/dist/es/table-render/table-selection-render.d.ts +3 -4
- package/dist/es/table-render/table-view-render.d.ts +6 -7
- package/dist/es/utils/create-column-render.d.ts +0 -1
- package/dist/es/utils/create-table-form.d.ts +0 -1
- package/dist/es/utils/create-table-source.d.ts +0 -1
- package/dist/es/utils/get-column-value.d.ts +4 -5
- package/dist/es/utils/index.d.ts +1 -1
- package/dist/es/utils/page.service.d.ts +0 -1
- package/dist/es/utils/set-column-value.d.ts +4 -5
- package/dist/es/utils/sort.service.d.ts +0 -1
- package/dist/style.css +1 -1
- package/package.json +38 -37
package/dist/es/index.mjs
CHANGED
|
@@ -1,689 +1,697 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const t = g([]), 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
|
-
};
|
|
22
|
-
return [t, (a) => {
|
|
23
|
-
t.value = r(a);
|
|
24
|
-
}];
|
|
1
|
+
import { getCurrentInstance as z, ref as k, onMounted as E, onUpdated as Re, createVNode as u, Fragment as G, createTextVNode as A, nextTick as N, getCurrentScope as he, hasInjectionContext as ye, inject as Pe, shallowRef as M, shallowReadonly as qe, watch as ze, toValue as T, onScopeDispose as Ee, computed as _, watchEffect as Ye, readonly as U, unref as Ae, toRaw as De, h as Be, render as Fe, reactive as We, defineComponent as F, withDirectives as Ie, resolveDirective as Ve, mergeProps as pe, isVNode as He } from "vue";
|
|
2
|
+
import { Button as P, Tag as Ke, Dropdown as ae, Image as Ne, Message as Ue, Divider as Ge, Space as le, Transfer as Ze, Pagination as Je, Descriptions as Qe, DescriptionsItem as Xe, Table as et } from "@arco-design/web-vue";
|
|
3
|
+
import { useModal as W, onSubmit as tt, ModalProvider as nt } from "@gopowerteam/modal-render";
|
|
4
|
+
import I from "dayjs";
|
|
5
|
+
import * as rt from "exceljs";
|
|
6
|
+
import { FormRender as be } from "@gopowerteam/form-render";
|
|
7
|
+
import { TableRenderResolver as Pn } from "./resolver.mjs";
|
|
8
|
+
function $n(e) {
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
function _n(e) {
|
|
12
|
+
return e;
|
|
13
|
+
}
|
|
14
|
+
function ot(e) {
|
|
15
|
+
return (t, n) => e[t](n);
|
|
25
16
|
}
|
|
26
|
-
function
|
|
17
|
+
function On(e) {
|
|
18
|
+
const t = z(), n = k();
|
|
19
|
+
function i() {
|
|
20
|
+
const o = t?.proxy?.$refs?.[e];
|
|
21
|
+
o && (n.value = o);
|
|
22
|
+
}
|
|
23
|
+
return E(i), Re(i), n;
|
|
24
|
+
}
|
|
25
|
+
const it = /* @__PURE__ */ Symbol.for("RenderColumnType");
|
|
26
|
+
function S(e, t, n) {
|
|
27
|
+
return t.$type = e, t.$disableColumnMode = n?.disableColumnMode, t.$disableViewMode = n?.disableViewMode, t;
|
|
28
|
+
}
|
|
29
|
+
function at(e) {
|
|
27
30
|
return e.filter((t) => t.form).map((t) => ({
|
|
28
31
|
key: t.key,
|
|
29
32
|
title: t.title,
|
|
30
33
|
...typeof t.form == "boolean" ? {} : t.form
|
|
31
34
|
}));
|
|
32
35
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
|
|
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
|
-
a && (r.value = a);
|
|
39
|
-
}
|
|
40
|
-
return A(u), Le(u), r;
|
|
41
|
-
}
|
|
42
|
-
function rt(e) {
|
|
43
|
-
return (t, r) => e[t](r);
|
|
44
|
-
}
|
|
45
|
-
class F {
|
|
46
|
-
/**
|
|
47
|
-
* 构造函数
|
|
48
|
-
* @param index
|
|
49
|
-
* @param size
|
|
50
|
-
*/
|
|
51
|
-
constructor(t = 1, r = 10) {
|
|
52
|
-
$(this, "data", je({
|
|
53
|
-
index: 1,
|
|
54
|
-
size: 10,
|
|
55
|
-
total: 0
|
|
56
|
-
}));
|
|
57
|
-
$(this, "pageSizeOpts", [10, 20, 30, 40, 50]);
|
|
58
|
-
$(this, "pageLayouts", ["PrevJump", "PrevPage", "JumpNumber", "NextPage", "NextJump", "Sizes", "FullJump", "Total"]);
|
|
59
|
-
this.pageIndex = t, this.pageSize = r;
|
|
60
|
-
}
|
|
61
|
-
get pageIndex() {
|
|
62
|
-
return this.data.index;
|
|
63
|
-
}
|
|
64
|
-
set pageIndex(t) {
|
|
65
|
-
this.data.index = t;
|
|
66
|
-
}
|
|
67
|
-
get pageSize() {
|
|
68
|
-
return this.data.size;
|
|
69
|
-
}
|
|
70
|
-
set pageSize(t) {
|
|
71
|
-
this.data.size = t;
|
|
72
|
-
}
|
|
73
|
-
get total() {
|
|
74
|
-
return this.data.total;
|
|
75
|
-
}
|
|
76
|
-
set total(t) {
|
|
77
|
-
this.data.total = t;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* 重置操作
|
|
81
|
-
*/
|
|
82
|
-
reset() {
|
|
83
|
-
this.pageIndex = 1;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* 前置操作
|
|
87
|
-
* @param options
|
|
88
|
-
*/
|
|
89
|
-
before(t) {
|
|
90
|
-
t.paramsQuery = {
|
|
91
|
-
...t.paramsQuery,
|
|
92
|
-
page: this.pageIndex - 1,
|
|
93
|
-
size: this.pageSize
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* 后置操作
|
|
98
|
-
* @param response
|
|
99
|
-
*/
|
|
100
|
-
after(t) {
|
|
101
|
-
var r;
|
|
102
|
-
this.total = (r = t.data) == null ? void 0 : r.totalElements;
|
|
103
|
-
}
|
|
36
|
+
function lt(e, t, n) {
|
|
37
|
+
const [i, ...o] = t.index ? t.index.split(".").reverse() : [t.key], r = o.reverse().reduce((a, l) => a?.[l], e);
|
|
38
|
+
r[i] = n;
|
|
104
39
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
40
|
+
function st(e) {
|
|
41
|
+
const t = k([]), n = (o) => {
|
|
42
|
+
const r = e.filter((a) => a.formatter);
|
|
43
|
+
return r.length > 0 ? o.map((a) => (r.forEach((l) => {
|
|
44
|
+
l.formatter && lt(a, l, l.formatter(a));
|
|
45
|
+
}), a)) : o;
|
|
46
|
+
};
|
|
47
|
+
return [t, (o) => {
|
|
48
|
+
t.value = n(o);
|
|
49
|
+
}];
|
|
108
50
|
}
|
|
109
|
-
function
|
|
110
|
-
return t.index ? t.index.split(".").reduce((
|
|
51
|
+
function $(e, t) {
|
|
52
|
+
return t.index ? t.index.split(".").reduce((n, i) => n?.[i], e) : [t.key].reduce((n, i) => n?.[i], e);
|
|
111
53
|
}
|
|
112
|
-
function
|
|
54
|
+
function B(e) {
|
|
113
55
|
return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
114
56
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
117
|
-
const
|
|
118
|
-
async function
|
|
119
|
-
if (await (
|
|
120
|
-
|
|
57
|
+
function ut(e) {
|
|
58
|
+
return S("button", (n, i, o) => {
|
|
59
|
+
const r = W(), a = Array.isArray(e) ? e : "buttons" in e ? e.buttons : [e], l = (s, m) => typeof s == "function" ? s(n) : s === void 0 ? m : s;
|
|
60
|
+
async function c(s) {
|
|
61
|
+
if (await (s.confirm === !0 ? new Promise((f) => {
|
|
62
|
+
r.confirm({
|
|
121
63
|
title: "提示信息",
|
|
122
|
-
content:
|
|
123
|
-
onOk: () =>
|
|
124
|
-
onCancel: () =>
|
|
64
|
+
content: s.confirmText ?? "您确定要执行该操作?",
|
|
65
|
+
onOk: () => f(!0),
|
|
66
|
+
onCancel: () => f(!1)
|
|
125
67
|
});
|
|
126
|
-
}) : Promise.resolve(!0)) &&
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}), !
|
|
68
|
+
}) : Promise.resolve(!0)) && s?.onClick) {
|
|
69
|
+
const f = s.onClick(n);
|
|
70
|
+
B(f) && s.autoReload !== !1 && f.then(() => {
|
|
71
|
+
o?.emits && o?.emits("reload");
|
|
72
|
+
}), !B(f) && s.autoReload === !0 && o?.emits && o?.emits("reload");
|
|
131
73
|
}
|
|
132
74
|
}
|
|
133
|
-
return
|
|
134
|
-
onClick: () =>
|
|
135
|
-
type:
|
|
136
|
-
shape:
|
|
75
|
+
return u(G, null, [a.filter((s) => l(s.visiable, !0)).map((s) => u(P, {
|
|
76
|
+
onClick: () => c(s),
|
|
77
|
+
type: s.type || "text",
|
|
78
|
+
shape: s.shape,
|
|
137
79
|
size: "mini",
|
|
138
|
-
disabled:
|
|
80
|
+
disabled: l(s.disabled, !1)
|
|
139
81
|
}, {
|
|
140
|
-
icon:
|
|
141
|
-
default: () => (typeof
|
|
82
|
+
icon: s.icon ? () => s.icon(n) : void 0,
|
|
83
|
+
default: () => (typeof s.content == "function" ? s.content(n) : s.content) || ""
|
|
142
84
|
}))]);
|
|
143
85
|
}, {
|
|
144
86
|
disableViewMode: !0
|
|
145
87
|
});
|
|
146
88
|
}
|
|
147
|
-
const
|
|
89
|
+
const ct = {
|
|
148
90
|
thousands: !0,
|
|
149
91
|
inputUnit: "元",
|
|
150
92
|
outputUnit: "元"
|
|
151
|
-
},
|
|
93
|
+
}, se = {
|
|
152
94
|
分: 10 ** 0,
|
|
153
95
|
元: 10 ** 2,
|
|
154
96
|
万: 10 ** 6
|
|
155
97
|
};
|
|
156
|
-
function
|
|
98
|
+
function dt(e) {
|
|
157
99
|
e = {
|
|
158
|
-
...
|
|
100
|
+
...ct,
|
|
159
101
|
...e || {}
|
|
160
102
|
};
|
|
161
|
-
const t = (
|
|
162
|
-
if (
|
|
103
|
+
const t = (r) => {
|
|
104
|
+
if (r == null)
|
|
163
105
|
return;
|
|
164
|
-
if (
|
|
165
|
-
return
|
|
166
|
-
const
|
|
167
|
-
return
|
|
168
|
-
},
|
|
169
|
-
if (
|
|
106
|
+
if (e?.inputUnit === e?.outputUnit)
|
|
107
|
+
return r;
|
|
108
|
+
const a = se[e.inputUnit] / se[e.outputUnit], l = Number.parseFloat((r * a).toFixed(10));
|
|
109
|
+
return e?.precision === void 0 ? l : l.toFixed(e?.precision);
|
|
110
|
+
}, n = (r) => {
|
|
111
|
+
if (r == null)
|
|
170
112
|
return;
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
},
|
|
174
|
-
if (
|
|
175
|
-
return e
|
|
176
|
-
if (
|
|
177
|
-
return e
|
|
178
|
-
const
|
|
179
|
-
return e
|
|
113
|
+
const a = r.toString().split(".");
|
|
114
|
+
return a[0] = a[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), a.join(".");
|
|
115
|
+
}, i = (r) => {
|
|
116
|
+
if (e?.zeroString !== void 0 && Number(r) === 0)
|
|
117
|
+
return e?.zeroString;
|
|
118
|
+
if (e?.nullString !== void 0 && Number.isNaN(Number(r)))
|
|
119
|
+
return e?.nullString;
|
|
120
|
+
const a = t(Number(r));
|
|
121
|
+
return e?.thousands ? n(a) : a;
|
|
180
122
|
};
|
|
181
|
-
return
|
|
182
|
-
const
|
|
183
|
-
return
|
|
123
|
+
return S("dict", (r, a) => {
|
|
124
|
+
const l = $(r, a);
|
|
125
|
+
return u("div", null, [typeof e?.prefix == "string" ? u("span", null, [e.prefix]) : typeof e?.prefix == "function" ? u("span", null, [e.prefix()]) : void 0, u("span", {
|
|
184
126
|
class: "currency_value"
|
|
185
|
-
}, [
|
|
127
|
+
}, [i(l)]), typeof e?.suffix == "string" ? u("span", null, [e.suffix]) : typeof e?.suffix == "function" ? u("span", null, [e.suffix()]) : void 0]);
|
|
186
128
|
});
|
|
187
129
|
}
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
(function(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
function
|
|
194
|
-
|
|
195
|
-
default:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var a = u(r), n = {
|
|
199
|
-
name: "zh-cn",
|
|
200
|
-
weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
|
|
201
|
-
weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
|
|
202
|
-
weekdaysMin: "日_一_二_三_四_五_六".split("_"),
|
|
203
|
-
months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
|
|
204
|
-
monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
|
|
205
|
-
ordinal: function(l, i) {
|
|
206
|
-
return i === "W" ? l + "周" : l + "日";
|
|
207
|
-
},
|
|
208
|
-
weekStart: 1,
|
|
209
|
-
yearStart: 4,
|
|
210
|
-
formats: {
|
|
211
|
-
LT: "HH:mm",
|
|
212
|
-
LTS: "HH:mm:ss",
|
|
213
|
-
L: "YYYY/MM/DD",
|
|
214
|
-
LL: "YYYY年M月D日",
|
|
215
|
-
LLL: "YYYY年M月D日Ah点mm分",
|
|
216
|
-
LLLL: "YYYY年M月D日ddddAh点mm分",
|
|
217
|
-
l: "YYYY/M/D",
|
|
218
|
-
ll: "YYYY年M月D日",
|
|
219
|
-
lll: "YYYY年M月D日 HH:mm",
|
|
220
|
-
llll: "YYYY年M月D日dddd HH:mm"
|
|
221
|
-
},
|
|
222
|
-
relativeTime: {
|
|
223
|
-
future: "%s内",
|
|
224
|
-
past: "%s前",
|
|
225
|
-
s: "几秒",
|
|
226
|
-
m: "1 分钟",
|
|
227
|
-
mm: "%d 分钟",
|
|
228
|
-
h: "1 小时",
|
|
229
|
-
hh: "%d 小时",
|
|
230
|
-
d: "1 天",
|
|
231
|
-
dd: "%d 天",
|
|
232
|
-
M: "1 个月",
|
|
233
|
-
MM: "%d 个月",
|
|
234
|
-
y: "1 年",
|
|
235
|
-
yy: "%d 年"
|
|
236
|
-
},
|
|
237
|
-
meridiem: function(l, i) {
|
|
238
|
-
var o = 100 * l + i;
|
|
239
|
-
return o < 600 ? "凌晨" : o < 900 ? "早上" : o < 1100 ? "上午" : o < 1300 ? "中午" : o < 1800 ? "下午" : "晚上";
|
|
130
|
+
var D = { exports: {} }, ft = D.exports, ue;
|
|
131
|
+
function mt() {
|
|
132
|
+
return ue || (ue = 1, (function(e, t) {
|
|
133
|
+
(function(n, i) {
|
|
134
|
+
e.exports = i(I);
|
|
135
|
+
})(ft, function(n) {
|
|
136
|
+
function i(a) {
|
|
137
|
+
return a && typeof a == "object" && "default" in a ? a : {
|
|
138
|
+
default: a
|
|
139
|
+
};
|
|
240
140
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
141
|
+
var o = i(n), r = {
|
|
142
|
+
name: "zh-cn",
|
|
143
|
+
weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
|
|
144
|
+
weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
|
|
145
|
+
weekdaysMin: "日_一_二_三_四_五_六".split("_"),
|
|
146
|
+
months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
|
|
147
|
+
monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
|
|
148
|
+
ordinal: function(a, l) {
|
|
149
|
+
return l === "W" ? a + "周" : a + "日";
|
|
150
|
+
},
|
|
151
|
+
weekStart: 1,
|
|
152
|
+
yearStart: 4,
|
|
153
|
+
formats: {
|
|
154
|
+
LT: "HH:mm",
|
|
155
|
+
LTS: "HH:mm:ss",
|
|
156
|
+
L: "YYYY/MM/DD",
|
|
157
|
+
LL: "YYYY年M月D日",
|
|
158
|
+
LLL: "YYYY年M月D日Ah点mm分",
|
|
159
|
+
LLLL: "YYYY年M月D日ddddAh点mm分",
|
|
160
|
+
l: "YYYY/M/D",
|
|
161
|
+
ll: "YYYY年M月D日",
|
|
162
|
+
lll: "YYYY年M月D日 HH:mm",
|
|
163
|
+
llll: "YYYY年M月D日dddd HH:mm"
|
|
164
|
+
},
|
|
165
|
+
relativeTime: {
|
|
166
|
+
future: "%s内",
|
|
167
|
+
past: "%s前",
|
|
168
|
+
s: "几秒",
|
|
169
|
+
m: "1 分钟",
|
|
170
|
+
mm: "%d 分钟",
|
|
171
|
+
h: "1 小时",
|
|
172
|
+
hh: "%d 小时",
|
|
173
|
+
d: "1 天",
|
|
174
|
+
dd: "%d 天",
|
|
175
|
+
M: "1 个月",
|
|
176
|
+
MM: "%d 个月",
|
|
177
|
+
y: "1 年",
|
|
178
|
+
yy: "%d 年"
|
|
179
|
+
},
|
|
180
|
+
meridiem: function(a, l) {
|
|
181
|
+
var c = 100 * a + l;
|
|
182
|
+
return c < 600 ? "凌晨" : c < 900 ? "早上" : c < 1100 ? "上午" : c < 1300 ? "中午" : c < 1800 ? "下午" : "晚上";
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
return o.default.locale(r, null, !0), r;
|
|
186
|
+
});
|
|
187
|
+
})(D)), D.exports;
|
|
188
|
+
}
|
|
189
|
+
mt();
|
|
190
|
+
I.locale("zh-cn");
|
|
191
|
+
const ht = {
|
|
247
192
|
date: "YYYY-MM-DD",
|
|
248
193
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
249
194
|
time: "HH:mm:ss",
|
|
250
195
|
week: "ddd"
|
|
251
196
|
};
|
|
252
|
-
function
|
|
253
|
-
return
|
|
254
|
-
const
|
|
255
|
-
return
|
|
197
|
+
function yt(e) {
|
|
198
|
+
return S("date", (n, i) => {
|
|
199
|
+
const o = $(n, i), r = typeof e?.format == "function" ? e?.format() : ht[e?.format || "datetime"], a = I(o);
|
|
200
|
+
return u("span", null, [a.isValid() && a.format(r)]);
|
|
256
201
|
});
|
|
257
202
|
}
|
|
258
|
-
const
|
|
203
|
+
const pt = {
|
|
259
204
|
success: "arcoblue",
|
|
260
205
|
warning: "orange",
|
|
261
206
|
error: "red"
|
|
262
207
|
};
|
|
263
|
-
function
|
|
208
|
+
function bt(e) {
|
|
264
209
|
return e instanceof Map ? e : e.dict;
|
|
265
210
|
}
|
|
266
|
-
function
|
|
211
|
+
function gt(e) {
|
|
267
212
|
const t = e instanceof Map ? !1 : e.tag;
|
|
268
|
-
return typeof t == "string" ?
|
|
269
|
-
}
|
|
270
|
-
function
|
|
271
|
-
const t =
|
|
272
|
-
return
|
|
273
|
-
const
|
|
274
|
-
return
|
|
275
|
-
color:
|
|
213
|
+
return typeof t == "string" ? pt[t] : t;
|
|
214
|
+
}
|
|
215
|
+
function vt(e) {
|
|
216
|
+
const t = bt(e), n = gt(e);
|
|
217
|
+
return S("dict", (o, r) => {
|
|
218
|
+
const a = $(o, r);
|
|
219
|
+
return n ? u(Ke, {
|
|
220
|
+
color: n === !0 ? void 0 : n
|
|
276
221
|
}, {
|
|
277
|
-
default: () => [t.get(
|
|
278
|
-
}) :
|
|
222
|
+
default: () => [t.get(a) || a]
|
|
223
|
+
}) : u("span", null, [t.get(a) || a]);
|
|
279
224
|
});
|
|
280
225
|
}
|
|
281
|
-
function
|
|
282
|
-
const t =
|
|
283
|
-
async function
|
|
284
|
-
|
|
226
|
+
function wt(e) {
|
|
227
|
+
const t = W();
|
|
228
|
+
async function n(o, r) {
|
|
229
|
+
o.confirm && !await new Promise((l) => {
|
|
285
230
|
t.open("confirm", {
|
|
286
231
|
title: "确认",
|
|
287
|
-
content:
|
|
288
|
-
onOk: () =>
|
|
289
|
-
onCancel: () =>
|
|
232
|
+
content: o.confirmText || "是否确认执行该操作?",
|
|
233
|
+
onOk: () => l(!0),
|
|
234
|
+
onCancel: () => l(!1)
|
|
290
235
|
});
|
|
291
|
-
}) ||
|
|
236
|
+
}) || o.onClick(r);
|
|
292
237
|
}
|
|
293
|
-
return
|
|
294
|
-
const
|
|
295
|
-
return
|
|
296
|
-
trigger:
|
|
238
|
+
return S("dropdown", (o, r) => {
|
|
239
|
+
const a = e.options.filter((l) => typeof l.visiable == "function" ? l.visiable(o) : l.visiable !== !1);
|
|
240
|
+
return u(ae, {
|
|
241
|
+
trigger: e?.trigger || "click"
|
|
297
242
|
}, {
|
|
298
|
-
default: () =>
|
|
299
|
-
disabled:
|
|
243
|
+
default: () => u(P, {
|
|
244
|
+
disabled: a.length === 0,
|
|
300
245
|
type: "text"
|
|
301
246
|
}, {
|
|
302
|
-
default: () => [
|
|
247
|
+
default: () => [e?.content || "操作"]
|
|
303
248
|
}),
|
|
304
|
-
content: () =>
|
|
305
|
-
onClick: () =>
|
|
249
|
+
content: () => a.map((l) => u(ae.Option, {
|
|
250
|
+
onClick: () => n(l, o)
|
|
306
251
|
}, {
|
|
307
|
-
default: () => [typeof
|
|
252
|
+
default: () => [typeof l.content == "function" ? l.content(o) : l.content]
|
|
308
253
|
}))
|
|
309
254
|
});
|
|
310
255
|
});
|
|
311
256
|
}
|
|
312
|
-
const
|
|
257
|
+
const xt = {
|
|
313
258
|
size: 30
|
|
314
259
|
};
|
|
315
|
-
function
|
|
260
|
+
function Ct(e) {
|
|
316
261
|
return e = {
|
|
317
|
-
...
|
|
262
|
+
...xt,
|
|
318
263
|
...e || {}
|
|
319
|
-
},
|
|
320
|
-
const
|
|
264
|
+
}, S("image", (n, i) => {
|
|
265
|
+
const o = $(n, i), r = Math.random().toString(32).slice(2).toUpperCase(), a = {
|
|
321
266
|
maxWidth: "100%",
|
|
322
267
|
maxHeight: "100%",
|
|
323
|
-
borderRadius: e
|
|
324
|
-
transform: `rotate(${
|
|
325
|
-
cursor: e
|
|
268
|
+
borderRadius: e?.radius,
|
|
269
|
+
transform: `rotate(${e?.rotate || 0}deg)`,
|
|
270
|
+
cursor: e?.preview ? "zoom-in" : "unset",
|
|
326
271
|
overflow: "hidden"
|
|
327
|
-
},
|
|
328
|
-
if (e
|
|
329
|
-
const
|
|
330
|
-
|
|
272
|
+
}, l = `${i.index || i.key}_parsed`;
|
|
273
|
+
if (e?.parse) {
|
|
274
|
+
const c = e?.parse(o, n);
|
|
275
|
+
B(c) ? c.then((s) => n[l] = s ?? "") : n[l] = c ?? "";
|
|
331
276
|
}
|
|
332
|
-
if (e
|
|
333
|
-
return
|
|
277
|
+
if (e?.parse && !n[l] === void 0)
|
|
278
|
+
return u("div", null, [A("Loading...")]);
|
|
334
279
|
{
|
|
335
|
-
const
|
|
336
|
-
return
|
|
337
|
-
id:
|
|
280
|
+
const c = n[l] || o;
|
|
281
|
+
return c ? u("div", {
|
|
282
|
+
id: r,
|
|
338
283
|
style: {
|
|
339
284
|
display: "flex",
|
|
340
285
|
justifyContent: "center",
|
|
341
286
|
alignItems: "center",
|
|
342
|
-
height: `${e
|
|
343
|
-
width: `${e
|
|
287
|
+
height: `${e?.size}px`,
|
|
288
|
+
width: `${e?.size}px`,
|
|
289
|
+
margin: "auto"
|
|
344
290
|
}
|
|
345
|
-
}, [
|
|
346
|
-
preview: e
|
|
291
|
+
}, [u(Ne, {
|
|
292
|
+
preview: e?.preview,
|
|
347
293
|
width: "100%",
|
|
348
294
|
height: "100%",
|
|
349
295
|
fit: "contain",
|
|
350
|
-
src:
|
|
296
|
+
src: c,
|
|
351
297
|
alt: "image",
|
|
352
|
-
style:
|
|
353
|
-
}, null)]) :
|
|
298
|
+
style: a
|
|
299
|
+
}, null)]) : u(G, null, null);
|
|
354
300
|
}
|
|
355
301
|
});
|
|
356
302
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
303
|
+
function kt(e, t) {
|
|
304
|
+
return he() ? (Ee(e, t), !0) : !1;
|
|
359
305
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
306
|
+
const V = /* @__PURE__ */ new WeakMap(), St = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
|
|
307
|
+
var t;
|
|
308
|
+
const n = e[0], i = (t = z()) === null || t === void 0 ? void 0 : t.proxy, o = i ?? he();
|
|
309
|
+
if (o == null && !ye()) throw new Error("injectLocal must be called in setup");
|
|
310
|
+
return o && V.has(o) && n in V.get(o) ? V.get(o)[n] : Pe(...e);
|
|
311
|
+
}, Z = typeof window < "u" && typeof document < "u";
|
|
364
312
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
function kt(e) {
|
|
313
|
+
const Mt = Object.prototype.toString, Tt = (e) => Mt.call(e) === "[object Object]";
|
|
314
|
+
function $t(e) {
|
|
368
315
|
let t;
|
|
369
|
-
function
|
|
316
|
+
function n() {
|
|
370
317
|
return t || (t = e()), t;
|
|
371
318
|
}
|
|
372
|
-
return
|
|
373
|
-
const
|
|
374
|
-
t = void 0,
|
|
375
|
-
},
|
|
319
|
+
return n.reset = async () => {
|
|
320
|
+
const i = t;
|
|
321
|
+
t = void 0, i && await i;
|
|
322
|
+
}, n;
|
|
376
323
|
}
|
|
377
|
-
function
|
|
378
|
-
var
|
|
379
|
-
if (typeof e == "number")
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
324
|
+
function _t(e, t) {
|
|
325
|
+
var n;
|
|
326
|
+
if (typeof e == "number") return e + t;
|
|
327
|
+
const i = ((n = e.match(/^-?\d+\.?\d*/)) === null || n === void 0 ? void 0 : n[0]) || "", o = e.slice(i.length), r = Number.parseFloat(i) + t;
|
|
328
|
+
return Number.isNaN(r) ? e : r + o;
|
|
329
|
+
}
|
|
330
|
+
function q(e) {
|
|
331
|
+
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
332
|
+
}
|
|
333
|
+
function H(e) {
|
|
334
|
+
return Array.isArray(e) ? e : [e];
|
|
335
|
+
}
|
|
336
|
+
function Ot(e) {
|
|
337
|
+
return z();
|
|
338
|
+
}
|
|
339
|
+
function jt(e, t = !0, n) {
|
|
340
|
+
Ot() ? E(e, n) : t ? e() : N(e);
|
|
383
341
|
}
|
|
384
|
-
function
|
|
342
|
+
function Lt(e, t, n = {}) {
|
|
385
343
|
const {
|
|
386
|
-
immediate:
|
|
387
|
-
|
|
388
|
-
|
|
344
|
+
immediate: i = !0,
|
|
345
|
+
immediateCallback: o = !1
|
|
346
|
+
} = n, r = M(!1);
|
|
347
|
+
let a;
|
|
389
348
|
function l() {
|
|
390
|
-
|
|
349
|
+
a && (clearTimeout(a), a = void 0);
|
|
391
350
|
}
|
|
392
|
-
function
|
|
393
|
-
|
|
351
|
+
function c() {
|
|
352
|
+
r.value = !1, l();
|
|
394
353
|
}
|
|
395
|
-
function
|
|
396
|
-
l(),
|
|
397
|
-
|
|
398
|
-
},
|
|
354
|
+
function s(...m) {
|
|
355
|
+
o && e(), l(), r.value = !0, a = setTimeout(() => {
|
|
356
|
+
r.value = !1, a = void 0, e(...m);
|
|
357
|
+
}, T(t));
|
|
399
358
|
}
|
|
400
|
-
return
|
|
401
|
-
isPending:
|
|
402
|
-
start:
|
|
403
|
-
stop:
|
|
359
|
+
return i && (r.value = !0, Z && s()), kt(c), {
|
|
360
|
+
isPending: qe(r),
|
|
361
|
+
start: s,
|
|
362
|
+
stop: c
|
|
404
363
|
};
|
|
405
364
|
}
|
|
406
|
-
function
|
|
365
|
+
function Rt(e, t, n) {
|
|
366
|
+
return ze(e, t, {
|
|
367
|
+
...n,
|
|
368
|
+
immediate: !0
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
const J = Z ? window : void 0, ge = Z ? window.navigator : void 0;
|
|
372
|
+
function Pt(e) {
|
|
407
373
|
var t;
|
|
408
|
-
const
|
|
409
|
-
return (t =
|
|
410
|
-
}
|
|
411
|
-
const N = W ? window : void 0, me = W ? window.navigator : void 0;
|
|
412
|
-
function he(...e) {
|
|
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 = () => {
|
|
418
|
-
n.forEach((s) => s()), n.length = 0;
|
|
419
|
-
}, i = (s, m, h, w) => (s.addEventListener(m, h, w), () => s.removeEventListener(m, h, w)), o = Ee(
|
|
420
|
-
() => [Mt(t), O(a)],
|
|
421
|
-
([s, m]) => {
|
|
422
|
-
if (l(), !s)
|
|
423
|
-
return;
|
|
424
|
-
const h = vt(m) ? { ...m } : m;
|
|
425
|
-
n.push(
|
|
426
|
-
...r.flatMap((w) => u.map((S) => i(s, w, S, h)))
|
|
427
|
-
);
|
|
428
|
-
},
|
|
429
|
-
{ immediate: !0, flush: "post" }
|
|
430
|
-
), d = () => {
|
|
431
|
-
o(), l();
|
|
432
|
-
};
|
|
433
|
-
return K(d), d;
|
|
374
|
+
const n = T(e);
|
|
375
|
+
return (t = n?.$el) !== null && t !== void 0 ? t : n;
|
|
434
376
|
}
|
|
435
|
-
function
|
|
436
|
-
const
|
|
437
|
-
|
|
377
|
+
function Q(...e) {
|
|
378
|
+
const t = (i, o, r, a) => (i.addEventListener(o, r, a), () => i.removeEventListener(o, r, a)), n = _(() => {
|
|
379
|
+
const i = H(T(e[0])).filter((o) => o != null);
|
|
380
|
+
return i.every((o) => typeof o != "string") ? i : void 0;
|
|
381
|
+
});
|
|
382
|
+
return Rt(() => {
|
|
383
|
+
var i, o;
|
|
384
|
+
return [(i = (o = n.value) === null || o === void 0 ? void 0 : o.map((r) => Pt(r))) !== null && i !== void 0 ? i : [J].filter((r) => r != null), H(T(n.value ? e[1] : e[0])), H(Ae(n.value ? e[2] : e[1])), T(n.value ? e[3] : e[2])];
|
|
385
|
+
}, ([i, o, r, a], l, c) => {
|
|
386
|
+
if (!i?.length || !o?.length || !r?.length) return;
|
|
387
|
+
const s = Tt(a) ? {
|
|
388
|
+
...a
|
|
389
|
+
} : a, m = i.flatMap((f) => o.flatMap((v) => r.map((d) => t(f, v, d, s))));
|
|
390
|
+
c(() => {
|
|
391
|
+
m.forEach((f) => f());
|
|
392
|
+
});
|
|
393
|
+
}, {
|
|
394
|
+
flush: "post"
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
// @__NO_SIDE_EFFECTS__
|
|
398
|
+
function qt() {
|
|
399
|
+
const e = M(!1), t = z();
|
|
400
|
+
return t && E(() => {
|
|
438
401
|
e.value = !0;
|
|
439
402
|
}, t), e;
|
|
440
403
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
404
|
+
// @__NO_SIDE_EFFECTS__
|
|
405
|
+
function X(e) {
|
|
406
|
+
const t = /* @__PURE__ */ qt();
|
|
407
|
+
return _(() => (t.value, !!e()));
|
|
444
408
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
}, i = () => {
|
|
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);
|
|
454
|
-
});
|
|
455
|
-
return K(() => {
|
|
456
|
-
o(), i(), a = void 0;
|
|
457
|
-
}), n;
|
|
409
|
+
const zt = /* @__PURE__ */ Symbol("vueuse-ssr-width");
|
|
410
|
+
// @__NO_SIDE_EFFECTS__
|
|
411
|
+
function ve() {
|
|
412
|
+
const e = ye() ? /* @__PURE__ */ St(zt, null) : null;
|
|
413
|
+
return typeof e == "number" ? e : void 0;
|
|
458
414
|
}
|
|
459
|
-
function
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
415
|
+
function R(e, t = {}) {
|
|
416
|
+
const {
|
|
417
|
+
window: n = J,
|
|
418
|
+
ssrWidth: i = /* @__PURE__ */ ve()
|
|
419
|
+
} = t, o = /* @__PURE__ */ X(() => n && "matchMedia" in n && typeof n.matchMedia == "function"), r = M(typeof i == "number"), a = M(), l = M(!1), c = (s) => {
|
|
420
|
+
l.value = s.matches;
|
|
421
|
+
};
|
|
422
|
+
return Ye(() => {
|
|
423
|
+
if (r.value) {
|
|
424
|
+
r.value = !o.value, l.value = T(e).split(",").some((s) => {
|
|
425
|
+
const m = s.includes("not all"), f = s.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), v = s.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
426
|
+
let d = !!(f || v);
|
|
427
|
+
return f && d && (d = i >= q(f[1])), v && d && (d = i <= q(v[1])), m ? !d : d;
|
|
428
|
+
});
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
o.value && (a.value = n.matchMedia(T(e)), l.value = a.value.matches);
|
|
432
|
+
}), Q(a, "change", c, {
|
|
433
|
+
passive: !0
|
|
434
|
+
}), _(() => l.value);
|
|
435
|
+
}
|
|
436
|
+
// @__NO_SIDE_EFFECTS__
|
|
437
|
+
function Et(e, t = {}) {
|
|
438
|
+
function n(d, y) {
|
|
439
|
+
let w = T(e[T(d)]);
|
|
440
|
+
return y != null && (w = _t(w, y)), typeof w == "number" && (w = `${w}px`), w;
|
|
463
441
|
}
|
|
464
|
-
const {
|
|
465
|
-
|
|
466
|
-
|
|
442
|
+
const {
|
|
443
|
+
window: i = J,
|
|
444
|
+
strategy: o = "min-width",
|
|
445
|
+
ssrWidth: r = /* @__PURE__ */ ve()
|
|
446
|
+
} = t, a = typeof r == "number", l = a ? M(!1) : {
|
|
447
|
+
value: !0
|
|
448
|
+
};
|
|
449
|
+
a && jt(() => l.value = !!i);
|
|
450
|
+
function c(d, y) {
|
|
451
|
+
return !l.value && a ? d === "min" ? r >= q(y) : r <= q(y) : i ? i.matchMedia(`(${d}-width: ${y})`).matches : !1;
|
|
467
452
|
}
|
|
468
|
-
const
|
|
469
|
-
get: () =>
|
|
453
|
+
const s = (d) => R(() => `(min-width: ${n(d)})`, t), m = (d) => R(() => `(max-width: ${n(d)})`, t), f = Object.keys(e).reduce((d, y) => (Object.defineProperty(d, y, {
|
|
454
|
+
get: () => o === "min-width" ? s(y) : m(y),
|
|
470
455
|
enumerable: !0,
|
|
471
456
|
configurable: !0
|
|
472
|
-
}),
|
|
473
|
-
function
|
|
474
|
-
const
|
|
475
|
-
return
|
|
457
|
+
}), d), {});
|
|
458
|
+
function v() {
|
|
459
|
+
const d = Object.keys(e).map((y) => [y, f[y], q(n(y))]).sort((y, w) => y[2] - w[2]);
|
|
460
|
+
return _(() => d.filter(([, y]) => y.value).map(([y]) => y));
|
|
476
461
|
}
|
|
477
|
-
return Object.assign(
|
|
478
|
-
greaterOrEqual:
|
|
479
|
-
smallerOrEqual:
|
|
480
|
-
greater(
|
|
481
|
-
return
|
|
462
|
+
return Object.assign(f, {
|
|
463
|
+
greaterOrEqual: s,
|
|
464
|
+
smallerOrEqual: m,
|
|
465
|
+
greater(d) {
|
|
466
|
+
return R(() => `(min-width: ${n(d, 0.1)})`, t);
|
|
482
467
|
},
|
|
483
|
-
smaller(
|
|
484
|
-
return
|
|
468
|
+
smaller(d) {
|
|
469
|
+
return R(() => `(max-width: ${n(d, -0.1)})`, t);
|
|
485
470
|
},
|
|
486
|
-
between(
|
|
487
|
-
return
|
|
471
|
+
between(d, y) {
|
|
472
|
+
return R(() => `(min-width: ${n(d)}) and (max-width: ${n(y, -0.1)})`, t);
|
|
488
473
|
},
|
|
489
|
-
isGreater(
|
|
490
|
-
return
|
|
474
|
+
isGreater(d) {
|
|
475
|
+
return c("min", n(d, 0.1));
|
|
491
476
|
},
|
|
492
|
-
isGreaterOrEqual(
|
|
493
|
-
return
|
|
477
|
+
isGreaterOrEqual(d) {
|
|
478
|
+
return c("min", n(d));
|
|
494
479
|
},
|
|
495
|
-
isSmaller(
|
|
496
|
-
return
|
|
480
|
+
isSmaller(d) {
|
|
481
|
+
return c("max", n(d, -0.1));
|
|
497
482
|
},
|
|
498
|
-
isSmallerOrEqual(
|
|
499
|
-
return
|
|
483
|
+
isSmallerOrEqual(d) {
|
|
484
|
+
return c("max", n(d));
|
|
500
485
|
},
|
|
501
|
-
isInBetween(
|
|
502
|
-
return
|
|
486
|
+
isInBetween(d, y) {
|
|
487
|
+
return c("min", n(d)) && c("max", n(y, -0.1));
|
|
503
488
|
},
|
|
504
|
-
current:
|
|
489
|
+
current: v,
|
|
505
490
|
active() {
|
|
506
|
-
const
|
|
507
|
-
return
|
|
491
|
+
const d = v();
|
|
492
|
+
return _(() => d.value.length === 0 ? "" : d.value.at(o === "min-width" ? -1 : 0));
|
|
508
493
|
}
|
|
509
494
|
});
|
|
510
495
|
}
|
|
511
|
-
|
|
496
|
+
// @__NO_SIDE_EFFECTS__
|
|
497
|
+
function ce(e, t = {}) {
|
|
512
498
|
const {
|
|
513
|
-
controls:
|
|
514
|
-
navigator:
|
|
515
|
-
} = t,
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
499
|
+
controls: n = !1,
|
|
500
|
+
navigator: i = ge
|
|
501
|
+
} = t, o = /* @__PURE__ */ X(() => i && "permissions" in i), r = M(), a = typeof e == "string" ? {
|
|
502
|
+
name: e
|
|
503
|
+
} : e, l = M(), c = () => {
|
|
504
|
+
var m, f;
|
|
505
|
+
l.value = (m = (f = r.value) === null || f === void 0 ? void 0 : f.state) !== null && m !== void 0 ? m : "prompt";
|
|
506
|
+
};
|
|
507
|
+
Q(r, "change", c, {
|
|
508
|
+
passive: !0
|
|
509
|
+
});
|
|
510
|
+
const s = $t(async () => {
|
|
511
|
+
if (o.value) {
|
|
512
|
+
if (!r.value) try {
|
|
513
|
+
r.value = await i.permissions.query(a);
|
|
514
|
+
} catch {
|
|
515
|
+
r.value = void 0;
|
|
516
|
+
} finally {
|
|
517
|
+
c();
|
|
518
|
+
}
|
|
519
|
+
if (n) return De(r.value);
|
|
528
520
|
}
|
|
529
521
|
});
|
|
530
|
-
return
|
|
531
|
-
state:
|
|
532
|
-
isSupported:
|
|
533
|
-
query:
|
|
534
|
-
} :
|
|
522
|
+
return s(), n ? {
|
|
523
|
+
state: l,
|
|
524
|
+
isSupported: o,
|
|
525
|
+
query: s
|
|
526
|
+
} : l;
|
|
535
527
|
}
|
|
536
|
-
function
|
|
528
|
+
function Yt(e = {}) {
|
|
537
529
|
const {
|
|
538
|
-
navigator: t =
|
|
539
|
-
read:
|
|
540
|
-
source:
|
|
541
|
-
copiedDuring:
|
|
542
|
-
legacy:
|
|
543
|
-
} = e,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
530
|
+
navigator: t = ge,
|
|
531
|
+
read: n = !1,
|
|
532
|
+
source: i,
|
|
533
|
+
copiedDuring: o = 1500,
|
|
534
|
+
legacy: r = !1
|
|
535
|
+
} = e, a = /* @__PURE__ */ X(() => t && "clipboard" in t), l = /* @__PURE__ */ ce("clipboard-read"), c = /* @__PURE__ */ ce("clipboard-write"), s = _(() => a.value || r), m = M(""), f = M(!1), v = Lt(() => f.value = !1, o, {
|
|
536
|
+
immediate: !1
|
|
537
|
+
});
|
|
538
|
+
async function d() {
|
|
539
|
+
let p = !(a.value && x(l.value));
|
|
540
|
+
if (!p) try {
|
|
541
|
+
m.value = await t.clipboard.readText();
|
|
542
|
+
} catch {
|
|
543
|
+
p = !0;
|
|
544
|
+
}
|
|
545
|
+
p && (m.value = j());
|
|
548
546
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
547
|
+
s.value && n && Q(["copy", "cut"], d, {
|
|
548
|
+
passive: !0
|
|
549
|
+
});
|
|
550
|
+
async function y(p = T(i)) {
|
|
551
|
+
if (s.value && p != null) {
|
|
552
|
+
let g = !(a.value && x(c.value));
|
|
553
|
+
if (!g) try {
|
|
554
|
+
await t.clipboard.writeText(p);
|
|
555
|
+
} catch {
|
|
556
|
+
g = !0;
|
|
557
|
+
}
|
|
558
|
+
g && w(p), m.value = p, f.value = !0, v.start();
|
|
559
|
+
}
|
|
552
560
|
}
|
|
553
|
-
function
|
|
554
|
-
const
|
|
555
|
-
|
|
561
|
+
function w(p) {
|
|
562
|
+
const g = document.createElement("textarea");
|
|
563
|
+
g.value = p, g.style.position = "absolute", g.style.opacity = "0", g.setAttribute("readonly", ""), document.body.appendChild(g), g.select(), document.execCommand("copy"), g.remove();
|
|
556
564
|
}
|
|
557
565
|
function j() {
|
|
558
|
-
var
|
|
559
|
-
return (
|
|
566
|
+
var p, g, C;
|
|
567
|
+
return (p = (g = document) === null || g === void 0 || (C = g.getSelection) === null || C === void 0 || (C = C.call(g)) === null || C === void 0 ? void 0 : C.toString()) !== null && p !== void 0 ? p : "";
|
|
560
568
|
}
|
|
561
|
-
function
|
|
562
|
-
return
|
|
569
|
+
function x(p) {
|
|
570
|
+
return p === "granted" || p === "prompt";
|
|
563
571
|
}
|
|
564
572
|
return {
|
|
565
|
-
isSupported:
|
|
566
|
-
text:
|
|
567
|
-
copied:
|
|
568
|
-
copy:
|
|
573
|
+
isSupported: s,
|
|
574
|
+
text: U(m),
|
|
575
|
+
copied: U(f),
|
|
576
|
+
copy: y
|
|
569
577
|
};
|
|
570
578
|
}
|
|
571
|
-
const
|
|
572
|
-
function
|
|
573
|
-
return e
|
|
579
|
+
const At = " ";
|
|
580
|
+
function Dt(e) {
|
|
581
|
+
return e?.replace(/(\d{3})\d*(\d{4})/g, "$1****$2");
|
|
574
582
|
}
|
|
575
|
-
function
|
|
576
|
-
return e
|
|
583
|
+
function de(e, t) {
|
|
584
|
+
return e?.replace(/\*/g, "M").replace(/\B(?=(?:\S{4})+$)/g, t ?? At).replace(/M/g, "*");
|
|
577
585
|
}
|
|
578
|
-
function
|
|
579
|
-
const t =
|
|
580
|
-
return
|
|
581
|
-
const
|
|
582
|
-
function
|
|
583
|
-
window.focus(), t.copy(
|
|
584
|
-
|
|
586
|
+
function Bt(e) {
|
|
587
|
+
const t = Yt();
|
|
588
|
+
return S("phone", (i, o) => {
|
|
589
|
+
const r = `phone_${Math.random().toString(36).slice(2)}`, a = "__table__column_phone__", l = $(i, o), c = 16, s = `cursor:pointer;width:${c}px;height:${c}px;`, m = de(Dt(l), e?.separator), f = de(l, e?.separator);
|
|
590
|
+
function v() {
|
|
591
|
+
window.focus(), t.copy(l).then(() => {
|
|
592
|
+
Ue.success({
|
|
585
593
|
content: "复制成功",
|
|
586
594
|
duration: 1e3
|
|
587
595
|
});
|
|
588
596
|
});
|
|
589
597
|
}
|
|
590
|
-
function
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
if (
|
|
598
|
+
function d() {
|
|
599
|
+
const x = document.querySelectorAll(`.${a}.content`);
|
|
600
|
+
x.length > 0 && x.forEach((p) => {
|
|
601
|
+
const g = p;
|
|
602
|
+
if (g.textContent?.includes("****"))
|
|
595
603
|
return;
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
!
|
|
604
|
+
g.dataset.encrypt && (g.textContent = g.dataset.encrypt);
|
|
605
|
+
const C = g.nextSibling;
|
|
606
|
+
!C || !C.classList.contains("preview-icon") || (C.innerHTML = `<svg width="${c}" height="${c}" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 36C35.0457 36 44 24 44 24C44 24 35.0457 12 24 12C12.9543 12 4 24 4 24C4 24 12.9543 36 24 36Z" fill="none" stroke="#333" stroke-width="2" stroke-linejoin="round"/><path d="M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>`);
|
|
599
607
|
});
|
|
600
608
|
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
|
|
609
|
+
function y(x) {
|
|
610
|
+
const p = document.querySelector(`#${r}>.preview-icon`);
|
|
611
|
+
p && (x ? p.innerHTML = `<svg width="${c}" height="${c}" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 36C35.0457 36 44 24 44 24C44 24 35.0457 12 24 12C12.9543 12 4 24 4 24C4 24 12.9543 36 24 36Z" fill="none" stroke="#333" stroke-width="2" stroke-linejoin="round"/><path d="M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>` : p.innerHTML = `<svg width="${c}" height="${c}" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 16C6.63472 17.2193 7.59646 18.3504 8.82276 19.3554C12.261 22.1733 17.779 24 24 24C30.221 24 35.739 22.1733 39.1772 19.3554C40.4035 18.3504 41.3653 17.2193 42 16" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M28.9775 24L31.048 31.7274" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M37.3535 21.3536L43.0103 27.0104" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.00004 27.0103L10.6569 21.3534" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M16.9278 31.7276L18.9983 24.0001" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>`);
|
|
604
612
|
}
|
|
605
|
-
function
|
|
606
|
-
const
|
|
607
|
-
|
|
613
|
+
function w() {
|
|
614
|
+
const x = document.querySelector(`#${r}>.content`), p = !!x?.innerHTML.includes("****");
|
|
615
|
+
p ? (d(), x && (x.innerHTML = f)) : x && (x.innerHTML = m), y(!p);
|
|
608
616
|
}
|
|
609
617
|
function j() {
|
|
610
|
-
e
|
|
618
|
+
e?.onDial ? e.onDial(l) : window.open(`tel:${l}`, "_blank");
|
|
611
619
|
}
|
|
612
|
-
return
|
|
613
|
-
id:
|
|
620
|
+
return u("div", {
|
|
621
|
+
id: r,
|
|
614
622
|
style: "display:flex;align-items:center;gap:4px;"
|
|
615
|
-
}, [
|
|
616
|
-
"data-encrypt":
|
|
617
|
-
class: `${
|
|
623
|
+
}, [u("div", {
|
|
624
|
+
"data-encrypt": m,
|
|
625
|
+
class: `${a} content`,
|
|
618
626
|
style: "use-select:none;font-family: monospace;cursor:pointer;font-variant-numeric: tabular-nums;padding-right: 2px;"
|
|
619
|
-
}, [e
|
|
627
|
+
}, [e?.safe ? m : f]), e?.safe && e?.allowPreview && u("i", {
|
|
620
628
|
class: "preview-icon",
|
|
621
629
|
title: "显示完整号码",
|
|
622
|
-
style:
|
|
623
|
-
onClick:
|
|
624
|
-
}, [
|
|
625
|
-
width:
|
|
626
|
-
height:
|
|
630
|
+
style: s,
|
|
631
|
+
onClick: w
|
|
632
|
+
}, [u("svg", {
|
|
633
|
+
width: c,
|
|
634
|
+
height: c,
|
|
627
635
|
viewBox: "0 0 48 48",
|
|
628
636
|
fill: "none",
|
|
629
637
|
xmlns: "http://www.w3.org/2000/svg"
|
|
630
|
-
}, [
|
|
638
|
+
}, [u("path", {
|
|
631
639
|
d: "M24 36C35.0457 36 44 24 44 24C44 24 35.0457 12 24 12C12.9543 12 4 24 4 24C4 24 12.9543 36 24 36Z",
|
|
632
640
|
fill: "none",
|
|
633
641
|
stroke: "#333",
|
|
634
642
|
"stroke-width": "2",
|
|
635
643
|
"stroke-linejoin": "round"
|
|
636
|
-
}, null),
|
|
644
|
+
}, null), u("path", {
|
|
637
645
|
d: "M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z",
|
|
638
646
|
fill: "none",
|
|
639
647
|
stroke: "#333",
|
|
640
648
|
"stroke-width": "4",
|
|
641
649
|
"stroke-linejoin": "round"
|
|
642
|
-
}, null)])]),
|
|
643
|
-
style:
|
|
650
|
+
}, null)])]), e?.allowDial && u("i", {
|
|
651
|
+
style: s,
|
|
644
652
|
title: "拨出号码",
|
|
645
653
|
onClick: j
|
|
646
|
-
}, [
|
|
647
|
-
width:
|
|
648
|
-
height:
|
|
654
|
+
}, [u("svg", {
|
|
655
|
+
width: c,
|
|
656
|
+
height: c,
|
|
649
657
|
viewBox: "0 0 48 48",
|
|
650
658
|
fill: "none",
|
|
651
659
|
xmlns: "http://www.w3.org/2000/svg"
|
|
652
|
-
}, [
|
|
660
|
+
}, [u("path", {
|
|
653
661
|
d: "M41.7796 20.6066C42.0324 18.9108 41.9495 17.1747 41.5309 15.5054C40.978 13.3002 39.8392 11.2118 38.1147 9.4873C36.3902 7.76281 34.3018 6.62409 32.0967 6.07115C30.4274 5.65257 28.6912 5.56967 26.9954 5.82245",
|
|
654
662
|
stroke: "#333",
|
|
655
663
|
"stroke-width": "2",
|
|
656
664
|
"stroke-linecap": "round",
|
|
657
665
|
"stroke-linejoin": "round"
|
|
658
|
-
}, null),
|
|
666
|
+
}, null), u("path", {
|
|
659
667
|
d: "M34.1896 19.8035C34.4604 17.9869 33.8966 16.0699 32.4982 14.6715C31.0997 13.2731 29.1827 12.7092 27.3662 12.98",
|
|
660
668
|
stroke: "#333",
|
|
661
669
|
"stroke-width": "4",
|
|
662
670
|
"stroke-linecap": "round",
|
|
663
671
|
"stroke-linejoin": "round"
|
|
664
|
-
}, null),
|
|
672
|
+
}, null), u("path", {
|
|
665
673
|
d: "M14.3755 8.79423C15.1021 8.79423 15.7715 9.18825 16.1241 9.82349L18.5706 14.2303C18.8909 14.8073 18.9059 15.5052 18.6108 16.0955L16.254 20.8091C16.254 20.8091 16.937 24.3206 19.7954 27.179C22.6538 30.0374 26.1535 30.7086 26.1535 30.7086L30.8664 28.3522C31.4571 28.0568 32.1555 28.0721 32.7327 28.393L37.152 30.85C37.7866 31.2028 38.1802 31.8719 38.1802 32.598L38.1802 37.6715C38.1802 40.2552 35.7803 42.1213 33.3322 41.2952C28.3043 39.5987 20.4996 36.3685 15.5528 31.4216C10.6059 26.4748 7.3757 18.6701 5.67916 13.6422C4.85314 11.1941 6.71923 8.79423 9.30288 8.79423L14.3755 8.79423Z",
|
|
666
674
|
fill: "none",
|
|
667
675
|
stroke: "#333",
|
|
668
676
|
"stroke-width": "4",
|
|
669
677
|
"stroke-linejoin": "round"
|
|
670
|
-
}, null)])]),
|
|
671
|
-
style:
|
|
678
|
+
}, null)])]), e?.allowCopy && u("i", {
|
|
679
|
+
style: s,
|
|
672
680
|
title: "复制号码",
|
|
673
|
-
onClick:
|
|
674
|
-
}, [
|
|
675
|
-
width:
|
|
676
|
-
height:
|
|
681
|
+
onClick: v
|
|
682
|
+
}, [u("svg", {
|
|
683
|
+
width: c,
|
|
684
|
+
height: c,
|
|
677
685
|
viewBox: "0 0 48 48",
|
|
678
686
|
fill: "none",
|
|
679
687
|
xmlns: "http://www.w3.org/2000/svg"
|
|
680
|
-
}, [
|
|
688
|
+
}, [u("path", {
|
|
681
689
|
d: "M13 12.4316V7.8125C13 6.2592 14.2592 5 15.8125 5H40.1875C41.7408 5 43 6.2592 43 7.8125V32.1875C43 33.7408 41.7408 35 40.1875 35H35.5163",
|
|
682
690
|
stroke: "#333",
|
|
683
691
|
"stroke-width": "2",
|
|
684
692
|
"stroke-linecap": "round",
|
|
685
693
|
"stroke-linejoin": "round"
|
|
686
|
-
}, null),
|
|
694
|
+
}, null), u("path", {
|
|
687
695
|
d: "M32.1875 13H7.8125C6.2592 13 5 14.2592 5 15.8125V40.1875C5 41.7408 6.2592 43 7.8125 43H32.1875C33.7408 43 35 41.7408 35 40.1875V15.8125C35 14.2592 33.7408 13 32.1875 13Z",
|
|
688
696
|
fill: "none",
|
|
689
697
|
stroke: "#333",
|
|
@@ -692,183 +700,178 @@ function jt(e) {
|
|
|
692
700
|
}, null)])])]);
|
|
693
701
|
});
|
|
694
702
|
}
|
|
695
|
-
function
|
|
696
|
-
|
|
703
|
+
function Ft(e) {
|
|
704
|
+
const t = e?.backgroundColor ?? "#f5f5f5", n = e?.foregroundColor ?? "#1677ff", i = e?.showText ?? !0, o = e?.textColor ?? "#000";
|
|
705
|
+
return S("progress", (a, l) => {
|
|
706
|
+
const c = $(a, l), s = e?.precision ?? 0, m = Math.min(Math.max(e?.format?.(c) ?? c, 0), 1), f = i ? `${(m * 100).toFixed(s)}%` : "";
|
|
707
|
+
return u("div", {
|
|
708
|
+
style: `background-color:${t};position:relative;min-height: 20px;text-align: center;border-radius: 2px;overflow:hidden;`
|
|
709
|
+
}, [u("div", {
|
|
710
|
+
style: `background-color: ${n};position:absolute;left:0;top:0;right;0;width: ${f};height: 100%;`
|
|
711
|
+
}, null), i && u("div", {
|
|
712
|
+
style: `position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:${o}`
|
|
713
|
+
}, [f])]);
|
|
714
|
+
});
|
|
697
715
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
700
|
-
|
|
701
|
-
|
|
716
|
+
function Wt(e) {
|
|
717
|
+
return S("render", (n) => e(n));
|
|
718
|
+
}
|
|
719
|
+
function It(e) {
|
|
720
|
+
return S("serial", (n, i, o) => {
|
|
721
|
+
const r = {
|
|
722
|
+
color: typeof e?.color == "function" ? e.color(n) : e?.color,
|
|
723
|
+
fontWeight: e?.weight || "normal",
|
|
724
|
+
textAlign: "center"
|
|
725
|
+
};
|
|
726
|
+
return u("div", {
|
|
727
|
+
style: r
|
|
728
|
+
}, [o.rowIndex + 1]);
|
|
729
|
+
}, {
|
|
730
|
+
disableViewMode: !0
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
function Vt(e) {
|
|
734
|
+
return S("tag", (n, i) => {
|
|
735
|
+
const o = e?.maxCount || 5, r = e?.formatter ? e.formatter(n) : $(n, i), a = e?.textColors || ["#F87335"], l = e?.backgroundColors || ["#FFF4E8"], c = r.length > o, s = e?.minWidth;
|
|
736
|
+
return u("div", {
|
|
702
737
|
style: {
|
|
703
738
|
display: "flex",
|
|
704
739
|
flexWrap: "wrap"
|
|
705
740
|
}
|
|
706
|
-
}, [
|
|
707
|
-
const
|
|
708
|
-
return
|
|
741
|
+
}, [r.slice(0, o).map((m, f) => {
|
|
742
|
+
const v = typeof a == "function" ? a(m, f) : a[f % a.length], d = typeof l == "function" ? l(m, f) : l[f % l.length];
|
|
743
|
+
return u("span", {
|
|
709
744
|
style: {
|
|
710
|
-
minWidth:
|
|
745
|
+
minWidth: s ? `${s}px` : "unset",
|
|
711
746
|
textAlign: "center",
|
|
712
747
|
margin: "2px",
|
|
713
748
|
padding: "2px 5px",
|
|
714
|
-
border: `solid 2px ${e
|
|
715
|
-
borderRadius: `${
|
|
716
|
-
color:
|
|
717
|
-
backgroundColor:
|
|
749
|
+
border: `solid 2px ${e?.border ? v : "transparent"}`,
|
|
750
|
+
borderRadius: `${e?.radius || 0}px`,
|
|
751
|
+
color: v,
|
|
752
|
+
backgroundColor: d
|
|
718
753
|
}
|
|
719
|
-
}, [
|
|
720
|
-
}),
|
|
754
|
+
}, [m]);
|
|
755
|
+
}), c && "..."]);
|
|
721
756
|
});
|
|
722
757
|
}
|
|
723
|
-
function
|
|
758
|
+
function fe(e) {
|
|
724
759
|
if (typeof e == "string")
|
|
725
760
|
return e;
|
|
726
761
|
if (typeof e == "number")
|
|
727
762
|
return `${e}px`;
|
|
728
763
|
}
|
|
729
|
-
function
|
|
730
|
-
|
|
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);
|
|
764
|
+
function Ht(e, t, n) {
|
|
765
|
+
return typeof e == "function" ? e(n)?.toString() : typeof e?.content == "function" ? e?.content(n)?.toString() : typeof e?.content == "string" ? e?.content : $(n, t);
|
|
732
766
|
}
|
|
733
|
-
function
|
|
767
|
+
function Kt(e, t) {
|
|
734
768
|
if (typeof e != "function") {
|
|
735
|
-
if (typeof
|
|
736
|
-
return e
|
|
737
|
-
if (typeof
|
|
738
|
-
return e
|
|
769
|
+
if (typeof e?.color == "function")
|
|
770
|
+
return e?.color(t);
|
|
771
|
+
if (typeof e?.color == "string")
|
|
772
|
+
return e?.color;
|
|
739
773
|
}
|
|
740
774
|
}
|
|
741
|
-
function
|
|
775
|
+
function Nt(e, t) {
|
|
742
776
|
if (typeof e != "function")
|
|
743
|
-
return typeof
|
|
744
|
-
}
|
|
745
|
-
function Yt(e, t) {
|
|
746
|
-
let r = "";
|
|
747
|
-
const u = zt(e, t), a = Et(e, t);
|
|
748
|
-
return u && (r += `color:${u};`), a && (r += `font-size:${a};`), r;
|
|
749
|
-
}
|
|
750
|
-
function At(e) {
|
|
751
|
-
return k("text", (r, u) => {
|
|
752
|
-
const a = Pt(e || {}, u, r), n = Yt(e || {}, r);
|
|
753
|
-
return f("span", {
|
|
754
|
-
style: n
|
|
755
|
-
}, [a]);
|
|
756
|
-
});
|
|
757
|
-
}
|
|
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) => {
|
|
761
|
-
var h;
|
|
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)}%` : "";
|
|
763
|
-
return f("div", {
|
|
764
|
-
style: `background-color:${t};position:relative;min-height: 20px;text-align: center;border-radius: 2px;overflow:hidden;`
|
|
765
|
-
}, [f("div", {
|
|
766
|
-
style: `background-color: ${r};position:absolute;left:0;top:0;right;0;width: ${m};height: 100%;`
|
|
767
|
-
}, null), u && f("div", {
|
|
768
|
-
style: `position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:${a}`
|
|
769
|
-
}, [m])]);
|
|
770
|
-
});
|
|
777
|
+
return typeof e?.size == "function" ? fe(e?.size(t)) : fe(e?.size);
|
|
771
778
|
}
|
|
772
|
-
function
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
disableViewMode: !0
|
|
779
|
+
function Ut(e, t) {
|
|
780
|
+
let n = "";
|
|
781
|
+
const i = Kt(e, t), o = Nt(e, t);
|
|
782
|
+
return i && (n += `color:${i};`), o && (n += `font-size:${o};`), n;
|
|
783
|
+
}
|
|
784
|
+
function Gt(e) {
|
|
785
|
+
return S("text", (n, i) => {
|
|
786
|
+
const o = Ht(e || {}, i, n), r = Ut(e || {}, n);
|
|
787
|
+
return u("span", {
|
|
788
|
+
style: r
|
|
789
|
+
}, [o]);
|
|
784
790
|
});
|
|
785
791
|
}
|
|
786
|
-
function
|
|
792
|
+
function Zt() {
|
|
787
793
|
return {
|
|
788
|
-
dropdown:
|
|
789
|
-
text:
|
|
790
|
-
dict:
|
|
791
|
-
tag:
|
|
792
|
-
render:
|
|
793
|
-
phone:
|
|
794
|
-
image:
|
|
795
|
-
currency:
|
|
796
|
-
date:
|
|
797
|
-
button:
|
|
798
|
-
progress:
|
|
799
|
-
serial:
|
|
794
|
+
dropdown: wt,
|
|
795
|
+
text: Gt,
|
|
796
|
+
dict: vt,
|
|
797
|
+
tag: Vt,
|
|
798
|
+
render: Wt,
|
|
799
|
+
phone: Bt,
|
|
800
|
+
image: Ct,
|
|
801
|
+
currency: dt,
|
|
802
|
+
date: yt,
|
|
803
|
+
button: ut,
|
|
804
|
+
progress: Ft,
|
|
805
|
+
serial: It
|
|
800
806
|
};
|
|
801
807
|
}
|
|
802
|
-
function
|
|
803
|
-
if (!
|
|
808
|
+
function ee(e, t) {
|
|
809
|
+
if (!e?.render)
|
|
804
810
|
return;
|
|
805
|
-
const
|
|
806
|
-
...
|
|
811
|
+
const n = e.render({
|
|
812
|
+
...Zt()
|
|
807
813
|
// ...(Table?.$override?.table || {}),
|
|
808
814
|
});
|
|
809
815
|
return {
|
|
810
816
|
render: ({
|
|
811
|
-
record:
|
|
812
|
-
rowIndex:
|
|
813
|
-
}) =>
|
|
817
|
+
record: i,
|
|
818
|
+
rowIndex: o
|
|
819
|
+
}) => n(i, e, {
|
|
814
820
|
...t || {},
|
|
815
|
-
rowIndex:
|
|
821
|
+
rowIndex: o
|
|
816
822
|
}),
|
|
817
|
-
[
|
|
818
|
-
disableColumnMode:
|
|
819
|
-
disableViewMode:
|
|
820
|
-
isRender:
|
|
821
|
-
type:
|
|
823
|
+
[it]: n.$type,
|
|
824
|
+
disableColumnMode: n.$disableColumnMode,
|
|
825
|
+
disableViewMode: n.$disableViewMode,
|
|
826
|
+
isRender: n.$type === "render",
|
|
827
|
+
type: n.$type
|
|
822
828
|
};
|
|
823
829
|
}
|
|
824
|
-
function
|
|
830
|
+
function me({
|
|
825
831
|
columns: e,
|
|
826
832
|
columnsOptions: t,
|
|
827
|
-
columnsGroups:
|
|
828
|
-
pageMode:
|
|
829
|
-
collapsedColumns:
|
|
830
|
-
events:
|
|
833
|
+
columnsGroups: n,
|
|
834
|
+
pageMode: i,
|
|
835
|
+
collapsedColumns: o,
|
|
836
|
+
events: r
|
|
831
837
|
}) {
|
|
832
|
-
const
|
|
838
|
+
const a = e.map((l) => ({
|
|
833
839
|
...t || {},
|
|
834
|
-
...
|
|
835
|
-
})).map((
|
|
836
|
-
return
|
|
837
|
-
}
|
|
838
|
-
function
|
|
839
|
-
const
|
|
840
|
-
if ("children" in
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
return
|
|
844
|
-
});
|
|
845
|
-
if (l)
|
|
846
|
-
return r.push(l), l;
|
|
840
|
+
...l
|
|
841
|
+
})).map((l) => Xt(l, i, o, r)).filter(Boolean);
|
|
842
|
+
return Qt(a, n);
|
|
843
|
+
}
|
|
844
|
+
function Jt(e, t) {
|
|
845
|
+
const n = [], i = (r) => {
|
|
846
|
+
if ("children" in r && (r.children = r.children.map(i)), "key" in r) {
|
|
847
|
+
const a = t.find((l) => Object.getOwnPropertyDescriptor(l, "key")?.value === r.key);
|
|
848
|
+
if (a)
|
|
849
|
+
return n.push(a), a;
|
|
847
850
|
}
|
|
848
|
-
return
|
|
849
|
-
},
|
|
850
|
-
if (
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
t.splice(
|
|
855
|
-
}), t.splice(
|
|
851
|
+
return r;
|
|
852
|
+
}, o = i(e);
|
|
853
|
+
if (n?.length && o) {
|
|
854
|
+
const r = Math.min(...n.map((a) => t.indexOf(a)));
|
|
855
|
+
n.forEach((a) => {
|
|
856
|
+
const l = t.indexOf(a);
|
|
857
|
+
t.splice(l, 1);
|
|
858
|
+
}), t.splice(r, 0, o);
|
|
856
859
|
}
|
|
857
860
|
}
|
|
858
|
-
function
|
|
859
|
-
return t.forEach((
|
|
860
|
-
|
|
861
|
+
function Qt(e, t = []) {
|
|
862
|
+
return t.forEach((n) => {
|
|
863
|
+
Jt(n, e);
|
|
861
864
|
}), e;
|
|
862
865
|
}
|
|
863
|
-
function
|
|
866
|
+
function Xt(e, t, n, i) {
|
|
864
867
|
const {
|
|
865
|
-
render:
|
|
866
|
-
disableColumnMode:
|
|
867
|
-
} =
|
|
868
|
+
render: o,
|
|
869
|
+
disableColumnMode: r
|
|
870
|
+
} = ee(e, {
|
|
868
871
|
previewing: !1,
|
|
869
|
-
emits:
|
|
872
|
+
emits: i
|
|
870
873
|
}) || {};
|
|
871
|
-
if (!(
|
|
874
|
+
if (!(r || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !n.value.find((a) => a.key === e.key && a.collapsed === !0))
|
|
872
875
|
return {
|
|
873
876
|
dataIndex: e.index || e.key,
|
|
874
877
|
title: e.title,
|
|
@@ -884,13 +887,13 @@ function It(e, t, r, u) {
|
|
|
884
887
|
tooltip: !0,
|
|
885
888
|
...e.extraProps,
|
|
886
889
|
key: e.key,
|
|
887
|
-
render:
|
|
890
|
+
render: o
|
|
888
891
|
};
|
|
889
892
|
}
|
|
890
|
-
function
|
|
891
|
-
return new
|
|
893
|
+
function en() {
|
|
894
|
+
return new rt.Workbook();
|
|
892
895
|
}
|
|
893
|
-
function
|
|
896
|
+
function tn(e, t = "Sheet1") {
|
|
894
897
|
return e.addWorksheet(t, {
|
|
895
898
|
headerFooter: {
|
|
896
899
|
firstHeader: "",
|
|
@@ -898,94 +901,164 @@ function Wt(e, t = "Sheet1") {
|
|
|
898
901
|
}
|
|
899
902
|
});
|
|
900
903
|
}
|
|
901
|
-
function
|
|
904
|
+
function nn(e, t) {
|
|
902
905
|
e.columns = t;
|
|
903
906
|
}
|
|
904
|
-
function
|
|
907
|
+
function rn(e, t) {
|
|
905
908
|
e.addRows(t);
|
|
906
909
|
}
|
|
907
|
-
async function
|
|
910
|
+
async function on({
|
|
908
911
|
columns: e,
|
|
909
912
|
rows: t,
|
|
910
|
-
filename:
|
|
913
|
+
filename: n
|
|
911
914
|
}) {
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
function
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
URL.revokeObjectURL(
|
|
915
|
+
const i = en(), o = tn(i);
|
|
916
|
+
nn(o, e), rn(o, t);
|
|
917
|
+
const r = await i.xlsx.writeBuffer(), a = new Blob([r]);
|
|
918
|
+
an(a, n || `${I().format("YYYY-MM-DD HH:mm:ss")}.xlsx`);
|
|
919
|
+
}
|
|
920
|
+
function an(e, t) {
|
|
921
|
+
const n = document.createElement("a");
|
|
922
|
+
n.download = t || "download", n.href = URL.createObjectURL(e), n.click(), setTimeout(() => {
|
|
923
|
+
URL.revokeObjectURL(n.href);
|
|
921
924
|
}, 1e3);
|
|
922
925
|
}
|
|
923
|
-
function
|
|
924
|
-
const
|
|
925
|
-
return e.filter((
|
|
926
|
-
options:
|
|
927
|
-
render:
|
|
928
|
-
content: typeof
|
|
929
|
-
})).forEach((
|
|
930
|
-
|
|
931
|
-
const n = (i = a.render) == null ? void 0 : i.render, l = () => {
|
|
932
|
-
var o;
|
|
926
|
+
function ln(e, t) {
|
|
927
|
+
const n = {};
|
|
928
|
+
return e.filter((o) => o.exportable !== !1).map((o) => ({
|
|
929
|
+
options: o,
|
|
930
|
+
render: ee(o),
|
|
931
|
+
content: typeof o.exportable == "object" ? o.exportable.content : void 0
|
|
932
|
+
})).forEach((o) => {
|
|
933
|
+
const r = o.render?.render, a = () => {
|
|
933
934
|
switch (!0) {
|
|
934
|
-
case !!
|
|
935
|
-
return
|
|
936
|
-
case !!
|
|
937
|
-
const
|
|
935
|
+
case !!o.content:
|
|
936
|
+
return o.content && o.content(t);
|
|
937
|
+
case !!r: {
|
|
938
|
+
const l = document.createElement("div"), c = Be(() => r && r({
|
|
938
939
|
record: t
|
|
939
940
|
}));
|
|
940
|
-
return
|
|
941
|
+
return Fe(c, l), c.el?.textContent;
|
|
941
942
|
}
|
|
942
943
|
default:
|
|
943
|
-
return
|
|
944
|
+
return $(t, o.options);
|
|
944
945
|
}
|
|
945
946
|
};
|
|
946
|
-
|
|
947
|
-
}),
|
|
947
|
+
n[o.options.key] = a();
|
|
948
|
+
}), n;
|
|
948
949
|
}
|
|
949
|
-
function
|
|
950
|
+
function sn(e) {
|
|
950
951
|
switch (!0) {
|
|
951
952
|
case typeof e == "number":
|
|
952
953
|
return e / 6;
|
|
953
954
|
case (typeof e == "string" && e.endsWith("px")):
|
|
954
|
-
return parseInt(e.replace("px", "")) / 6;
|
|
955
|
+
return Number.parseInt(e.replace("px", "")) / 6;
|
|
955
956
|
default:
|
|
956
957
|
return 30;
|
|
957
958
|
}
|
|
958
959
|
}
|
|
959
|
-
function
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
columns: u,
|
|
970
|
-
rows: a,
|
|
971
|
-
filename: r
|
|
960
|
+
function un(e, t, n) {
|
|
961
|
+
const i = e.filter((r) => r.exportable !== !1).map((r) => ({
|
|
962
|
+
key: r.key,
|
|
963
|
+
header: r.exportable?.header || r.title,
|
|
964
|
+
width: r.exportable?.width || sn(r.width)
|
|
965
|
+
})), o = t.map((r) => ln(e, r));
|
|
966
|
+
on({
|
|
967
|
+
columns: i,
|
|
968
|
+
rows: o,
|
|
969
|
+
filename: n
|
|
972
970
|
});
|
|
973
971
|
}
|
|
974
|
-
function
|
|
972
|
+
function cn() {
|
|
975
973
|
return {
|
|
976
|
-
exportExcel:
|
|
974
|
+
exportExcel: un
|
|
977
975
|
};
|
|
978
976
|
}
|
|
979
|
-
|
|
977
|
+
const dn = 300;
|
|
978
|
+
function fn(e) {
|
|
979
|
+
const n = e?.querySelector(".arco-scrollbar-container.arco-table-body");
|
|
980
|
+
if (!n)
|
|
981
|
+
return;
|
|
982
|
+
let i, o = !1, r;
|
|
983
|
+
n.addEventListener("mousedown", () => {
|
|
984
|
+
i = setTimeout(() => {
|
|
985
|
+
i && (n.style.cursor = "grab", n.style.userSelect = "none", o = !0);
|
|
986
|
+
}, dn);
|
|
987
|
+
}), n.addEventListener("mouseup", () => {
|
|
988
|
+
clearTimeout(i), i && (i = void 0, o = !1, n.style.cursor = "", n.style.userSelect = "", r = void 0);
|
|
989
|
+
}), n.addEventListener("mousemove", (a) => {
|
|
990
|
+
if (o)
|
|
991
|
+
if (r === void 0)
|
|
992
|
+
r = a.clientX;
|
|
993
|
+
else {
|
|
994
|
+
const l = r - a.clientX;
|
|
995
|
+
r = a.clientX, n.scrollLeft += l;
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
class K {
|
|
1000
|
+
data = We({
|
|
1001
|
+
index: 1,
|
|
1002
|
+
size: 10,
|
|
1003
|
+
total: 0
|
|
1004
|
+
});
|
|
1005
|
+
get pageIndex() {
|
|
1006
|
+
return this.data.index;
|
|
1007
|
+
}
|
|
1008
|
+
set pageIndex(t) {
|
|
1009
|
+
this.data.index = t;
|
|
1010
|
+
}
|
|
1011
|
+
get pageSize() {
|
|
1012
|
+
return this.data.size;
|
|
1013
|
+
}
|
|
1014
|
+
set pageSize(t) {
|
|
1015
|
+
this.data.size = t;
|
|
1016
|
+
}
|
|
1017
|
+
get total() {
|
|
1018
|
+
return this.data.total;
|
|
1019
|
+
}
|
|
1020
|
+
set total(t) {
|
|
1021
|
+
this.data.total = t;
|
|
1022
|
+
}
|
|
1023
|
+
pageSizeOpts = [10, 20, 30, 40, 50];
|
|
1024
|
+
pageLayouts = ["PrevJump", "PrevPage", "JumpNumber", "NextPage", "NextJump", "Sizes", "FullJump", "Total"];
|
|
1025
|
+
/**
|
|
1026
|
+
* 构造函数
|
|
1027
|
+
* @param index
|
|
1028
|
+
* @param size
|
|
1029
|
+
*/
|
|
1030
|
+
constructor(t = 1, n = 10) {
|
|
1031
|
+
this.pageIndex = t, this.pageSize = n;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* 重置操作
|
|
1035
|
+
*/
|
|
1036
|
+
reset() {
|
|
1037
|
+
this.pageIndex = 1;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* 前置操作
|
|
1041
|
+
* @param options
|
|
1042
|
+
*/
|
|
1043
|
+
before(t) {
|
|
1044
|
+
t.paramsQuery = {
|
|
1045
|
+
...t.paramsQuery,
|
|
1046
|
+
page: this.pageIndex - 1,
|
|
1047
|
+
size: this.pageSize
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* 后置操作
|
|
1052
|
+
* @param response
|
|
1053
|
+
*/
|
|
1054
|
+
after(t) {
|
|
1055
|
+
this.total = t.data?.totalElements;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
class te {
|
|
1059
|
+
sort = {};
|
|
1060
|
+
defaultSort = {};
|
|
980
1061
|
constructor(t) {
|
|
981
|
-
$(this, "sort", {});
|
|
982
|
-
$(this, "defaultSort", {});
|
|
983
|
-
$(this, "before", (t) => {
|
|
984
|
-
t.paramsQuery = {
|
|
985
|
-
...t.paramsQuery || {},
|
|
986
|
-
sort: this.stringify(this.sort)
|
|
987
|
-
};
|
|
988
|
-
});
|
|
989
1062
|
t && (this.sort = t, this.defaultSort = t);
|
|
990
1063
|
}
|
|
991
1064
|
/**
|
|
@@ -993,19 +1066,25 @@ class Z {
|
|
|
993
1066
|
* @param key 排序关键字
|
|
994
1067
|
* @param value 排序方式
|
|
995
1068
|
*/
|
|
996
|
-
update(t,
|
|
997
|
-
t &&
|
|
1069
|
+
update(t, n) {
|
|
1070
|
+
t && n && (this.sort[t] = n);
|
|
998
1071
|
}
|
|
999
1072
|
/**
|
|
1000
1073
|
* 移除排序项
|
|
1001
1074
|
* @param key 排序关键字
|
|
1002
1075
|
*/
|
|
1003
1076
|
remove(t) {
|
|
1004
|
-
const
|
|
1005
|
-
this.sort = {},
|
|
1006
|
-
this.sort[
|
|
1077
|
+
const n = Object.entries(this.sort).filter(([i]) => i !== t);
|
|
1078
|
+
this.sort = {}, n && n.forEach(([i, o]) => {
|
|
1079
|
+
this.sort[i] = o;
|
|
1007
1080
|
});
|
|
1008
1081
|
}
|
|
1082
|
+
before = (t) => {
|
|
1083
|
+
t.paramsQuery = {
|
|
1084
|
+
...t.paramsQuery || {},
|
|
1085
|
+
sort: this.stringify(this.sort)
|
|
1086
|
+
};
|
|
1087
|
+
};
|
|
1009
1088
|
/**
|
|
1010
1089
|
* 重置分页数据
|
|
1011
1090
|
*/
|
|
@@ -1016,122 +1095,17 @@ class Z {
|
|
|
1016
1095
|
* 转换排序对象为字符串
|
|
1017
1096
|
*/
|
|
1018
1097
|
stringify(t) {
|
|
1019
|
-
return typeof t != "object" ? [] : (t instanceof
|
|
1098
|
+
return typeof t != "object" ? [] : (t instanceof te && (t = t.sort), Object.entries(t).map(([n, i]) => `${n},${i}`));
|
|
1020
1099
|
}
|
|
1021
1100
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
if (!r)
|
|
1026
|
-
return;
|
|
1027
|
-
let u, a = !1, n;
|
|
1028
|
-
r.addEventListener("mousedown", () => {
|
|
1029
|
-
u = setTimeout(() => {
|
|
1030
|
-
u && (r.style.cursor = "grab", r.style.userSelect = "none", a = !0);
|
|
1031
|
-
}, er);
|
|
1032
|
-
}), r.addEventListener("mouseup", () => {
|
|
1033
|
-
clearTimeout(u), u && (u = void 0, a = !1, r.style.cursor = "", r.style.userSelect = "", n = void 0);
|
|
1034
|
-
}), r.addEventListener("mousemove", (l) => {
|
|
1035
|
-
if (a)
|
|
1036
|
-
if (n === void 0)
|
|
1037
|
-
n = l.clientX;
|
|
1038
|
-
else {
|
|
1039
|
-
const i = n - l.clientX;
|
|
1040
|
-
n = l.clientX, r.scrollLeft += i;
|
|
1041
|
-
}
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
1044
|
-
function rr(e) {
|
|
1045
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Be(e);
|
|
1046
|
-
}
|
|
1047
|
-
const nr = /* @__PURE__ */ B({
|
|
1048
|
-
props: {
|
|
1049
|
-
record: {
|
|
1050
|
-
type: Object,
|
|
1051
|
-
required: !0
|
|
1052
|
-
},
|
|
1053
|
-
columns: {
|
|
1054
|
-
type: Array,
|
|
1055
|
-
required: !0
|
|
1056
|
-
},
|
|
1057
|
-
minWidth: {
|
|
1058
|
-
type: Number,
|
|
1059
|
-
required: !1,
|
|
1060
|
-
default: 320
|
|
1061
|
-
},
|
|
1062
|
-
border: {
|
|
1063
|
-
type: Boolean,
|
|
1064
|
-
default: !0
|
|
1065
|
-
},
|
|
1066
|
-
exclude: {
|
|
1067
|
-
type: Array,
|
|
1068
|
-
default: () => []
|
|
1069
|
-
},
|
|
1070
|
-
layout: {
|
|
1071
|
-
type: String,
|
|
1072
|
-
required: !1,
|
|
1073
|
-
default: "horizontal"
|
|
1074
|
-
},
|
|
1075
|
-
buttons: {
|
|
1076
|
-
type: Array,
|
|
1077
|
-
default: () => []
|
|
1078
|
-
}
|
|
1079
|
-
},
|
|
1080
|
-
setup(e) {
|
|
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) => ({
|
|
1082
|
-
options: n,
|
|
1083
|
-
renderer: G(n, {
|
|
1084
|
-
previewing: !0
|
|
1085
|
-
})
|
|
1086
|
-
})).filter(({
|
|
1087
|
-
options: n
|
|
1088
|
-
}) => {
|
|
1089
|
-
var l;
|
|
1090
|
-
return !((l = e.exclude) != null && l.includes(n.key));
|
|
1091
|
-
}).filter(({
|
|
1092
|
-
renderer: n
|
|
1093
|
-
}) => !(n != null && n.disableViewMode));
|
|
1094
|
-
function a() {
|
|
1095
|
-
var n;
|
|
1096
|
-
if (t) {
|
|
1097
|
-
const l = (n = t.proxy) == null ? void 0 : n.$el;
|
|
1098
|
-
r.value = Math.floor(l.offsetWidth / e.minWidth);
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
return A(() => {
|
|
1102
|
-
a();
|
|
1103
|
-
}), () => {
|
|
1104
|
-
let n;
|
|
1105
|
-
return f("div", {
|
|
1106
|
-
class: "preview-container"
|
|
1107
|
-
}, [f(Ke, {
|
|
1108
|
-
column: r.value,
|
|
1109
|
-
bordered: !0,
|
|
1110
|
-
align: "left",
|
|
1111
|
-
layout: e.layout
|
|
1112
|
-
}, rr(n = u.map((l) => f(We, {
|
|
1113
|
-
label: l.options.title
|
|
1114
|
-
}, {
|
|
1115
|
-
default: () => {
|
|
1116
|
-
var i, o;
|
|
1117
|
-
return [(i = l.renderer) != null && i.render ? (o = l.renderer) == null ? void 0 : o.render({
|
|
1118
|
-
record: e.record
|
|
1119
|
-
}) : T(e.record, l.options)];
|
|
1120
|
-
}
|
|
1121
|
-
}))) ? n : {
|
|
1122
|
-
default: () => [n]
|
|
1123
|
-
})]);
|
|
1124
|
-
};
|
|
1125
|
-
}
|
|
1126
|
-
});
|
|
1127
|
-
function ar(e, t, {
|
|
1128
|
-
tableForm: r,
|
|
1129
|
-
tableEvents: u
|
|
1101
|
+
function mn(e, t, {
|
|
1102
|
+
tableForm: n,
|
|
1103
|
+
tableEvents: i
|
|
1130
1104
|
}) {
|
|
1131
|
-
const
|
|
1132
|
-
return
|
|
1105
|
+
const o = e.refreshable || e.exportable || t.slots.actions, r = !!n?.length && o;
|
|
1106
|
+
return o || r ? () => u(G, null, [r && u(Ge, {
|
|
1133
1107
|
margin: 0
|
|
1134
|
-
}, null),
|
|
1108
|
+
}, null), o && u("div", {
|
|
1135
1109
|
class: "table-actions",
|
|
1136
1110
|
style: {
|
|
1137
1111
|
display: "flex",
|
|
@@ -1140,44 +1114,108 @@ function ar(e, t, {
|
|
|
1140
1114
|
flexDirection: e.actionsPosition === "right" ? "row" : "row-reverse",
|
|
1141
1115
|
alignItems: "center"
|
|
1142
1116
|
}
|
|
1143
|
-
}, [
|
|
1117
|
+
}, [u("div", {
|
|
1144
1118
|
class: "built-in"
|
|
1145
|
-
}, [
|
|
1146
|
-
default: () => [e.refreshable &&
|
|
1119
|
+
}, [u(le, null, {
|
|
1120
|
+
default: () => [e.refreshable && u(P, {
|
|
1147
1121
|
type: "primary",
|
|
1148
|
-
onClick: () =>
|
|
1122
|
+
onClick: () => i("reload")
|
|
1149
1123
|
}, {
|
|
1150
|
-
default: () => [
|
|
1151
|
-
}), e.exportable &&
|
|
1124
|
+
default: () => [A("刷新")]
|
|
1125
|
+
}), e.exportable && u(P, {
|
|
1152
1126
|
type: "primary",
|
|
1153
|
-
onClick: () =>
|
|
1127
|
+
onClick: () => i("export")
|
|
1154
1128
|
}, {
|
|
1155
|
-
default: () => [
|
|
1156
|
-
}), e.collapsable &&
|
|
1129
|
+
default: () => [A("导出")]
|
|
1130
|
+
}), e.collapsable && u(P, {
|
|
1157
1131
|
type: "primary",
|
|
1158
|
-
onClick: () =>
|
|
1132
|
+
onClick: () => i("collapse")
|
|
1159
1133
|
}, {
|
|
1160
|
-
default: () => [
|
|
1134
|
+
default: () => [A("显示")]
|
|
1161
1135
|
})]
|
|
1162
|
-
})]),
|
|
1136
|
+
})]), u("div", {
|
|
1163
1137
|
class: "customs"
|
|
1164
|
-
}, [
|
|
1138
|
+
}, [u(le, null, {
|
|
1165
1139
|
default: () => [t.slots.actions && t.slots.actions()]
|
|
1166
1140
|
})])])]) : () => {
|
|
1167
1141
|
};
|
|
1168
1142
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1143
|
+
const hn = /* @__PURE__ */ F({
|
|
1144
|
+
props: {
|
|
1145
|
+
collapsedColumns: {
|
|
1146
|
+
type: Array,
|
|
1147
|
+
required: !0
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
setup(e) {
|
|
1151
|
+
const t = W(), n = k(e.collapsedColumns.map((o) => ({
|
|
1152
|
+
label: o.title,
|
|
1153
|
+
value: o.key,
|
|
1154
|
+
disabled: !1
|
|
1155
|
+
}))), i = k(e.collapsedColumns.filter((o) => o.collapsed).map((o) => o.key));
|
|
1156
|
+
return tt(() => {
|
|
1157
|
+
const o = e.collapsedColumns.map((r) => ({
|
|
1158
|
+
key: r.key,
|
|
1159
|
+
title: r.title,
|
|
1160
|
+
collapsed: i.value.includes(r.key)
|
|
1161
|
+
}));
|
|
1162
|
+
t.close(o);
|
|
1163
|
+
}), () => u("div", {
|
|
1164
|
+
class: "table-collapsed-render"
|
|
1165
|
+
}, [u(Ze, {
|
|
1166
|
+
data: n.value,
|
|
1167
|
+
"default-value": i.value,
|
|
1168
|
+
onChange: (o) => i.value = [...o],
|
|
1169
|
+
title: ["显示列", "隐藏列"],
|
|
1170
|
+
style: {
|
|
1171
|
+
justifyContent: "center"
|
|
1172
|
+
}
|
|
1173
|
+
}, {
|
|
1174
|
+
default: () => [Ie(u("template", null, null), [[Ve("slot"), "source"]])]
|
|
1175
|
+
})]);
|
|
1176
|
+
}
|
|
1177
|
+
}), yn = /* @__PURE__ */ F({
|
|
1178
|
+
props: {
|
|
1179
|
+
value: {
|
|
1180
|
+
type: Object,
|
|
1181
|
+
required: !0
|
|
1182
|
+
},
|
|
1183
|
+
form: {
|
|
1184
|
+
type: Array,
|
|
1185
|
+
required: !0
|
|
1186
|
+
},
|
|
1187
|
+
onSubmit: {
|
|
1188
|
+
type: Function,
|
|
1189
|
+
required: !1
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
setup(e) {
|
|
1193
|
+
const t = W();
|
|
1194
|
+
function n(i) {
|
|
1195
|
+
e.onSubmit && e.onSubmit(i), t.close(i);
|
|
1196
|
+
}
|
|
1197
|
+
return () => u("div", {
|
|
1198
|
+
class: "edit-form-container"
|
|
1199
|
+
}, [u(be, {
|
|
1200
|
+
name: "form",
|
|
1201
|
+
value: e.value,
|
|
1202
|
+
form: e.form,
|
|
1203
|
+
onSubmit: n
|
|
1204
|
+
}, null)]);
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
function pn(e, t, {
|
|
1208
|
+
tableForm: n,
|
|
1209
|
+
tableEvents: i,
|
|
1210
|
+
formInstance: o
|
|
1173
1211
|
}) {
|
|
1174
|
-
return
|
|
1212
|
+
return n?.length ? () => u("div", {
|
|
1175
1213
|
class: "table-form"
|
|
1176
|
-
}, [
|
|
1177
|
-
form:
|
|
1178
|
-
ref: (
|
|
1214
|
+
}, [u(be, pe({
|
|
1215
|
+
form: n,
|
|
1216
|
+
ref: (r) => o && (o.value = r),
|
|
1179
1217
|
searchable: !0,
|
|
1180
|
-
onSubmit: () =>
|
|
1218
|
+
onSubmit: () => i("reload", {
|
|
1181
1219
|
reset: !0
|
|
1182
1220
|
})
|
|
1183
1221
|
}, e.formOptions), {
|
|
@@ -1185,176 +1223,182 @@ function lr(e, t, {
|
|
|
1185
1223
|
})]) : () => {
|
|
1186
1224
|
};
|
|
1187
1225
|
}
|
|
1188
|
-
function
|
|
1189
|
-
|
|
1226
|
+
function bn(e, t, {
|
|
1227
|
+
pageService: n,
|
|
1228
|
+
tableEvents: i
|
|
1190
1229
|
}) {
|
|
1191
|
-
|
|
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", []);
|
|
1230
|
+
function o(l) {
|
|
1231
|
+
n && (n.pageIndex = l, i("reload"));
|
|
1194
1232
|
}
|
|
1195
|
-
function
|
|
1196
|
-
|
|
1197
|
-
|
|
1233
|
+
function r(l) {
|
|
1234
|
+
n && (n.pageSize = l, i("reload"));
|
|
1235
|
+
}
|
|
1236
|
+
const a = /* @__PURE__ */ Et({
|
|
1237
|
+
mobile: 0,
|
|
1238
|
+
tablet: 640,
|
|
1239
|
+
desktop: 1024
|
|
1240
|
+
});
|
|
1241
|
+
return n ? () => u("div", {
|
|
1242
|
+
class: "table-pagination",
|
|
1243
|
+
style: {
|
|
1244
|
+
padding: "10px 0"
|
|
1245
|
+
}
|
|
1246
|
+
}, [u(Je, {
|
|
1247
|
+
current: n.pageIndex,
|
|
1248
|
+
"onUpdate:current": (l) => n.pageIndex = l,
|
|
1249
|
+
"page-size": n.pageSize,
|
|
1250
|
+
"onUpdate:page-size": (l) => n.pageSize = l,
|
|
1251
|
+
total: n.total,
|
|
1252
|
+
"page-size-options": n.pageSizeOpts,
|
|
1253
|
+
"hide-on-single-page": !e.alwayShowPagination,
|
|
1254
|
+
"show-total": !0,
|
|
1255
|
+
"show-page-size": !0,
|
|
1256
|
+
size: "small",
|
|
1257
|
+
simple: a.smaller("desktop").value,
|
|
1258
|
+
onChange: (l) => o(l),
|
|
1259
|
+
onPageSizeChange: (l) => r(l),
|
|
1260
|
+
style: {
|
|
1261
|
+
justifyContent: "flex-end"
|
|
1262
|
+
}
|
|
1263
|
+
}, null)]) : () => {
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
function gn(e, t, {
|
|
1267
|
+
tableSource: n
|
|
1268
|
+
}) {
|
|
1269
|
+
const i = k([]);
|
|
1270
|
+
function o() {
|
|
1271
|
+
i.value = [], t.emit("update:radio-key", null), t.emit("update:radio-row", null), t.emit("update:checkbox-keys", []), t.emit("update:checkbox-rows", []);
|
|
1272
|
+
}
|
|
1273
|
+
function r() {
|
|
1274
|
+
N(() => {
|
|
1275
|
+
e.checkboxRows !== void 0 && (i.value = [...e.checkboxRows.map((s) => s[e.rowKey])]), e.checkboxKeys !== void 0 && (i.value = [...e.checkboxKeys]), e.radioKey && (i.value = [e.radioKey]), e.radioRow && (i.value = [e.radioRow[e.rowKey]]);
|
|
1198
1276
|
});
|
|
1199
1277
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const
|
|
1278
|
+
function a() {
|
|
1279
|
+
const s = typeof e.selection == "string" ? {
|
|
1202
1280
|
type: e.selection
|
|
1203
1281
|
} : e.selection;
|
|
1204
|
-
switch (
|
|
1282
|
+
switch (s?.type) {
|
|
1205
1283
|
case "radio":
|
|
1206
1284
|
return {
|
|
1207
1285
|
title: "选择",
|
|
1208
1286
|
width: 80,
|
|
1209
|
-
selectedRowKeys:
|
|
1210
|
-
...
|
|
1287
|
+
selectedRowKeys: i.value,
|
|
1288
|
+
...s
|
|
1211
1289
|
};
|
|
1212
1290
|
case "checkbox":
|
|
1213
1291
|
return {
|
|
1214
1292
|
width: 80,
|
|
1215
1293
|
showCheckedAll: !0,
|
|
1216
|
-
selectedRowKeys:
|
|
1217
|
-
...
|
|
1294
|
+
selectedRowKeys: i.value,
|
|
1295
|
+
...s
|
|
1218
1296
|
};
|
|
1219
1297
|
}
|
|
1220
1298
|
}
|
|
1221
|
-
function
|
|
1299
|
+
function l(s, m, f) {
|
|
1222
1300
|
const {
|
|
1223
|
-
type:
|
|
1224
|
-
} =
|
|
1225
|
-
switch (
|
|
1301
|
+
type: v
|
|
1302
|
+
} = a() || {};
|
|
1303
|
+
switch (v) {
|
|
1226
1304
|
case "radio":
|
|
1227
|
-
t.emit("update:radio-key",
|
|
1305
|
+
t.emit("update:radio-key", m), t.emit("update:radio-row", f);
|
|
1228
1306
|
break;
|
|
1229
1307
|
case "checkbox":
|
|
1230
|
-
t.emit("update:checkbox-keys",
|
|
1231
|
-
var S;
|
|
1232
|
-
return r.value.find((x) => x[e.rowKey] === w) || ((S = e.checkboxRows) == null ? void 0 : S.find((x) => x[e.rowKey] === w));
|
|
1233
|
-
}));
|
|
1308
|
+
t.emit("update:checkbox-keys", s), t.emit("update:checkbox-rows", s.map((d) => n.value.find((y) => y[e.rowKey] === d) || e.checkboxRows?.find((y) => y[e.rowKey] === d)));
|
|
1234
1309
|
break;
|
|
1235
1310
|
}
|
|
1236
1311
|
}
|
|
1237
|
-
function
|
|
1238
|
-
|
|
1239
|
-
t.emit("update:checkbox-keys",
|
|
1240
|
-
var s;
|
|
1241
|
-
return r.value.find((m) => m[e.rowKey] === d) || ((s = e.checkboxRows) == null ? void 0 : s.find((m) => m[e.rowKey] === d));
|
|
1242
|
-
}));
|
|
1312
|
+
function c() {
|
|
1313
|
+
N(() => {
|
|
1314
|
+
t.emit("update:checkbox-keys", i.value), t.emit("update:checkbox-rows", i.value.map((s) => n.value.find((m) => m[e.rowKey] === s) || e.checkboxRows?.find((m) => m[e.rowKey] === s)));
|
|
1243
1315
|
});
|
|
1244
1316
|
}
|
|
1245
|
-
return
|
|
1246
|
-
selectedRowKeys:
|
|
1247
|
-
rowSelection:
|
|
1248
|
-
onSelect:
|
|
1249
|
-
onSelectAll:
|
|
1250
|
-
resetSelection:
|
|
1251
|
-
reloadSelection:
|
|
1317
|
+
return r(), {
|
|
1318
|
+
selectedRowKeys: i,
|
|
1319
|
+
rowSelection: a(),
|
|
1320
|
+
onSelect: l,
|
|
1321
|
+
onSelectAll: c,
|
|
1322
|
+
resetSelection: o,
|
|
1323
|
+
reloadSelection: r
|
|
1252
1324
|
};
|
|
1253
1325
|
}
|
|
1254
|
-
function
|
|
1255
|
-
|
|
1256
|
-
tableEvents: u
|
|
1257
|
-
}) {
|
|
1258
|
-
function a(i) {
|
|
1259
|
-
r && (r.pageIndex = i, u("reload"));
|
|
1260
|
-
}
|
|
1261
|
-
function n(i) {
|
|
1262
|
-
r && (r.pageSize = i, u("reload"));
|
|
1263
|
-
}
|
|
1264
|
-
const l = _t({
|
|
1265
|
-
mobile: 0,
|
|
1266
|
-
tablet: 640,
|
|
1267
|
-
desktop: 1024
|
|
1268
|
-
});
|
|
1269
|
-
return r ? () => f("div", {
|
|
1270
|
-
class: "table-pagination",
|
|
1271
|
-
style: {
|
|
1272
|
-
padding: "10px 0"
|
|
1273
|
-
}
|
|
1274
|
-
}, [f(Ue, {
|
|
1275
|
-
current: r.pageIndex,
|
|
1276
|
-
"onUpdate:current": (i) => r.pageIndex = i,
|
|
1277
|
-
"page-size": r.pageSize,
|
|
1278
|
-
"onUpdate:page-size": (i) => r.pageSize = i,
|
|
1279
|
-
total: r.total,
|
|
1280
|
-
"page-size-options": r.pageSizeOpts,
|
|
1281
|
-
"hide-on-single-page": !e.alwayShowPagination,
|
|
1282
|
-
"show-total": !0,
|
|
1283
|
-
"show-page-size": !0,
|
|
1284
|
-
size: "small",
|
|
1285
|
-
simple: l.smaller("desktop").value,
|
|
1286
|
-
onChange: (i) => a(i),
|
|
1287
|
-
onPageSizeChange: (i) => n(i),
|
|
1288
|
-
style: {
|
|
1289
|
-
justifyContent: "flex-end"
|
|
1290
|
-
}
|
|
1291
|
-
}, null)]) : () => {
|
|
1292
|
-
};
|
|
1326
|
+
function vn(e) {
|
|
1327
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !He(e);
|
|
1293
1328
|
}
|
|
1294
|
-
const
|
|
1295
|
-
props: {
|
|
1296
|
-
collapsedColumns: {
|
|
1297
|
-
type: Array,
|
|
1298
|
-
required: !0
|
|
1299
|
-
}
|
|
1300
|
-
},
|
|
1301
|
-
setup(e) {
|
|
1302
|
-
const t = D(), r = g(e.collapsedColumns.map((a) => ({
|
|
1303
|
-
label: a.title,
|
|
1304
|
-
value: a.key,
|
|
1305
|
-
disabled: !1
|
|
1306
|
-
}))), u = g(e.collapsedColumns.filter((a) => a.collapsed).map((a) => a.key));
|
|
1307
|
-
return Je(() => {
|
|
1308
|
-
const a = e.collapsedColumns.map((n) => ({
|
|
1309
|
-
key: n.key,
|
|
1310
|
-
title: n.title,
|
|
1311
|
-
collapsed: u.value.includes(n.key)
|
|
1312
|
-
}));
|
|
1313
|
-
t.close(a);
|
|
1314
|
-
}), () => f("div", {
|
|
1315
|
-
class: "table-collapsed-render"
|
|
1316
|
-
}, [f(Ge, {
|
|
1317
|
-
data: r.value,
|
|
1318
|
-
"default-value": u.value,
|
|
1319
|
-
onChange: (a) => u.value = [...a],
|
|
1320
|
-
title: ["显示列", "隐藏列"],
|
|
1321
|
-
style: {
|
|
1322
|
-
justifyContent: "center"
|
|
1323
|
-
}
|
|
1324
|
-
}, {
|
|
1325
|
-
default: () => [De(f("template", null, null), [[Ve("slot"), "source"]])]
|
|
1326
|
-
})]);
|
|
1327
|
-
}
|
|
1328
|
-
}), dr = /* @__PURE__ */ B({
|
|
1329
|
+
const wn = /* @__PURE__ */ F({
|
|
1329
1330
|
props: {
|
|
1330
|
-
|
|
1331
|
+
record: {
|
|
1331
1332
|
type: Object,
|
|
1332
1333
|
required: !0
|
|
1333
1334
|
},
|
|
1334
|
-
|
|
1335
|
+
columns: {
|
|
1335
1336
|
type: Array,
|
|
1336
1337
|
required: !0
|
|
1337
1338
|
},
|
|
1338
|
-
|
|
1339
|
-
type:
|
|
1340
|
-
required: !1
|
|
1339
|
+
minWidth: {
|
|
1340
|
+
type: Number,
|
|
1341
|
+
required: !1,
|
|
1342
|
+
default: 320
|
|
1343
|
+
},
|
|
1344
|
+
border: {
|
|
1345
|
+
type: Boolean,
|
|
1346
|
+
default: !0
|
|
1347
|
+
},
|
|
1348
|
+
exclude: {
|
|
1349
|
+
type: Array,
|
|
1350
|
+
default: () => []
|
|
1351
|
+
},
|
|
1352
|
+
layout: {
|
|
1353
|
+
type: String,
|
|
1354
|
+
required: !1,
|
|
1355
|
+
default: "horizontal"
|
|
1356
|
+
},
|
|
1357
|
+
buttons: {
|
|
1358
|
+
type: Array,
|
|
1359
|
+
default: () => []
|
|
1341
1360
|
}
|
|
1342
1361
|
},
|
|
1343
1362
|
setup(e) {
|
|
1344
|
-
const t =
|
|
1345
|
-
|
|
1346
|
-
|
|
1363
|
+
const t = z(), n = k(0), i = e.columns.filter((r) => typeof r.visiable == "boolean" ? r.visiable : typeof r.visiable == "function" ? r.visiable() : !0).map((r) => ({
|
|
1364
|
+
options: r,
|
|
1365
|
+
renderer: ee(r, {
|
|
1366
|
+
previewing: !0
|
|
1367
|
+
})
|
|
1368
|
+
})).filter(({
|
|
1369
|
+
options: r
|
|
1370
|
+
}) => !e.exclude?.includes(r.key)).filter(({
|
|
1371
|
+
renderer: r
|
|
1372
|
+
}) => !r?.disableViewMode);
|
|
1373
|
+
function o() {
|
|
1374
|
+
if (t) {
|
|
1375
|
+
const r = t.proxy?.$el;
|
|
1376
|
+
n.value = Math.floor(r.offsetWidth / e.minWidth);
|
|
1377
|
+
}
|
|
1347
1378
|
}
|
|
1348
|
-
return () =>
|
|
1349
|
-
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1379
|
+
return E(() => {
|
|
1380
|
+
o();
|
|
1381
|
+
}), () => {
|
|
1382
|
+
let r;
|
|
1383
|
+
return u("div", {
|
|
1384
|
+
class: "preview-container"
|
|
1385
|
+
}, [u(Qe, {
|
|
1386
|
+
column: n.value,
|
|
1387
|
+
bordered: !0,
|
|
1388
|
+
align: "left",
|
|
1389
|
+
layout: e.layout
|
|
1390
|
+
}, vn(r = i.map((a) => u(Xe, {
|
|
1391
|
+
label: a.options.title
|
|
1392
|
+
}, {
|
|
1393
|
+
default: () => [a.renderer?.render ? a.renderer?.render({
|
|
1394
|
+
record: e.record
|
|
1395
|
+
}) : $(e.record, a.options)]
|
|
1396
|
+
}))) ? r : {
|
|
1397
|
+
default: () => [r]
|
|
1398
|
+
})]);
|
|
1399
|
+
};
|
|
1356
1400
|
}
|
|
1357
|
-
}),
|
|
1401
|
+
}), xn = /* @__PURE__ */ F({
|
|
1358
1402
|
props: {
|
|
1359
1403
|
// 数据主键
|
|
1360
1404
|
rowKey: {
|
|
@@ -1503,24 +1547,24 @@ const cr = /* @__PURE__ */ B({
|
|
|
1503
1547
|
},
|
|
1504
1548
|
expose: ["preview", "export", "edit", "reload", "tableSource", "formSource", "update:radio-key", "update:radio-row", "update:checkbox-keys", "update:checkbox-rows", "formInstance", "resetSelection", "reloadSelection", "reloadColumns", "change"],
|
|
1505
1549
|
setup(e, t) {
|
|
1506
|
-
const
|
|
1507
|
-
key:
|
|
1508
|
-
title:
|
|
1509
|
-
collapsed: !!
|
|
1550
|
+
const n = Math.random().toString(32).slice(2).toUpperCase(), i = k(), o = k(), r = k(), a = k(), [l, c] = st(e.columns), s = k(!1), m = e.form ?? at(e.columns), f = y(), v = j(), d = k(e.columns.map((h) => ({
|
|
1551
|
+
key: h.key,
|
|
1552
|
+
title: h.title,
|
|
1553
|
+
collapsed: !!h.collapsed
|
|
1510
1554
|
})));
|
|
1511
|
-
function
|
|
1555
|
+
function y() {
|
|
1512
1556
|
switch (!0) {
|
|
1513
1557
|
case (typeof e.pageable == "string" && e.pageable === "server"):
|
|
1514
|
-
return new
|
|
1558
|
+
return new K();
|
|
1515
1559
|
case (typeof e.pageable == "boolean" && e.pageable === !0):
|
|
1516
|
-
return new
|
|
1560
|
+
return new K();
|
|
1517
1561
|
case (typeof e.pageable == "object" && !!e.pageable.reset):
|
|
1518
1562
|
return e.pageable;
|
|
1519
1563
|
case (typeof e.pageable == "object" && (!!e.pageable.index || !!e.pageable.size)):
|
|
1520
|
-
return new
|
|
1564
|
+
return new K(e.pageable.index, e.pageable.size);
|
|
1521
1565
|
}
|
|
1522
1566
|
}
|
|
1523
|
-
const
|
|
1567
|
+
const w = (() => {
|
|
1524
1568
|
switch (!0) {
|
|
1525
1569
|
case typeof e.pageable == "string":
|
|
1526
1570
|
return e.pageable;
|
|
@@ -1531,215 +1575,206 @@ const cr = /* @__PURE__ */ B({
|
|
|
1531
1575
|
}
|
|
1532
1576
|
})();
|
|
1533
1577
|
function j() {
|
|
1534
|
-
const
|
|
1535
|
-
if (
|
|
1536
|
-
return new
|
|
1578
|
+
const h = e.columns.find((b) => !!b.sortable);
|
|
1579
|
+
if (h || e.sortable)
|
|
1580
|
+
return new te({
|
|
1537
1581
|
...e.sortable || {},
|
|
1538
|
-
...
|
|
1539
|
-
[
|
|
1582
|
+
...h ? {
|
|
1583
|
+
[h.key]: h.sortable
|
|
1540
1584
|
} : {}
|
|
1541
1585
|
});
|
|
1542
1586
|
}
|
|
1543
|
-
function
|
|
1587
|
+
function x(h) {
|
|
1544
1588
|
const {
|
|
1545
1589
|
exportExcel: b
|
|
1546
|
-
} =
|
|
1547
|
-
b(
|
|
1590
|
+
} = cn();
|
|
1591
|
+
b(h?.columns || e.columns, h?.source || l.value, h?.filename || (typeof e.exportable == "object" ? e.exportable.filename : void 0));
|
|
1548
1592
|
}
|
|
1549
|
-
function
|
|
1593
|
+
function p(h) {
|
|
1550
1594
|
let b;
|
|
1551
1595
|
switch (!0) {
|
|
1552
|
-
case !!
|
|
1553
|
-
b =
|
|
1596
|
+
case !!h?.key:
|
|
1597
|
+
b = l.value.find((O) => O[e.rowKey] === h?.key);
|
|
1554
1598
|
break;
|
|
1555
|
-
case !!
|
|
1556
|
-
b =
|
|
1599
|
+
case !!h?.record:
|
|
1600
|
+
b = h?.record;
|
|
1557
1601
|
break;
|
|
1558
1602
|
}
|
|
1559
1603
|
if (!b)
|
|
1560
1604
|
throw new Error("未找到需要预览的数据");
|
|
1561
|
-
return
|
|
1605
|
+
return r.value.open(wn, {
|
|
1562
1606
|
record: b,
|
|
1563
1607
|
columns: e.columns
|
|
1564
1608
|
}, {
|
|
1565
|
-
title:
|
|
1566
|
-
mode:
|
|
1609
|
+
title: h?.title || "详情",
|
|
1610
|
+
mode: h?.mode || "dialog"
|
|
1567
1611
|
});
|
|
1568
1612
|
}
|
|
1569
|
-
function
|
|
1613
|
+
function g(h) {
|
|
1570
1614
|
let b;
|
|
1571
1615
|
switch (!0) {
|
|
1572
|
-
case !!
|
|
1573
|
-
b =
|
|
1616
|
+
case !!h?.key:
|
|
1617
|
+
b = l.value.find((O) => O[e.rowKey] === h?.key);
|
|
1574
1618
|
break;
|
|
1575
|
-
case !!
|
|
1576
|
-
b =
|
|
1619
|
+
case !!h?.record:
|
|
1620
|
+
b = h?.record;
|
|
1577
1621
|
break;
|
|
1578
1622
|
}
|
|
1579
1623
|
if (!b)
|
|
1580
1624
|
throw new Error("未找到需要编辑的数据");
|
|
1581
|
-
return
|
|
1625
|
+
return r.value.open(yn, {
|
|
1582
1626
|
value: b,
|
|
1583
|
-
form:
|
|
1584
|
-
onSubmit:
|
|
1627
|
+
form: h?.form,
|
|
1628
|
+
onSubmit: h.onSubmit
|
|
1585
1629
|
}, {
|
|
1586
|
-
title:
|
|
1587
|
-
mode:
|
|
1630
|
+
title: h?.title || "编辑",
|
|
1631
|
+
mode: h?.mode || "dialog",
|
|
1588
1632
|
footer: !0,
|
|
1589
1633
|
form: "form"
|
|
1590
1634
|
});
|
|
1591
1635
|
}
|
|
1592
|
-
function
|
|
1593
|
-
var p, ee;
|
|
1636
|
+
function C(h) {
|
|
1594
1637
|
if (!e.dataLoad)
|
|
1595
|
-
return Promise.reject();
|
|
1596
|
-
|
|
1638
|
+
return Promise.reject(new Error("dataLoad is required"));
|
|
1639
|
+
h?.reset && (f && f.reset(), v && v.reset(), i.value?.resetSorters());
|
|
1597
1640
|
const b = {
|
|
1598
|
-
...
|
|
1641
|
+
...o.value?.formSource || {}
|
|
1599
1642
|
};
|
|
1600
|
-
Object.keys(b).forEach((
|
|
1601
|
-
[null, void 0, ""].includes(b[
|
|
1643
|
+
Object.keys(b).forEach((ie) => {
|
|
1644
|
+
[null, void 0, ""].includes(b[ie]) && delete b[ie];
|
|
1602
1645
|
});
|
|
1603
|
-
const
|
|
1646
|
+
const O = e.dataLoad({
|
|
1604
1647
|
form: b,
|
|
1605
|
-
page:
|
|
1606
|
-
sort:
|
|
1607
|
-
update:
|
|
1648
|
+
page: f,
|
|
1649
|
+
sort: v,
|
|
1650
|
+
update: c
|
|
1608
1651
|
});
|
|
1609
|
-
return
|
|
1610
|
-
|
|
1611
|
-
}),
|
|
1652
|
+
return B(O) ? (s.value = !0, Promise.resolve(O).finally(() => {
|
|
1653
|
+
s.value = !1;
|
|
1654
|
+
}), O) : Promise.resolve();
|
|
1612
1655
|
}
|
|
1613
|
-
function
|
|
1614
|
-
|
|
1615
|
-
collapsedColumns:
|
|
1656
|
+
function we() {
|
|
1657
|
+
r.value.open(hn, {
|
|
1658
|
+
collapsedColumns: d.value
|
|
1616
1659
|
}, {
|
|
1617
1660
|
title: "显示列",
|
|
1618
1661
|
size: "small",
|
|
1619
1662
|
footer: !0
|
|
1620
|
-
}).then((
|
|
1621
|
-
|
|
1663
|
+
}).then((h) => {
|
|
1664
|
+
d.value = h;
|
|
1622
1665
|
});
|
|
1623
1666
|
}
|
|
1624
|
-
const
|
|
1667
|
+
const xe = (h, {
|
|
1625
1668
|
type: b
|
|
1626
1669
|
}) => {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
reload: M,
|
|
1635
|
-
preview: y,
|
|
1636
|
-
export: v,
|
|
1637
|
-
edit: C,
|
|
1638
|
-
collapse: ye
|
|
1670
|
+
b === "drag" && (c(h), t.emit("change", h));
|
|
1671
|
+
}, L = ot({
|
|
1672
|
+
reload: C,
|
|
1673
|
+
preview: p,
|
|
1674
|
+
export: x,
|
|
1675
|
+
edit: g,
|
|
1676
|
+
collapse: we
|
|
1639
1677
|
});
|
|
1640
|
-
function
|
|
1641
|
-
!
|
|
1678
|
+
function Ce(h, b) {
|
|
1679
|
+
!v || w === "client" || (b ? v.update(h, b === "descend" ? "desc" : "asc") : v.remove(h), L("reload"));
|
|
1642
1680
|
}
|
|
1643
|
-
const
|
|
1681
|
+
const ne = k(me({
|
|
1644
1682
|
columns: e.columns,
|
|
1645
1683
|
columnsOptions: e.columnsOptions,
|
|
1646
1684
|
columnsGroups: e.columnsGroups,
|
|
1647
|
-
pageMode:
|
|
1648
|
-
collapsedColumns:
|
|
1649
|
-
events:
|
|
1650
|
-
})),
|
|
1651
|
-
tableEvents:
|
|
1652
|
-
tableForm:
|
|
1653
|
-
tableSource:
|
|
1654
|
-
formInstance:
|
|
1655
|
-
pageService:
|
|
1685
|
+
pageMode: w,
|
|
1686
|
+
collapsedColumns: d,
|
|
1687
|
+
events: L
|
|
1688
|
+
})), Y = {
|
|
1689
|
+
tableEvents: L,
|
|
1690
|
+
tableForm: m,
|
|
1691
|
+
tableSource: l,
|
|
1692
|
+
formInstance: o,
|
|
1693
|
+
pageService: f,
|
|
1656
1694
|
formOptions: e.formOptions
|
|
1657
|
-
},
|
|
1658
|
-
selectedRowKeys:
|
|
1659
|
-
rowSelection:
|
|
1660
|
-
onSelect:
|
|
1661
|
-
onSelectAll:
|
|
1662
|
-
reloadSelection:
|
|
1663
|
-
resetSelection:
|
|
1664
|
-
} =
|
|
1695
|
+
}, ke = pn(e, t, Y), Se = mn(e, t, Y), Me = bn(e, t, Y), {
|
|
1696
|
+
selectedRowKeys: re,
|
|
1697
|
+
rowSelection: oe,
|
|
1698
|
+
onSelect: Te,
|
|
1699
|
+
onSelectAll: $e,
|
|
1700
|
+
reloadSelection: _e,
|
|
1701
|
+
resetSelection: Oe
|
|
1702
|
+
} = gn(e, t, Y), je = _(() => ({
|
|
1665
1703
|
rowKey: e.rowKey,
|
|
1666
1704
|
size: e.size,
|
|
1667
1705
|
bordered: e.bordered,
|
|
1668
1706
|
hoverable: e.hoverable,
|
|
1669
1707
|
stripe: e.stripe,
|
|
1670
1708
|
scroll: {
|
|
1671
|
-
x: e.columns.reduce((
|
|
1709
|
+
x: e.columns.reduce((h, b) => h += typeof b.width != "number" ? Math.max(b.title.length * 16, 80) : b.width, 0),
|
|
1672
1710
|
y: e.height ?? "100%"
|
|
1673
1711
|
},
|
|
1674
|
-
rowSelection:
|
|
1712
|
+
rowSelection: oe,
|
|
1675
1713
|
draggable: e.draggable ? {
|
|
1676
1714
|
type: "handle",
|
|
1677
1715
|
width: 40
|
|
1678
1716
|
} : void 0,
|
|
1679
1717
|
pagination: e.pageable === void 0 || e.pageable === "client",
|
|
1680
|
-
selectedKeys:
|
|
1718
|
+
selectedKeys: re.value,
|
|
1681
1719
|
expandable: e.expandable,
|
|
1682
1720
|
virtualListProps: e.virtualList ? {
|
|
1683
1721
|
height: e.height
|
|
1684
1722
|
} : void 0
|
|
1685
1723
|
}));
|
|
1686
|
-
function
|
|
1687
|
-
|
|
1724
|
+
function Le() {
|
|
1725
|
+
ne.value = me({
|
|
1688
1726
|
columns: e.columns,
|
|
1689
1727
|
columnsOptions: e.columnsOptions,
|
|
1690
1728
|
columnsGroups: e.columnsGroups,
|
|
1691
|
-
pageMode:
|
|
1692
|
-
collapsedColumns:
|
|
1693
|
-
events:
|
|
1729
|
+
pageMode: w,
|
|
1730
|
+
collapsedColumns: d,
|
|
1731
|
+
events: L
|
|
1694
1732
|
});
|
|
1695
1733
|
}
|
|
1696
|
-
return
|
|
1697
|
-
|
|
1734
|
+
return E(() => {
|
|
1735
|
+
a.value && (a.value.id = `table-${n}`), e.autoLoad && C(), e.grabbable && a.value && fn(a.value);
|
|
1698
1736
|
}), {
|
|
1699
|
-
tableId:
|
|
1700
|
-
tableInstance:
|
|
1701
|
-
tableSource:
|
|
1702
|
-
tableOptions:
|
|
1703
|
-
tableColumns:
|
|
1704
|
-
tableEvents:
|
|
1705
|
-
tableForm:
|
|
1706
|
-
tableLoading:
|
|
1707
|
-
modalInstance:
|
|
1708
|
-
tableRenderElement:
|
|
1709
|
-
formSource:
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
export: v,
|
|
1718
|
-
onSorterChange: ge,
|
|
1719
|
-
onTableChange: be,
|
|
1737
|
+
tableId: n,
|
|
1738
|
+
tableInstance: i,
|
|
1739
|
+
tableSource: l,
|
|
1740
|
+
tableOptions: je,
|
|
1741
|
+
tableColumns: ne,
|
|
1742
|
+
tableEvents: L,
|
|
1743
|
+
tableForm: m,
|
|
1744
|
+
tableLoading: s,
|
|
1745
|
+
modalInstance: r,
|
|
1746
|
+
tableRenderElement: a,
|
|
1747
|
+
formSource: U(_(() => o?.value?.formSource)),
|
|
1748
|
+
formInstance: o,
|
|
1749
|
+
reload: C,
|
|
1750
|
+
preview: p,
|
|
1751
|
+
edit: g,
|
|
1752
|
+
export: x,
|
|
1753
|
+
onSorterChange: Ce,
|
|
1754
|
+
onTableChange: xe,
|
|
1720
1755
|
renders: {
|
|
1721
|
-
renderTableForm:
|
|
1722
|
-
renderTableActions:
|
|
1723
|
-
renderTablePagination:
|
|
1756
|
+
renderTableForm: ke,
|
|
1757
|
+
renderTableActions: Se,
|
|
1758
|
+
renderTablePagination: Me
|
|
1724
1759
|
},
|
|
1725
1760
|
tableSelection: {
|
|
1726
|
-
selectedRowKeys:
|
|
1727
|
-
rowSelection:
|
|
1728
|
-
onSelect:
|
|
1729
|
-
onSelectAll:
|
|
1761
|
+
selectedRowKeys: re,
|
|
1762
|
+
rowSelection: oe,
|
|
1763
|
+
onSelect: Te,
|
|
1764
|
+
onSelectAll: $e
|
|
1730
1765
|
},
|
|
1731
|
-
resetSelection:
|
|
1732
|
-
reloadSelection:
|
|
1733
|
-
reloadColumns:
|
|
1766
|
+
resetSelection: Oe,
|
|
1767
|
+
reloadSelection: _e,
|
|
1768
|
+
reloadColumns: Le
|
|
1734
1769
|
};
|
|
1735
1770
|
},
|
|
1736
1771
|
render() {
|
|
1737
1772
|
this.reloadColumns();
|
|
1738
|
-
const e = () =>
|
|
1773
|
+
const e = () => u("div", {
|
|
1739
1774
|
class: "table-body"
|
|
1740
|
-
}, [
|
|
1775
|
+
}, [u("div", {
|
|
1741
1776
|
class: "table-body-wrapper"
|
|
1742
|
-
}, [
|
|
1777
|
+
}, [u(et, pe({
|
|
1743
1778
|
loading: this.tableLoading,
|
|
1744
1779
|
data: this.tableSource,
|
|
1745
1780
|
columns: this.tableColumns,
|
|
@@ -1752,38 +1787,31 @@ const cr = /* @__PURE__ */ B({
|
|
|
1752
1787
|
selectedKeys: this.tableSelection.selectedRowKeys.value,
|
|
1753
1788
|
"onUpdate:selectedKeys": (t) => this.tableSelection.selectedRowKeys.value = t
|
|
1754
1789
|
}, this.tableOptions), null)])]);
|
|
1755
|
-
return
|
|
1790
|
+
return u("div", {
|
|
1756
1791
|
class: {
|
|
1757
1792
|
"table-render": !0,
|
|
1758
1793
|
"auto-fill": this.autoFill
|
|
1759
1794
|
},
|
|
1760
1795
|
ref: (t) => this.tableRenderElement = t
|
|
1761
|
-
}, [
|
|
1796
|
+
}, [u(nt, {
|
|
1762
1797
|
ref: (t) => this.modalInstance = t
|
|
1763
1798
|
}, {
|
|
1764
|
-
default: () => [
|
|
1799
|
+
default: () => [u("div", {
|
|
1765
1800
|
class: "table-render-content"
|
|
1766
1801
|
}, [this.renders.renderTableForm(), this.renders.renderTableActions(), this.$slots.header && this.$slots.header(), ["all", "top"].includes(this.$props.pagePosition) && this.renders.renderTablePagination(), e(), ["all", "bottom"].includes(this.$props.pagePosition) && this.renders.renderTablePagination()])]
|
|
1767
1802
|
})]);
|
|
1768
1803
|
}
|
|
1769
|
-
})
|
|
1770
|
-
function wr(e) {
|
|
1771
|
-
return e;
|
|
1772
|
-
}
|
|
1773
|
-
function vr(e) {
|
|
1774
|
-
return e;
|
|
1775
|
-
}
|
|
1776
|
-
const Cr = {
|
|
1804
|
+
}), jn = {
|
|
1777
1805
|
install(e, t) {
|
|
1778
|
-
e.component("TableRender",
|
|
1806
|
+
e.component("TableRender", xn);
|
|
1779
1807
|
}
|
|
1780
1808
|
};
|
|
1781
1809
|
export {
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1810
|
+
xn as TableRender,
|
|
1811
|
+
Pn as TableRenderResolver,
|
|
1812
|
+
jn as default,
|
|
1813
|
+
$n as defineColumns,
|
|
1814
|
+
_n as defineTableLoad,
|
|
1815
|
+
ot as useEvents,
|
|
1816
|
+
On as useTable
|
|
1789
1817
|
};
|