@gopowerteam/table-render 0.0.175 → 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 +1126 -1099
- 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,690 +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 = b([]), r = (a) => {
|
|
17
|
-
const n = e.filter((l) => l.formatter);
|
|
18
|
-
return n.length > 0 ? a.map((l) => (n.forEach((i) => {
|
|
19
|
-
i.formatter && pe(l, i, i.formatter(l));
|
|
20
|
-
}), l)) : a;
|
|
21
|
-
};
|
|
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`,
|
|
344
289
|
margin: "auto"
|
|
345
290
|
}
|
|
346
|
-
}, [
|
|
347
|
-
preview: e
|
|
291
|
+
}, [u(Ne, {
|
|
292
|
+
preview: e?.preview,
|
|
348
293
|
width: "100%",
|
|
349
294
|
height: "100%",
|
|
350
295
|
fit: "contain",
|
|
351
|
-
src:
|
|
296
|
+
src: c,
|
|
352
297
|
alt: "image",
|
|
353
|
-
style:
|
|
354
|
-
}, null)]) :
|
|
298
|
+
style: a
|
|
299
|
+
}, null)]) : u(G, null, null);
|
|
355
300
|
}
|
|
356
301
|
});
|
|
357
302
|
}
|
|
358
|
-
function
|
|
359
|
-
return
|
|
303
|
+
function kt(e, t) {
|
|
304
|
+
return he() ? (Ee(e, t), !0) : !1;
|
|
360
305
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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";
|
|
365
312
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
function kt(e) {
|
|
313
|
+
const Mt = Object.prototype.toString, Tt = (e) => Mt.call(e) === "[object Object]";
|
|
314
|
+
function $t(e) {
|
|
369
315
|
let t;
|
|
370
|
-
function
|
|
316
|
+
function n() {
|
|
371
317
|
return t || (t = e()), t;
|
|
372
318
|
}
|
|
373
|
-
return
|
|
374
|
-
const
|
|
375
|
-
t = void 0,
|
|
376
|
-
},
|
|
319
|
+
return n.reset = async () => {
|
|
320
|
+
const i = t;
|
|
321
|
+
t = void 0, i && await i;
|
|
322
|
+
}, n;
|
|
377
323
|
}
|
|
378
|
-
function
|
|
379
|
-
var
|
|
380
|
-
if (typeof e == "number")
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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);
|
|
384
341
|
}
|
|
385
|
-
function
|
|
342
|
+
function Lt(e, t, n = {}) {
|
|
386
343
|
const {
|
|
387
|
-
immediate:
|
|
388
|
-
|
|
389
|
-
|
|
344
|
+
immediate: i = !0,
|
|
345
|
+
immediateCallback: o = !1
|
|
346
|
+
} = n, r = M(!1);
|
|
347
|
+
let a;
|
|
390
348
|
function l() {
|
|
391
|
-
|
|
349
|
+
a && (clearTimeout(a), a = void 0);
|
|
392
350
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
351
|
+
function c() {
|
|
352
|
+
r.value = !1, l();
|
|
395
353
|
}
|
|
396
|
-
function
|
|
397
|
-
l(),
|
|
398
|
-
|
|
399
|
-
},
|
|
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));
|
|
400
358
|
}
|
|
401
|
-
return
|
|
402
|
-
isPending:
|
|
403
|
-
start:
|
|
404
|
-
stop:
|
|
359
|
+
return i && (r.value = !0, Z && s()), kt(c), {
|
|
360
|
+
isPending: qe(r),
|
|
361
|
+
start: s,
|
|
362
|
+
stop: c
|
|
405
363
|
};
|
|
406
364
|
}
|
|
407
|
-
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) {
|
|
408
373
|
var t;
|
|
409
|
-
const
|
|
410
|
-
return (t =
|
|
411
|
-
}
|
|
412
|
-
const N = W ? window : void 0, me = W ? window.navigator : void 0;
|
|
413
|
-
function he(...e) {
|
|
414
|
-
let t, r, u, a;
|
|
415
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, u, a] = e, t = N) : [t, r, u, a] = e, !t)
|
|
416
|
-
return Ct;
|
|
417
|
-
Array.isArray(r) || (r = [r]), Array.isArray(u) || (u = [u]);
|
|
418
|
-
const n = [], l = () => {
|
|
419
|
-
n.forEach((s) => s()), n.length = 0;
|
|
420
|
-
}, i = (s, m, h, w) => (s.addEventListener(m, h, w), () => s.removeEventListener(m, h, w)), o = Ee(
|
|
421
|
-
() => [Mt(t), O(a)],
|
|
422
|
-
([s, m]) => {
|
|
423
|
-
if (l(), !s)
|
|
424
|
-
return;
|
|
425
|
-
const h = vt(m) ? { ...m } : m;
|
|
426
|
-
n.push(
|
|
427
|
-
...r.flatMap((w) => u.map((S) => i(s, w, S, h)))
|
|
428
|
-
);
|
|
429
|
-
},
|
|
430
|
-
{ immediate: !0, flush: "post" }
|
|
431
|
-
), d = () => {
|
|
432
|
-
o(), l();
|
|
433
|
-
};
|
|
434
|
-
return K(d), d;
|
|
374
|
+
const n = T(e);
|
|
375
|
+
return (t = n?.$el) !== null && t !== void 0 ? t : n;
|
|
435
376
|
}
|
|
436
|
-
function
|
|
437
|
-
const
|
|
438
|
-
|
|
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(() => {
|
|
439
401
|
e.value = !0;
|
|
440
402
|
}, t), e;
|
|
441
403
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
404
|
+
// @__NO_SIDE_EFFECTS__
|
|
405
|
+
function X(e) {
|
|
406
|
+
const t = /* @__PURE__ */ qt();
|
|
407
|
+
return _(() => (t.value, !!e()));
|
|
445
408
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
}, i = () => {
|
|
452
|
-
a && ("removeEventListener" in a ? a.removeEventListener("change", l) : a.removeListener(l));
|
|
453
|
-
}, o = ze(() => {
|
|
454
|
-
u.value && (i(), a = r.matchMedia(O(e)), "addEventListener" in a ? a.addEventListener("change", l) : a.addListener(l), n.value = a.matches);
|
|
455
|
-
});
|
|
456
|
-
return K(() => {
|
|
457
|
-
o(), i(), a = void 0;
|
|
458
|
-
}), 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;
|
|
459
414
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
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;
|
|
464
441
|
}
|
|
465
|
-
const {
|
|
466
|
-
|
|
467
|
-
|
|
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;
|
|
468
452
|
}
|
|
469
|
-
const
|
|
470
|
-
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),
|
|
471
455
|
enumerable: !0,
|
|
472
456
|
configurable: !0
|
|
473
|
-
}),
|
|
474
|
-
function
|
|
475
|
-
const
|
|
476
|
-
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));
|
|
477
461
|
}
|
|
478
|
-
return Object.assign(
|
|
479
|
-
greaterOrEqual:
|
|
480
|
-
smallerOrEqual:
|
|
481
|
-
greater(
|
|
482
|
-
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);
|
|
483
467
|
},
|
|
484
|
-
smaller(
|
|
485
|
-
return
|
|
468
|
+
smaller(d) {
|
|
469
|
+
return R(() => `(max-width: ${n(d, -0.1)})`, t);
|
|
486
470
|
},
|
|
487
|
-
between(
|
|
488
|
-
return
|
|
471
|
+
between(d, y) {
|
|
472
|
+
return R(() => `(min-width: ${n(d)}) and (max-width: ${n(y, -0.1)})`, t);
|
|
489
473
|
},
|
|
490
|
-
isGreater(
|
|
491
|
-
return
|
|
474
|
+
isGreater(d) {
|
|
475
|
+
return c("min", n(d, 0.1));
|
|
492
476
|
},
|
|
493
|
-
isGreaterOrEqual(
|
|
494
|
-
return
|
|
477
|
+
isGreaterOrEqual(d) {
|
|
478
|
+
return c("min", n(d));
|
|
495
479
|
},
|
|
496
|
-
isSmaller(
|
|
497
|
-
return
|
|
480
|
+
isSmaller(d) {
|
|
481
|
+
return c("max", n(d, -0.1));
|
|
498
482
|
},
|
|
499
|
-
isSmallerOrEqual(
|
|
500
|
-
return
|
|
483
|
+
isSmallerOrEqual(d) {
|
|
484
|
+
return c("max", n(d));
|
|
501
485
|
},
|
|
502
|
-
isInBetween(
|
|
503
|
-
return
|
|
486
|
+
isInBetween(d, y) {
|
|
487
|
+
return c("min", n(d)) && c("max", n(y, -0.1));
|
|
504
488
|
},
|
|
505
|
-
current:
|
|
489
|
+
current: v,
|
|
506
490
|
active() {
|
|
507
|
-
const
|
|
508
|
-
return
|
|
491
|
+
const d = v();
|
|
492
|
+
return _(() => d.value.length === 0 ? "" : d.value.at(o === "min-width" ? -1 : 0));
|
|
509
493
|
}
|
|
510
494
|
});
|
|
511
495
|
}
|
|
512
|
-
|
|
496
|
+
// @__NO_SIDE_EFFECTS__
|
|
497
|
+
function ce(e, t = {}) {
|
|
513
498
|
const {
|
|
514
|
-
controls:
|
|
515
|
-
navigator:
|
|
516
|
-
} = t,
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
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);
|
|
529
520
|
}
|
|
530
521
|
});
|
|
531
|
-
return
|
|
532
|
-
state:
|
|
533
|
-
isSupported:
|
|
534
|
-
query:
|
|
535
|
-
} :
|
|
522
|
+
return s(), n ? {
|
|
523
|
+
state: l,
|
|
524
|
+
isSupported: o,
|
|
525
|
+
query: s
|
|
526
|
+
} : l;
|
|
536
527
|
}
|
|
537
|
-
function
|
|
528
|
+
function Yt(e = {}) {
|
|
538
529
|
const {
|
|
539
|
-
navigator: t =
|
|
540
|
-
read:
|
|
541
|
-
source:
|
|
542
|
-
copiedDuring:
|
|
543
|
-
legacy:
|
|
544
|
-
} = e,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
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());
|
|
549
546
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
+
}
|
|
553
560
|
}
|
|
554
|
-
function
|
|
555
|
-
const
|
|
556
|
-
|
|
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();
|
|
557
564
|
}
|
|
558
565
|
function j() {
|
|
559
|
-
var
|
|
560
|
-
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 : "";
|
|
561
568
|
}
|
|
562
|
-
function
|
|
563
|
-
return
|
|
569
|
+
function x(p) {
|
|
570
|
+
return p === "granted" || p === "prompt";
|
|
564
571
|
}
|
|
565
572
|
return {
|
|
566
|
-
isSupported:
|
|
567
|
-
text:
|
|
568
|
-
copied:
|
|
569
|
-
copy:
|
|
573
|
+
isSupported: s,
|
|
574
|
+
text: U(m),
|
|
575
|
+
copied: U(f),
|
|
576
|
+
copy: y
|
|
570
577
|
};
|
|
571
578
|
}
|
|
572
|
-
const
|
|
573
|
-
function
|
|
574
|
-
return e
|
|
579
|
+
const At = " ";
|
|
580
|
+
function Dt(e) {
|
|
581
|
+
return e?.replace(/(\d{3})\d*(\d{4})/g, "$1****$2");
|
|
575
582
|
}
|
|
576
|
-
function
|
|
577
|
-
return e
|
|
583
|
+
function de(e, t) {
|
|
584
|
+
return e?.replace(/\*/g, "M").replace(/\B(?=(?:\S{4})+$)/g, t ?? At).replace(/M/g, "*");
|
|
578
585
|
}
|
|
579
|
-
function
|
|
580
|
-
const t =
|
|
581
|
-
return
|
|
582
|
-
const
|
|
583
|
-
function
|
|
584
|
-
window.focus(), t.copy(
|
|
585
|
-
|
|
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({
|
|
586
593
|
content: "复制成功",
|
|
587
594
|
duration: 1e3
|
|
588
595
|
});
|
|
589
596
|
});
|
|
590
597
|
}
|
|
591
|
-
function
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
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("****"))
|
|
596
603
|
return;
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
!
|
|
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>`);
|
|
600
607
|
});
|
|
601
608
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
|
|
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>`);
|
|
605
612
|
}
|
|
606
|
-
function
|
|
607
|
-
const
|
|
608
|
-
|
|
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);
|
|
609
616
|
}
|
|
610
617
|
function j() {
|
|
611
|
-
e
|
|
618
|
+
e?.onDial ? e.onDial(l) : window.open(`tel:${l}`, "_blank");
|
|
612
619
|
}
|
|
613
|
-
return
|
|
614
|
-
id:
|
|
620
|
+
return u("div", {
|
|
621
|
+
id: r,
|
|
615
622
|
style: "display:flex;align-items:center;gap:4px;"
|
|
616
|
-
}, [
|
|
617
|
-
"data-encrypt":
|
|
618
|
-
class: `${
|
|
623
|
+
}, [u("div", {
|
|
624
|
+
"data-encrypt": m,
|
|
625
|
+
class: `${a} content`,
|
|
619
626
|
style: "use-select:none;font-family: monospace;cursor:pointer;font-variant-numeric: tabular-nums;padding-right: 2px;"
|
|
620
|
-
}, [e
|
|
627
|
+
}, [e?.safe ? m : f]), e?.safe && e?.allowPreview && u("i", {
|
|
621
628
|
class: "preview-icon",
|
|
622
629
|
title: "显示完整号码",
|
|
623
|
-
style:
|
|
624
|
-
onClick:
|
|
625
|
-
}, [
|
|
626
|
-
width:
|
|
627
|
-
height:
|
|
630
|
+
style: s,
|
|
631
|
+
onClick: w
|
|
632
|
+
}, [u("svg", {
|
|
633
|
+
width: c,
|
|
634
|
+
height: c,
|
|
628
635
|
viewBox: "0 0 48 48",
|
|
629
636
|
fill: "none",
|
|
630
637
|
xmlns: "http://www.w3.org/2000/svg"
|
|
631
|
-
}, [
|
|
638
|
+
}, [u("path", {
|
|
632
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",
|
|
633
640
|
fill: "none",
|
|
634
641
|
stroke: "#333",
|
|
635
642
|
"stroke-width": "2",
|
|
636
643
|
"stroke-linejoin": "round"
|
|
637
|
-
}, null),
|
|
644
|
+
}, null), u("path", {
|
|
638
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",
|
|
639
646
|
fill: "none",
|
|
640
647
|
stroke: "#333",
|
|
641
648
|
"stroke-width": "4",
|
|
642
649
|
"stroke-linejoin": "round"
|
|
643
|
-
}, null)])]),
|
|
644
|
-
style:
|
|
650
|
+
}, null)])]), e?.allowDial && u("i", {
|
|
651
|
+
style: s,
|
|
645
652
|
title: "拨出号码",
|
|
646
653
|
onClick: j
|
|
647
|
-
}, [
|
|
648
|
-
width:
|
|
649
|
-
height:
|
|
654
|
+
}, [u("svg", {
|
|
655
|
+
width: c,
|
|
656
|
+
height: c,
|
|
650
657
|
viewBox: "0 0 48 48",
|
|
651
658
|
fill: "none",
|
|
652
659
|
xmlns: "http://www.w3.org/2000/svg"
|
|
653
|
-
}, [
|
|
660
|
+
}, [u("path", {
|
|
654
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",
|
|
655
662
|
stroke: "#333",
|
|
656
663
|
"stroke-width": "2",
|
|
657
664
|
"stroke-linecap": "round",
|
|
658
665
|
"stroke-linejoin": "round"
|
|
659
|
-
}, null),
|
|
666
|
+
}, null), u("path", {
|
|
660
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",
|
|
661
668
|
stroke: "#333",
|
|
662
669
|
"stroke-width": "4",
|
|
663
670
|
"stroke-linecap": "round",
|
|
664
671
|
"stroke-linejoin": "round"
|
|
665
|
-
}, null),
|
|
672
|
+
}, null), u("path", {
|
|
666
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",
|
|
667
674
|
fill: "none",
|
|
668
675
|
stroke: "#333",
|
|
669
676
|
"stroke-width": "4",
|
|
670
677
|
"stroke-linejoin": "round"
|
|
671
|
-
}, null)])]),
|
|
672
|
-
style:
|
|
678
|
+
}, null)])]), e?.allowCopy && u("i", {
|
|
679
|
+
style: s,
|
|
673
680
|
title: "复制号码",
|
|
674
|
-
onClick:
|
|
675
|
-
}, [
|
|
676
|
-
width:
|
|
677
|
-
height:
|
|
681
|
+
onClick: v
|
|
682
|
+
}, [u("svg", {
|
|
683
|
+
width: c,
|
|
684
|
+
height: c,
|
|
678
685
|
viewBox: "0 0 48 48",
|
|
679
686
|
fill: "none",
|
|
680
687
|
xmlns: "http://www.w3.org/2000/svg"
|
|
681
|
-
}, [
|
|
688
|
+
}, [u("path", {
|
|
682
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",
|
|
683
690
|
stroke: "#333",
|
|
684
691
|
"stroke-width": "2",
|
|
685
692
|
"stroke-linecap": "round",
|
|
686
693
|
"stroke-linejoin": "round"
|
|
687
|
-
}, null),
|
|
694
|
+
}, null), u("path", {
|
|
688
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",
|
|
689
696
|
fill: "none",
|
|
690
697
|
stroke: "#333",
|
|
@@ -693,183 +700,178 @@ function jt(e) {
|
|
|
693
700
|
}, null)])])]);
|
|
694
701
|
});
|
|
695
702
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
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
|
+
});
|
|
698
715
|
}
|
|
699
|
-
function
|
|
700
|
-
return
|
|
701
|
-
|
|
702
|
-
|
|
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", {
|
|
703
737
|
style: {
|
|
704
738
|
display: "flex",
|
|
705
739
|
flexWrap: "wrap"
|
|
706
740
|
}
|
|
707
|
-
}, [
|
|
708
|
-
const
|
|
709
|
-
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", {
|
|
710
744
|
style: {
|
|
711
|
-
minWidth:
|
|
745
|
+
minWidth: s ? `${s}px` : "unset",
|
|
712
746
|
textAlign: "center",
|
|
713
747
|
margin: "2px",
|
|
714
748
|
padding: "2px 5px",
|
|
715
|
-
border: `solid 2px ${e
|
|
716
|
-
borderRadius: `${
|
|
717
|
-
color:
|
|
718
|
-
backgroundColor:
|
|
749
|
+
border: `solid 2px ${e?.border ? v : "transparent"}`,
|
|
750
|
+
borderRadius: `${e?.radius || 0}px`,
|
|
751
|
+
color: v,
|
|
752
|
+
backgroundColor: d
|
|
719
753
|
}
|
|
720
|
-
}, [
|
|
721
|
-
}),
|
|
754
|
+
}, [m]);
|
|
755
|
+
}), c && "..."]);
|
|
722
756
|
});
|
|
723
757
|
}
|
|
724
|
-
function
|
|
758
|
+
function fe(e) {
|
|
725
759
|
if (typeof e == "string")
|
|
726
760
|
return e;
|
|
727
761
|
if (typeof e == "number")
|
|
728
762
|
return `${e}px`;
|
|
729
763
|
}
|
|
730
|
-
function
|
|
731
|
-
|
|
732
|
-
return typeof e == "function" ? (u = e(r)) == null ? void 0 : u.toString() : typeof (e == null ? void 0 : e.content) == "function" ? (a = e == null ? void 0 : e.content(r)) == null ? void 0 : a.toString() : typeof (e == null ? void 0 : e.content) == "string" ? e == null ? void 0 : e.content : T(r, t);
|
|
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);
|
|
733
766
|
}
|
|
734
|
-
function
|
|
767
|
+
function Kt(e, t) {
|
|
735
768
|
if (typeof e != "function") {
|
|
736
|
-
if (typeof
|
|
737
|
-
return e
|
|
738
|
-
if (typeof
|
|
739
|
-
return e
|
|
769
|
+
if (typeof e?.color == "function")
|
|
770
|
+
return e?.color(t);
|
|
771
|
+
if (typeof e?.color == "string")
|
|
772
|
+
return e?.color;
|
|
740
773
|
}
|
|
741
774
|
}
|
|
742
|
-
function
|
|
775
|
+
function Nt(e, t) {
|
|
743
776
|
if (typeof e != "function")
|
|
744
|
-
return typeof
|
|
745
|
-
}
|
|
746
|
-
function Yt(e, t) {
|
|
747
|
-
let r = "";
|
|
748
|
-
const u = zt(e, t), a = Et(e, t);
|
|
749
|
-
return u && (r += `color:${u};`), a && (r += `font-size:${a};`), r;
|
|
750
|
-
}
|
|
751
|
-
function At(e) {
|
|
752
|
-
return k("text", (r, u) => {
|
|
753
|
-
const a = Pt(e || {}, u, r), n = Yt(e || {}, r);
|
|
754
|
-
return f("span", {
|
|
755
|
-
style: n
|
|
756
|
-
}, [a]);
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
function Bt(e) {
|
|
760
|
-
const t = (e == null ? void 0 : e.backgroundColor) ?? "#f5f5f5", r = (e == null ? void 0 : e.foregroundColor) ?? "#1677ff", u = (e == null ? void 0 : e.showText) ?? !0, a = (e == null ? void 0 : e.textColor) ?? "#000";
|
|
761
|
-
return k("progress", (l, i) => {
|
|
762
|
-
var h;
|
|
763
|
-
const o = T(l, i), d = (e == null ? void 0 : e.precision) ?? 0, s = Math.min(Math.max(((h = e == null ? void 0 : e.format) == null ? void 0 : h.call(e, o)) ?? o, 0), 1), m = u ? `${(s * 100).toFixed(d)}%` : "";
|
|
764
|
-
return f("div", {
|
|
765
|
-
style: `background-color:${t};position:relative;min-height: 20px;text-align: center;border-radius: 2px;overflow:hidden;`
|
|
766
|
-
}, [f("div", {
|
|
767
|
-
style: `background-color: ${r};position:absolute;left:0;top:0;right;0;width: ${m};height: 100%;`
|
|
768
|
-
}, null), u && f("div", {
|
|
769
|
-
style: `position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:${a}`
|
|
770
|
-
}, [m])]);
|
|
771
|
-
});
|
|
777
|
+
return typeof e?.size == "function" ? fe(e?.size(t)) : fe(e?.size);
|
|
772
778
|
}
|
|
773
|
-
function
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
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]);
|
|
785
790
|
});
|
|
786
791
|
}
|
|
787
|
-
function
|
|
792
|
+
function Zt() {
|
|
788
793
|
return {
|
|
789
|
-
dropdown:
|
|
790
|
-
text:
|
|
791
|
-
dict:
|
|
792
|
-
tag:
|
|
793
|
-
render:
|
|
794
|
-
phone:
|
|
795
|
-
image:
|
|
796
|
-
currency:
|
|
797
|
-
date:
|
|
798
|
-
button:
|
|
799
|
-
progress:
|
|
800
|
-
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
|
|
801
806
|
};
|
|
802
807
|
}
|
|
803
|
-
function
|
|
804
|
-
if (!
|
|
808
|
+
function ee(e, t) {
|
|
809
|
+
if (!e?.render)
|
|
805
810
|
return;
|
|
806
|
-
const
|
|
807
|
-
...
|
|
811
|
+
const n = e.render({
|
|
812
|
+
...Zt()
|
|
808
813
|
// ...(Table?.$override?.table || {}),
|
|
809
814
|
});
|
|
810
815
|
return {
|
|
811
816
|
render: ({
|
|
812
|
-
record:
|
|
813
|
-
rowIndex:
|
|
814
|
-
}) =>
|
|
817
|
+
record: i,
|
|
818
|
+
rowIndex: o
|
|
819
|
+
}) => n(i, e, {
|
|
815
820
|
...t || {},
|
|
816
|
-
rowIndex:
|
|
821
|
+
rowIndex: o
|
|
817
822
|
}),
|
|
818
|
-
[
|
|
819
|
-
disableColumnMode:
|
|
820
|
-
disableViewMode:
|
|
821
|
-
isRender:
|
|
822
|
-
type:
|
|
823
|
+
[it]: n.$type,
|
|
824
|
+
disableColumnMode: n.$disableColumnMode,
|
|
825
|
+
disableViewMode: n.$disableViewMode,
|
|
826
|
+
isRender: n.$type === "render",
|
|
827
|
+
type: n.$type
|
|
823
828
|
};
|
|
824
829
|
}
|
|
825
|
-
function
|
|
830
|
+
function me({
|
|
826
831
|
columns: e,
|
|
827
832
|
columnsOptions: t,
|
|
828
|
-
columnsGroups:
|
|
829
|
-
pageMode:
|
|
830
|
-
collapsedColumns:
|
|
831
|
-
events:
|
|
833
|
+
columnsGroups: n,
|
|
834
|
+
pageMode: i,
|
|
835
|
+
collapsedColumns: o,
|
|
836
|
+
events: r
|
|
832
837
|
}) {
|
|
833
|
-
const
|
|
838
|
+
const a = e.map((l) => ({
|
|
834
839
|
...t || {},
|
|
835
|
-
...
|
|
836
|
-
})).map((
|
|
837
|
-
return
|
|
838
|
-
}
|
|
839
|
-
function
|
|
840
|
-
const
|
|
841
|
-
if ("children" in
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
return
|
|
845
|
-
});
|
|
846
|
-
if (l)
|
|
847
|
-
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;
|
|
848
850
|
}
|
|
849
|
-
return
|
|
850
|
-
},
|
|
851
|
-
if (
|
|
852
|
-
const
|
|
853
|
-
|
|
854
|
-
const
|
|
855
|
-
t.splice(
|
|
856
|
-
}), 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);
|
|
857
859
|
}
|
|
858
860
|
}
|
|
859
|
-
function
|
|
860
|
-
return t.forEach((
|
|
861
|
-
|
|
861
|
+
function Qt(e, t = []) {
|
|
862
|
+
return t.forEach((n) => {
|
|
863
|
+
Jt(n, e);
|
|
862
864
|
}), e;
|
|
863
865
|
}
|
|
864
|
-
function
|
|
866
|
+
function Xt(e, t, n, i) {
|
|
865
867
|
const {
|
|
866
|
-
render:
|
|
867
|
-
disableColumnMode:
|
|
868
|
-
} =
|
|
868
|
+
render: o,
|
|
869
|
+
disableColumnMode: r
|
|
870
|
+
} = ee(e, {
|
|
869
871
|
previewing: !1,
|
|
870
|
-
emits:
|
|
872
|
+
emits: i
|
|
871
873
|
}) || {};
|
|
872
|
-
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))
|
|
873
875
|
return {
|
|
874
876
|
dataIndex: e.index || e.key,
|
|
875
877
|
title: e.title,
|
|
@@ -885,13 +887,13 @@ function It(e, t, r, u) {
|
|
|
885
887
|
tooltip: !0,
|
|
886
888
|
...e.extraProps,
|
|
887
889
|
key: e.key,
|
|
888
|
-
render:
|
|
890
|
+
render: o
|
|
889
891
|
};
|
|
890
892
|
}
|
|
891
|
-
function
|
|
892
|
-
return new
|
|
893
|
+
function en() {
|
|
894
|
+
return new rt.Workbook();
|
|
893
895
|
}
|
|
894
|
-
function
|
|
896
|
+
function tn(e, t = "Sheet1") {
|
|
895
897
|
return e.addWorksheet(t, {
|
|
896
898
|
headerFooter: {
|
|
897
899
|
firstHeader: "",
|
|
@@ -899,94 +901,164 @@ function Wt(e, t = "Sheet1") {
|
|
|
899
901
|
}
|
|
900
902
|
});
|
|
901
903
|
}
|
|
902
|
-
function
|
|
904
|
+
function nn(e, t) {
|
|
903
905
|
e.columns = t;
|
|
904
906
|
}
|
|
905
|
-
function
|
|
907
|
+
function rn(e, t) {
|
|
906
908
|
e.addRows(t);
|
|
907
909
|
}
|
|
908
|
-
async function
|
|
910
|
+
async function on({
|
|
909
911
|
columns: e,
|
|
910
912
|
rows: t,
|
|
911
|
-
filename:
|
|
913
|
+
filename: n
|
|
912
914
|
}) {
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
}
|
|
918
|
-
function
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
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);
|
|
922
924
|
}, 1e3);
|
|
923
925
|
}
|
|
924
|
-
function
|
|
925
|
-
const
|
|
926
|
-
return e.filter((
|
|
927
|
-
options:
|
|
928
|
-
render:
|
|
929
|
-
content: typeof
|
|
930
|
-
})).forEach((
|
|
931
|
-
|
|
932
|
-
const n = (i = a.render) == null ? void 0 : i.render, l = () => {
|
|
933
|
-
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 = () => {
|
|
934
934
|
switch (!0) {
|
|
935
|
-
case !!
|
|
936
|
-
return
|
|
937
|
-
case !!
|
|
938
|
-
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({
|
|
939
939
|
record: t
|
|
940
940
|
}));
|
|
941
|
-
return
|
|
941
|
+
return Fe(c, l), c.el?.textContent;
|
|
942
942
|
}
|
|
943
943
|
default:
|
|
944
|
-
return
|
|
944
|
+
return $(t, o.options);
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
|
-
|
|
948
|
-
}),
|
|
947
|
+
n[o.options.key] = a();
|
|
948
|
+
}), n;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
950
|
+
function sn(e) {
|
|
951
951
|
switch (!0) {
|
|
952
952
|
case typeof e == "number":
|
|
953
953
|
return e / 6;
|
|
954
954
|
case (typeof e == "string" && e.endsWith("px")):
|
|
955
|
-
return parseInt(e.replace("px", "")) / 6;
|
|
955
|
+
return Number.parseInt(e.replace("px", "")) / 6;
|
|
956
956
|
default:
|
|
957
957
|
return 30;
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
columns: u,
|
|
971
|
-
rows: a,
|
|
972
|
-
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
|
|
973
970
|
});
|
|
974
971
|
}
|
|
975
|
-
function
|
|
972
|
+
function cn() {
|
|
976
973
|
return {
|
|
977
|
-
exportExcel:
|
|
974
|
+
exportExcel: un
|
|
978
975
|
};
|
|
979
976
|
}
|
|
980
|
-
|
|
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 = {};
|
|
981
1061
|
constructor(t) {
|
|
982
|
-
$(this, "sort", {});
|
|
983
|
-
$(this, "defaultSort", {});
|
|
984
|
-
$(this, "before", (t) => {
|
|
985
|
-
t.paramsQuery = {
|
|
986
|
-
...t.paramsQuery || {},
|
|
987
|
-
sort: this.stringify(this.sort)
|
|
988
|
-
};
|
|
989
|
-
});
|
|
990
1062
|
t && (this.sort = t, this.defaultSort = t);
|
|
991
1063
|
}
|
|
992
1064
|
/**
|
|
@@ -994,19 +1066,25 @@ class Z {
|
|
|
994
1066
|
* @param key 排序关键字
|
|
995
1067
|
* @param value 排序方式
|
|
996
1068
|
*/
|
|
997
|
-
update(t,
|
|
998
|
-
t &&
|
|
1069
|
+
update(t, n) {
|
|
1070
|
+
t && n && (this.sort[t] = n);
|
|
999
1071
|
}
|
|
1000
1072
|
/**
|
|
1001
1073
|
* 移除排序项
|
|
1002
1074
|
* @param key 排序关键字
|
|
1003
1075
|
*/
|
|
1004
1076
|
remove(t) {
|
|
1005
|
-
const
|
|
1006
|
-
this.sort = {},
|
|
1007
|
-
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;
|
|
1008
1080
|
});
|
|
1009
1081
|
}
|
|
1082
|
+
before = (t) => {
|
|
1083
|
+
t.paramsQuery = {
|
|
1084
|
+
...t.paramsQuery || {},
|
|
1085
|
+
sort: this.stringify(this.sort)
|
|
1086
|
+
};
|
|
1087
|
+
};
|
|
1010
1088
|
/**
|
|
1011
1089
|
* 重置分页数据
|
|
1012
1090
|
*/
|
|
@@ -1017,122 +1095,17 @@ class Z {
|
|
|
1017
1095
|
* 转换排序对象为字符串
|
|
1018
1096
|
*/
|
|
1019
1097
|
stringify(t) {
|
|
1020
|
-
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}`));
|
|
1021
1099
|
}
|
|
1022
1100
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
if (!r)
|
|
1027
|
-
return;
|
|
1028
|
-
let u, a = !1, n;
|
|
1029
|
-
r.addEventListener("mousedown", () => {
|
|
1030
|
-
u = setTimeout(() => {
|
|
1031
|
-
u && (r.style.cursor = "grab", r.style.userSelect = "none", a = !0);
|
|
1032
|
-
}, er);
|
|
1033
|
-
}), r.addEventListener("mouseup", () => {
|
|
1034
|
-
clearTimeout(u), u && (u = void 0, a = !1, r.style.cursor = "", r.style.userSelect = "", n = void 0);
|
|
1035
|
-
}), r.addEventListener("mousemove", (l) => {
|
|
1036
|
-
if (a)
|
|
1037
|
-
if (n === void 0)
|
|
1038
|
-
n = l.clientX;
|
|
1039
|
-
else {
|
|
1040
|
-
const i = n - l.clientX;
|
|
1041
|
-
n = l.clientX, r.scrollLeft += i;
|
|
1042
|
-
}
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
function rr(e) {
|
|
1046
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Be(e);
|
|
1047
|
-
}
|
|
1048
|
-
const nr = /* @__PURE__ */ B({
|
|
1049
|
-
props: {
|
|
1050
|
-
record: {
|
|
1051
|
-
type: Object,
|
|
1052
|
-
required: !0
|
|
1053
|
-
},
|
|
1054
|
-
columns: {
|
|
1055
|
-
type: Array,
|
|
1056
|
-
required: !0
|
|
1057
|
-
},
|
|
1058
|
-
minWidth: {
|
|
1059
|
-
type: Number,
|
|
1060
|
-
required: !1,
|
|
1061
|
-
default: 320
|
|
1062
|
-
},
|
|
1063
|
-
border: {
|
|
1064
|
-
type: Boolean,
|
|
1065
|
-
default: !0
|
|
1066
|
-
},
|
|
1067
|
-
exclude: {
|
|
1068
|
-
type: Array,
|
|
1069
|
-
default: () => []
|
|
1070
|
-
},
|
|
1071
|
-
layout: {
|
|
1072
|
-
type: String,
|
|
1073
|
-
required: !1,
|
|
1074
|
-
default: "horizontal"
|
|
1075
|
-
},
|
|
1076
|
-
buttons: {
|
|
1077
|
-
type: Array,
|
|
1078
|
-
default: () => []
|
|
1079
|
-
}
|
|
1080
|
-
},
|
|
1081
|
-
setup(e) {
|
|
1082
|
-
const t = H(), r = b(0), u = e.columns.filter((n) => typeof n.visiable == "boolean" ? n.visiable : typeof n.visiable == "function" ? n.visiable() : !0).map((n) => ({
|
|
1083
|
-
options: n,
|
|
1084
|
-
renderer: G(n, {
|
|
1085
|
-
previewing: !0
|
|
1086
|
-
})
|
|
1087
|
-
})).filter(({
|
|
1088
|
-
options: n
|
|
1089
|
-
}) => {
|
|
1090
|
-
var l;
|
|
1091
|
-
return !((l = e.exclude) != null && l.includes(n.key));
|
|
1092
|
-
}).filter(({
|
|
1093
|
-
renderer: n
|
|
1094
|
-
}) => !(n != null && n.disableViewMode));
|
|
1095
|
-
function a() {
|
|
1096
|
-
var n;
|
|
1097
|
-
if (t) {
|
|
1098
|
-
const l = (n = t.proxy) == null ? void 0 : n.$el;
|
|
1099
|
-
r.value = Math.floor(l.offsetWidth / e.minWidth);
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
return A(() => {
|
|
1103
|
-
a();
|
|
1104
|
-
}), () => {
|
|
1105
|
-
let n;
|
|
1106
|
-
return f("div", {
|
|
1107
|
-
class: "preview-container"
|
|
1108
|
-
}, [f(Ke, {
|
|
1109
|
-
column: r.value,
|
|
1110
|
-
bordered: !0,
|
|
1111
|
-
align: "left",
|
|
1112
|
-
layout: e.layout
|
|
1113
|
-
}, rr(n = u.map((l) => f(We, {
|
|
1114
|
-
label: l.options.title
|
|
1115
|
-
}, {
|
|
1116
|
-
default: () => {
|
|
1117
|
-
var i, o;
|
|
1118
|
-
return [(i = l.renderer) != null && i.render ? (o = l.renderer) == null ? void 0 : o.render({
|
|
1119
|
-
record: e.record
|
|
1120
|
-
}) : T(e.record, l.options)];
|
|
1121
|
-
}
|
|
1122
|
-
}))) ? n : {
|
|
1123
|
-
default: () => [n]
|
|
1124
|
-
})]);
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
});
|
|
1128
|
-
function ar(e, t, {
|
|
1129
|
-
tableForm: r,
|
|
1130
|
-
tableEvents: u
|
|
1101
|
+
function mn(e, t, {
|
|
1102
|
+
tableForm: n,
|
|
1103
|
+
tableEvents: i
|
|
1131
1104
|
}) {
|
|
1132
|
-
const
|
|
1133
|
-
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, {
|
|
1134
1107
|
margin: 0
|
|
1135
|
-
}, null),
|
|
1108
|
+
}, null), o && u("div", {
|
|
1136
1109
|
class: "table-actions",
|
|
1137
1110
|
style: {
|
|
1138
1111
|
display: "flex",
|
|
@@ -1141,44 +1114,108 @@ function ar(e, t, {
|
|
|
1141
1114
|
flexDirection: e.actionsPosition === "right" ? "row" : "row-reverse",
|
|
1142
1115
|
alignItems: "center"
|
|
1143
1116
|
}
|
|
1144
|
-
}, [
|
|
1117
|
+
}, [u("div", {
|
|
1145
1118
|
class: "built-in"
|
|
1146
|
-
}, [
|
|
1147
|
-
default: () => [e.refreshable &&
|
|
1119
|
+
}, [u(le, null, {
|
|
1120
|
+
default: () => [e.refreshable && u(P, {
|
|
1148
1121
|
type: "primary",
|
|
1149
|
-
onClick: () =>
|
|
1122
|
+
onClick: () => i("reload")
|
|
1150
1123
|
}, {
|
|
1151
|
-
default: () => [
|
|
1152
|
-
}), e.exportable &&
|
|
1124
|
+
default: () => [A("刷新")]
|
|
1125
|
+
}), e.exportable && u(P, {
|
|
1153
1126
|
type: "primary",
|
|
1154
|
-
onClick: () =>
|
|
1127
|
+
onClick: () => i("export")
|
|
1155
1128
|
}, {
|
|
1156
|
-
default: () => [
|
|
1157
|
-
}), e.collapsable &&
|
|
1129
|
+
default: () => [A("导出")]
|
|
1130
|
+
}), e.collapsable && u(P, {
|
|
1158
1131
|
type: "primary",
|
|
1159
|
-
onClick: () =>
|
|
1132
|
+
onClick: () => i("collapse")
|
|
1160
1133
|
}, {
|
|
1161
|
-
default: () => [
|
|
1134
|
+
default: () => [A("显示")]
|
|
1162
1135
|
})]
|
|
1163
|
-
})]),
|
|
1136
|
+
})]), u("div", {
|
|
1164
1137
|
class: "customs"
|
|
1165
|
-
}, [
|
|
1138
|
+
}, [u(le, null, {
|
|
1166
1139
|
default: () => [t.slots.actions && t.slots.actions()]
|
|
1167
1140
|
})])])]) : () => {
|
|
1168
1141
|
};
|
|
1169
1142
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
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
|
|
1174
1211
|
}) {
|
|
1175
|
-
return
|
|
1212
|
+
return n?.length ? () => u("div", {
|
|
1176
1213
|
class: "table-form"
|
|
1177
|
-
}, [
|
|
1178
|
-
form:
|
|
1179
|
-
ref: (
|
|
1214
|
+
}, [u(be, pe({
|
|
1215
|
+
form: n,
|
|
1216
|
+
ref: (r) => o && (o.value = r),
|
|
1180
1217
|
searchable: !0,
|
|
1181
|
-
onSubmit: () =>
|
|
1218
|
+
onSubmit: () => i("reload", {
|
|
1182
1219
|
reset: !0
|
|
1183
1220
|
})
|
|
1184
1221
|
}, e.formOptions), {
|
|
@@ -1186,176 +1223,182 @@ function lr(e, t, {
|
|
|
1186
1223
|
})]) : () => {
|
|
1187
1224
|
};
|
|
1188
1225
|
}
|
|
1189
|
-
function
|
|
1190
|
-
|
|
1226
|
+
function bn(e, t, {
|
|
1227
|
+
pageService: n,
|
|
1228
|
+
tableEvents: i
|
|
1191
1229
|
}) {
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
u.value = [], t.emit("update:radio-key", null), t.emit("update:radio-row", null), t.emit("update:checkbox-keys", []), t.emit("update:checkbox-rows", []);
|
|
1230
|
+
function o(l) {
|
|
1231
|
+
n && (n.pageIndex = l, i("reload"));
|
|
1195
1232
|
}
|
|
1196
|
-
function
|
|
1197
|
-
|
|
1198
|
-
|
|
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]]);
|
|
1199
1276
|
});
|
|
1200
1277
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const
|
|
1278
|
+
function a() {
|
|
1279
|
+
const s = typeof e.selection == "string" ? {
|
|
1203
1280
|
type: e.selection
|
|
1204
1281
|
} : e.selection;
|
|
1205
|
-
switch (
|
|
1282
|
+
switch (s?.type) {
|
|
1206
1283
|
case "radio":
|
|
1207
1284
|
return {
|
|
1208
1285
|
title: "选择",
|
|
1209
1286
|
width: 80,
|
|
1210
|
-
selectedRowKeys:
|
|
1211
|
-
...
|
|
1287
|
+
selectedRowKeys: i.value,
|
|
1288
|
+
...s
|
|
1212
1289
|
};
|
|
1213
1290
|
case "checkbox":
|
|
1214
1291
|
return {
|
|
1215
1292
|
width: 80,
|
|
1216
1293
|
showCheckedAll: !0,
|
|
1217
|
-
selectedRowKeys:
|
|
1218
|
-
...
|
|
1294
|
+
selectedRowKeys: i.value,
|
|
1295
|
+
...s
|
|
1219
1296
|
};
|
|
1220
1297
|
}
|
|
1221
1298
|
}
|
|
1222
|
-
function
|
|
1299
|
+
function l(s, m, f) {
|
|
1223
1300
|
const {
|
|
1224
|
-
type:
|
|
1225
|
-
} =
|
|
1226
|
-
switch (
|
|
1301
|
+
type: v
|
|
1302
|
+
} = a() || {};
|
|
1303
|
+
switch (v) {
|
|
1227
1304
|
case "radio":
|
|
1228
|
-
t.emit("update:radio-key",
|
|
1305
|
+
t.emit("update:radio-key", m), t.emit("update:radio-row", f);
|
|
1229
1306
|
break;
|
|
1230
1307
|
case "checkbox":
|
|
1231
|
-
t.emit("update:checkbox-keys",
|
|
1232
|
-
var S;
|
|
1233
|
-
return r.value.find((x) => x[e.rowKey] === w) || ((S = e.checkboxRows) == null ? void 0 : S.find((x) => x[e.rowKey] === w));
|
|
1234
|
-
}));
|
|
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)));
|
|
1235
1309
|
break;
|
|
1236
1310
|
}
|
|
1237
1311
|
}
|
|
1238
|
-
function
|
|
1239
|
-
|
|
1240
|
-
t.emit("update:checkbox-keys",
|
|
1241
|
-
var s;
|
|
1242
|
-
return r.value.find((m) => m[e.rowKey] === d) || ((s = e.checkboxRows) == null ? void 0 : s.find((m) => m[e.rowKey] === d));
|
|
1243
|
-
}));
|
|
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)));
|
|
1244
1315
|
});
|
|
1245
1316
|
}
|
|
1246
|
-
return
|
|
1247
|
-
selectedRowKeys:
|
|
1248
|
-
rowSelection:
|
|
1249
|
-
onSelect:
|
|
1250
|
-
onSelectAll:
|
|
1251
|
-
resetSelection:
|
|
1252
|
-
reloadSelection:
|
|
1317
|
+
return r(), {
|
|
1318
|
+
selectedRowKeys: i,
|
|
1319
|
+
rowSelection: a(),
|
|
1320
|
+
onSelect: l,
|
|
1321
|
+
onSelectAll: c,
|
|
1322
|
+
resetSelection: o,
|
|
1323
|
+
reloadSelection: r
|
|
1253
1324
|
};
|
|
1254
1325
|
}
|
|
1255
|
-
function
|
|
1256
|
-
|
|
1257
|
-
tableEvents: u
|
|
1258
|
-
}) {
|
|
1259
|
-
function a(i) {
|
|
1260
|
-
r && (r.pageIndex = i, u("reload"));
|
|
1261
|
-
}
|
|
1262
|
-
function n(i) {
|
|
1263
|
-
r && (r.pageSize = i, u("reload"));
|
|
1264
|
-
}
|
|
1265
|
-
const l = _t({
|
|
1266
|
-
mobile: 0,
|
|
1267
|
-
tablet: 640,
|
|
1268
|
-
desktop: 1024
|
|
1269
|
-
});
|
|
1270
|
-
return r ? () => f("div", {
|
|
1271
|
-
class: "table-pagination",
|
|
1272
|
-
style: {
|
|
1273
|
-
padding: "10px 0"
|
|
1274
|
-
}
|
|
1275
|
-
}, [f(Ue, {
|
|
1276
|
-
current: r.pageIndex,
|
|
1277
|
-
"onUpdate:current": (i) => r.pageIndex = i,
|
|
1278
|
-
"page-size": r.pageSize,
|
|
1279
|
-
"onUpdate:page-size": (i) => r.pageSize = i,
|
|
1280
|
-
total: r.total,
|
|
1281
|
-
"page-size-options": r.pageSizeOpts,
|
|
1282
|
-
"hide-on-single-page": !e.alwayShowPagination,
|
|
1283
|
-
"show-total": !0,
|
|
1284
|
-
"show-page-size": !0,
|
|
1285
|
-
size: "small",
|
|
1286
|
-
simple: l.smaller("desktop").value,
|
|
1287
|
-
onChange: (i) => a(i),
|
|
1288
|
-
onPageSizeChange: (i) => n(i),
|
|
1289
|
-
style: {
|
|
1290
|
-
justifyContent: "flex-end"
|
|
1291
|
-
}
|
|
1292
|
-
}, null)]) : () => {
|
|
1293
|
-
};
|
|
1326
|
+
function vn(e) {
|
|
1327
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !He(e);
|
|
1294
1328
|
}
|
|
1295
|
-
const
|
|
1296
|
-
props: {
|
|
1297
|
-
collapsedColumns: {
|
|
1298
|
-
type: Array,
|
|
1299
|
-
required: !0
|
|
1300
|
-
}
|
|
1301
|
-
},
|
|
1302
|
-
setup(e) {
|
|
1303
|
-
const t = D(), r = b(e.collapsedColumns.map((a) => ({
|
|
1304
|
-
label: a.title,
|
|
1305
|
-
value: a.key,
|
|
1306
|
-
disabled: !1
|
|
1307
|
-
}))), u = b(e.collapsedColumns.filter((a) => a.collapsed).map((a) => a.key));
|
|
1308
|
-
return Je(() => {
|
|
1309
|
-
const a = e.collapsedColumns.map((n) => ({
|
|
1310
|
-
key: n.key,
|
|
1311
|
-
title: n.title,
|
|
1312
|
-
collapsed: u.value.includes(n.key)
|
|
1313
|
-
}));
|
|
1314
|
-
t.close(a);
|
|
1315
|
-
}), () => f("div", {
|
|
1316
|
-
class: "table-collapsed-render"
|
|
1317
|
-
}, [f(Ge, {
|
|
1318
|
-
data: r.value,
|
|
1319
|
-
"default-value": u.value,
|
|
1320
|
-
onChange: (a) => u.value = [...a],
|
|
1321
|
-
title: ["显示列", "隐藏列"],
|
|
1322
|
-
style: {
|
|
1323
|
-
justifyContent: "center"
|
|
1324
|
-
}
|
|
1325
|
-
}, {
|
|
1326
|
-
default: () => [De(f("template", null, null), [[Ve("slot"), "source"]])]
|
|
1327
|
-
})]);
|
|
1328
|
-
}
|
|
1329
|
-
}), dr = /* @__PURE__ */ B({
|
|
1329
|
+
const wn = /* @__PURE__ */ F({
|
|
1330
1330
|
props: {
|
|
1331
|
-
|
|
1331
|
+
record: {
|
|
1332
1332
|
type: Object,
|
|
1333
1333
|
required: !0
|
|
1334
1334
|
},
|
|
1335
|
-
|
|
1335
|
+
columns: {
|
|
1336
1336
|
type: Array,
|
|
1337
1337
|
required: !0
|
|
1338
1338
|
},
|
|
1339
|
-
|
|
1340
|
-
type:
|
|
1341
|
-
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: () => []
|
|
1342
1360
|
}
|
|
1343
1361
|
},
|
|
1344
1362
|
setup(e) {
|
|
1345
|
-
const t =
|
|
1346
|
-
|
|
1347
|
-
|
|
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
|
+
}
|
|
1348
1378
|
}
|
|
1349
|
-
return () =>
|
|
1350
|
-
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
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
|
+
};
|
|
1357
1400
|
}
|
|
1358
|
-
}),
|
|
1401
|
+
}), xn = /* @__PURE__ */ F({
|
|
1359
1402
|
props: {
|
|
1360
1403
|
// 数据主键
|
|
1361
1404
|
rowKey: {
|
|
@@ -1504,24 +1547,24 @@ const cr = /* @__PURE__ */ B({
|
|
|
1504
1547
|
},
|
|
1505
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"],
|
|
1506
1549
|
setup(e, t) {
|
|
1507
|
-
const
|
|
1508
|
-
key:
|
|
1509
|
-
title:
|
|
1510
|
-
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
|
|
1511
1554
|
})));
|
|
1512
|
-
function
|
|
1555
|
+
function y() {
|
|
1513
1556
|
switch (!0) {
|
|
1514
1557
|
case (typeof e.pageable == "string" && e.pageable === "server"):
|
|
1515
|
-
return new
|
|
1558
|
+
return new K();
|
|
1516
1559
|
case (typeof e.pageable == "boolean" && e.pageable === !0):
|
|
1517
|
-
return new
|
|
1560
|
+
return new K();
|
|
1518
1561
|
case (typeof e.pageable == "object" && !!e.pageable.reset):
|
|
1519
1562
|
return e.pageable;
|
|
1520
1563
|
case (typeof e.pageable == "object" && (!!e.pageable.index || !!e.pageable.size)):
|
|
1521
|
-
return new
|
|
1564
|
+
return new K(e.pageable.index, e.pageable.size);
|
|
1522
1565
|
}
|
|
1523
1566
|
}
|
|
1524
|
-
const
|
|
1567
|
+
const w = (() => {
|
|
1525
1568
|
switch (!0) {
|
|
1526
1569
|
case typeof e.pageable == "string":
|
|
1527
1570
|
return e.pageable;
|
|
@@ -1532,215 +1575,206 @@ const cr = /* @__PURE__ */ B({
|
|
|
1532
1575
|
}
|
|
1533
1576
|
})();
|
|
1534
1577
|
function j() {
|
|
1535
|
-
const
|
|
1536
|
-
if (
|
|
1537
|
-
return new
|
|
1578
|
+
const h = e.columns.find((b) => !!b.sortable);
|
|
1579
|
+
if (h || e.sortable)
|
|
1580
|
+
return new te({
|
|
1538
1581
|
...e.sortable || {},
|
|
1539
|
-
...
|
|
1540
|
-
[
|
|
1582
|
+
...h ? {
|
|
1583
|
+
[h.key]: h.sortable
|
|
1541
1584
|
} : {}
|
|
1542
1585
|
});
|
|
1543
1586
|
}
|
|
1544
|
-
function
|
|
1587
|
+
function x(h) {
|
|
1545
1588
|
const {
|
|
1546
|
-
exportExcel:
|
|
1547
|
-
} =
|
|
1548
|
-
|
|
1589
|
+
exportExcel: b
|
|
1590
|
+
} = cn();
|
|
1591
|
+
b(h?.columns || e.columns, h?.source || l.value, h?.filename || (typeof e.exportable == "object" ? e.exportable.filename : void 0));
|
|
1549
1592
|
}
|
|
1550
|
-
function
|
|
1551
|
-
let
|
|
1593
|
+
function p(h) {
|
|
1594
|
+
let b;
|
|
1552
1595
|
switch (!0) {
|
|
1553
|
-
case !!
|
|
1554
|
-
|
|
1596
|
+
case !!h?.key:
|
|
1597
|
+
b = l.value.find((O) => O[e.rowKey] === h?.key);
|
|
1555
1598
|
break;
|
|
1556
|
-
case !!
|
|
1557
|
-
|
|
1599
|
+
case !!h?.record:
|
|
1600
|
+
b = h?.record;
|
|
1558
1601
|
break;
|
|
1559
1602
|
}
|
|
1560
|
-
if (!
|
|
1603
|
+
if (!b)
|
|
1561
1604
|
throw new Error("未找到需要预览的数据");
|
|
1562
|
-
return
|
|
1563
|
-
record:
|
|
1605
|
+
return r.value.open(wn, {
|
|
1606
|
+
record: b,
|
|
1564
1607
|
columns: e.columns
|
|
1565
1608
|
}, {
|
|
1566
|
-
title:
|
|
1567
|
-
mode:
|
|
1609
|
+
title: h?.title || "详情",
|
|
1610
|
+
mode: h?.mode || "dialog"
|
|
1568
1611
|
});
|
|
1569
1612
|
}
|
|
1570
|
-
function
|
|
1571
|
-
let
|
|
1613
|
+
function g(h) {
|
|
1614
|
+
let b;
|
|
1572
1615
|
switch (!0) {
|
|
1573
|
-
case !!
|
|
1574
|
-
|
|
1616
|
+
case !!h?.key:
|
|
1617
|
+
b = l.value.find((O) => O[e.rowKey] === h?.key);
|
|
1575
1618
|
break;
|
|
1576
|
-
case !!
|
|
1577
|
-
|
|
1619
|
+
case !!h?.record:
|
|
1620
|
+
b = h?.record;
|
|
1578
1621
|
break;
|
|
1579
1622
|
}
|
|
1580
|
-
if (!
|
|
1623
|
+
if (!b)
|
|
1581
1624
|
throw new Error("未找到需要编辑的数据");
|
|
1582
|
-
return
|
|
1583
|
-
value:
|
|
1584
|
-
form:
|
|
1585
|
-
onSubmit:
|
|
1625
|
+
return r.value.open(yn, {
|
|
1626
|
+
value: b,
|
|
1627
|
+
form: h?.form,
|
|
1628
|
+
onSubmit: h.onSubmit
|
|
1586
1629
|
}, {
|
|
1587
|
-
title:
|
|
1588
|
-
mode:
|
|
1630
|
+
title: h?.title || "编辑",
|
|
1631
|
+
mode: h?.mode || "dialog",
|
|
1589
1632
|
footer: !0,
|
|
1590
1633
|
form: "form"
|
|
1591
1634
|
});
|
|
1592
1635
|
}
|
|
1593
|
-
function
|
|
1594
|
-
var p, ee;
|
|
1636
|
+
function C(h) {
|
|
1595
1637
|
if (!e.dataLoad)
|
|
1596
|
-
return Promise.reject();
|
|
1597
|
-
|
|
1598
|
-
const
|
|
1599
|
-
...
|
|
1638
|
+
return Promise.reject(new Error("dataLoad is required"));
|
|
1639
|
+
h?.reset && (f && f.reset(), v && v.reset(), i.value?.resetSorters());
|
|
1640
|
+
const b = {
|
|
1641
|
+
...o.value?.formSource || {}
|
|
1600
1642
|
};
|
|
1601
|
-
Object.keys(
|
|
1602
|
-
[null, void 0, ""].includes(
|
|
1643
|
+
Object.keys(b).forEach((ie) => {
|
|
1644
|
+
[null, void 0, ""].includes(b[ie]) && delete b[ie];
|
|
1603
1645
|
});
|
|
1604
|
-
const
|
|
1605
|
-
form:
|
|
1606
|
-
page:
|
|
1607
|
-
sort:
|
|
1608
|
-
update:
|
|
1646
|
+
const O = e.dataLoad({
|
|
1647
|
+
form: b,
|
|
1648
|
+
page: f,
|
|
1649
|
+
sort: v,
|
|
1650
|
+
update: c
|
|
1609
1651
|
});
|
|
1610
|
-
return
|
|
1611
|
-
|
|
1612
|
-
}),
|
|
1652
|
+
return B(O) ? (s.value = !0, Promise.resolve(O).finally(() => {
|
|
1653
|
+
s.value = !1;
|
|
1654
|
+
}), O) : Promise.resolve();
|
|
1613
1655
|
}
|
|
1614
|
-
function
|
|
1615
|
-
|
|
1616
|
-
collapsedColumns:
|
|
1656
|
+
function we() {
|
|
1657
|
+
r.value.open(hn, {
|
|
1658
|
+
collapsedColumns: d.value
|
|
1617
1659
|
}, {
|
|
1618
1660
|
title: "显示列",
|
|
1619
1661
|
size: "small",
|
|
1620
1662
|
footer: !0
|
|
1621
|
-
}).then((
|
|
1622
|
-
|
|
1663
|
+
}).then((h) => {
|
|
1664
|
+
d.value = h;
|
|
1623
1665
|
});
|
|
1624
1666
|
}
|
|
1625
|
-
const
|
|
1626
|
-
type:
|
|
1667
|
+
const xe = (h, {
|
|
1668
|
+
type: b
|
|
1627
1669
|
}) => {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
reload: M,
|
|
1636
|
-
preview: y,
|
|
1637
|
-
export: v,
|
|
1638
|
-
edit: C,
|
|
1639
|
-
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
|
|
1640
1677
|
});
|
|
1641
|
-
function
|
|
1642
|
-
!
|
|
1678
|
+
function Ce(h, b) {
|
|
1679
|
+
!v || w === "client" || (b ? v.update(h, b === "descend" ? "desc" : "asc") : v.remove(h), L("reload"));
|
|
1643
1680
|
}
|
|
1644
|
-
const
|
|
1681
|
+
const ne = k(me({
|
|
1645
1682
|
columns: e.columns,
|
|
1646
1683
|
columnsOptions: e.columnsOptions,
|
|
1647
1684
|
columnsGroups: e.columnsGroups,
|
|
1648
|
-
pageMode:
|
|
1649
|
-
collapsedColumns:
|
|
1650
|
-
events:
|
|
1651
|
-
})),
|
|
1652
|
-
tableEvents:
|
|
1653
|
-
tableForm:
|
|
1654
|
-
tableSource:
|
|
1655
|
-
formInstance:
|
|
1656
|
-
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,
|
|
1657
1694
|
formOptions: e.formOptions
|
|
1658
|
-
},
|
|
1659
|
-
selectedRowKeys:
|
|
1660
|
-
rowSelection:
|
|
1661
|
-
onSelect:
|
|
1662
|
-
onSelectAll:
|
|
1663
|
-
reloadSelection:
|
|
1664
|
-
resetSelection:
|
|
1665
|
-
} =
|
|
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 = _(() => ({
|
|
1666
1703
|
rowKey: e.rowKey,
|
|
1667
1704
|
size: e.size,
|
|
1668
1705
|
bordered: e.bordered,
|
|
1669
1706
|
hoverable: e.hoverable,
|
|
1670
1707
|
stripe: e.stripe,
|
|
1671
1708
|
scroll: {
|
|
1672
|
-
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),
|
|
1673
1710
|
y: e.height ?? "100%"
|
|
1674
1711
|
},
|
|
1675
|
-
rowSelection:
|
|
1712
|
+
rowSelection: oe,
|
|
1676
1713
|
draggable: e.draggable ? {
|
|
1677
1714
|
type: "handle",
|
|
1678
1715
|
width: 40
|
|
1679
1716
|
} : void 0,
|
|
1680
1717
|
pagination: e.pageable === void 0 || e.pageable === "client",
|
|
1681
|
-
selectedKeys:
|
|
1718
|
+
selectedKeys: re.value,
|
|
1682
1719
|
expandable: e.expandable,
|
|
1683
1720
|
virtualListProps: e.virtualList ? {
|
|
1684
1721
|
height: e.height
|
|
1685
1722
|
} : void 0
|
|
1686
1723
|
}));
|
|
1687
|
-
function
|
|
1688
|
-
|
|
1724
|
+
function Le() {
|
|
1725
|
+
ne.value = me({
|
|
1689
1726
|
columns: e.columns,
|
|
1690
1727
|
columnsOptions: e.columnsOptions,
|
|
1691
1728
|
columnsGroups: e.columnsGroups,
|
|
1692
|
-
pageMode:
|
|
1693
|
-
collapsedColumns:
|
|
1694
|
-
events:
|
|
1729
|
+
pageMode: w,
|
|
1730
|
+
collapsedColumns: d,
|
|
1731
|
+
events: L
|
|
1695
1732
|
});
|
|
1696
1733
|
}
|
|
1697
|
-
return
|
|
1698
|
-
|
|
1734
|
+
return E(() => {
|
|
1735
|
+
a.value && (a.value.id = `table-${n}`), e.autoLoad && C(), e.grabbable && a.value && fn(a.value);
|
|
1699
1736
|
}), {
|
|
1700
|
-
tableId:
|
|
1701
|
-
tableInstance:
|
|
1702
|
-
tableSource:
|
|
1703
|
-
tableOptions:
|
|
1704
|
-
tableColumns:
|
|
1705
|
-
tableEvents:
|
|
1706
|
-
tableForm:
|
|
1707
|
-
tableLoading:
|
|
1708
|
-
modalInstance:
|
|
1709
|
-
tableRenderElement:
|
|
1710
|
-
formSource:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
export: v,
|
|
1719
|
-
onSorterChange: be,
|
|
1720
|
-
onTableChange: ge,
|
|
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,
|
|
1721
1755
|
renders: {
|
|
1722
|
-
renderTableForm:
|
|
1723
|
-
renderTableActions:
|
|
1724
|
-
renderTablePagination:
|
|
1756
|
+
renderTableForm: ke,
|
|
1757
|
+
renderTableActions: Se,
|
|
1758
|
+
renderTablePagination: Me
|
|
1725
1759
|
},
|
|
1726
1760
|
tableSelection: {
|
|
1727
|
-
selectedRowKeys:
|
|
1728
|
-
rowSelection:
|
|
1729
|
-
onSelect:
|
|
1730
|
-
onSelectAll:
|
|
1761
|
+
selectedRowKeys: re,
|
|
1762
|
+
rowSelection: oe,
|
|
1763
|
+
onSelect: Te,
|
|
1764
|
+
onSelectAll: $e
|
|
1731
1765
|
},
|
|
1732
|
-
resetSelection:
|
|
1733
|
-
reloadSelection:
|
|
1734
|
-
reloadColumns:
|
|
1766
|
+
resetSelection: Oe,
|
|
1767
|
+
reloadSelection: _e,
|
|
1768
|
+
reloadColumns: Le
|
|
1735
1769
|
};
|
|
1736
1770
|
},
|
|
1737
1771
|
render() {
|
|
1738
1772
|
this.reloadColumns();
|
|
1739
|
-
const e = () =>
|
|
1773
|
+
const e = () => u("div", {
|
|
1740
1774
|
class: "table-body"
|
|
1741
|
-
}, [
|
|
1775
|
+
}, [u("div", {
|
|
1742
1776
|
class: "table-body-wrapper"
|
|
1743
|
-
}, [
|
|
1777
|
+
}, [u(et, pe({
|
|
1744
1778
|
loading: this.tableLoading,
|
|
1745
1779
|
data: this.tableSource,
|
|
1746
1780
|
columns: this.tableColumns,
|
|
@@ -1753,38 +1787,31 @@ const cr = /* @__PURE__ */ B({
|
|
|
1753
1787
|
selectedKeys: this.tableSelection.selectedRowKeys.value,
|
|
1754
1788
|
"onUpdate:selectedKeys": (t) => this.tableSelection.selectedRowKeys.value = t
|
|
1755
1789
|
}, this.tableOptions), null)])]);
|
|
1756
|
-
return
|
|
1790
|
+
return u("div", {
|
|
1757
1791
|
class: {
|
|
1758
1792
|
"table-render": !0,
|
|
1759
1793
|
"auto-fill": this.autoFill
|
|
1760
1794
|
},
|
|
1761
1795
|
ref: (t) => this.tableRenderElement = t
|
|
1762
|
-
}, [
|
|
1796
|
+
}, [u(nt, {
|
|
1763
1797
|
ref: (t) => this.modalInstance = t
|
|
1764
1798
|
}, {
|
|
1765
|
-
default: () => [
|
|
1799
|
+
default: () => [u("div", {
|
|
1766
1800
|
class: "table-render-content"
|
|
1767
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()])]
|
|
1768
1802
|
})]);
|
|
1769
1803
|
}
|
|
1770
|
-
})
|
|
1771
|
-
function wr(e) {
|
|
1772
|
-
return e;
|
|
1773
|
-
}
|
|
1774
|
-
function vr(e) {
|
|
1775
|
-
return e;
|
|
1776
|
-
}
|
|
1777
|
-
const Cr = {
|
|
1804
|
+
}), jn = {
|
|
1778
1805
|
install(e, t) {
|
|
1779
|
-
e.component("TableRender",
|
|
1806
|
+
e.component("TableRender", xn);
|
|
1780
1807
|
}
|
|
1781
1808
|
};
|
|
1782
1809
|
export {
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
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
|
|
1790
1817
|
};
|