vue-export-table 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -10
- package/dist/DownloadTable.vue.d.ts +11 -5
- package/dist/index.d.ts +5 -1
- package/dist/locale/en-US.d.ts +3 -0
- package/dist/locale/index.d.ts +43 -0
- package/dist/locale/mn-MN.d.ts +3 -0
- package/dist/locale/types.d.ts +36 -0
- package/dist/locale/zh-CN.d.ts +3 -0
- package/dist/types.d.ts +5 -4
- package/dist/useAutoRefresh.d.ts +2 -4
- package/dist/useTable.d.ts +2 -3
- package/dist/vue-export-table.cjs +1 -1
- package/dist/vue-export-table.css +1 -1
- package/dist/vue-export-table.js +312 -273
- package/dist/vue-export-table.umd.js +1 -1
- package/dist/vue-export-table.vue2.cjs +1 -1
- package/dist/vue-export-table.vue2.js +300 -259
- package/dist/vue-export-table.vue2.umd.js +1 -1
- package/package.json +9 -6
|
@@ -1,139 +1,213 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
function
|
|
6
|
-
e.forEach((
|
|
7
|
-
|
|
1
|
+
import { reactive as O, ref as R, computed as C, onMounted as M, onUnmounted as j, defineComponent as B } from "vue-demi";
|
|
2
|
+
import { resolveComponent as m, openBlock as i, createElementBlock as g, renderSlot as N, createVNode as y, withCtx as v, Fragment as U, renderList as I, createBlock as S, createCommentVNode as z, createTextVNode as q, toDisplayString as V, createElementVNode as L, mergeProps as A, toHandlers as K } from "vue";
|
|
3
|
+
function H(e) {
|
|
4
|
+
const t = O({});
|
|
5
|
+
function l() {
|
|
6
|
+
e.forEach((n) => {
|
|
7
|
+
n.defaultValue !== void 0 ? t[n.name] = n.defaultValue : t[n.name] = n.type === "rangePicker" ? [] : void 0;
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
return Object.keys(t).forEach((
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
if (Array.isArray(
|
|
17
|
-
|
|
10
|
+
l();
|
|
11
|
+
function s() {
|
|
12
|
+
const n = {};
|
|
13
|
+
return Object.keys(t).forEach((d) => {
|
|
14
|
+
const c = t[d];
|
|
15
|
+
if (c != null && c !== "") {
|
|
16
|
+
if (Array.isArray(c) && c.length === 0) return;
|
|
17
|
+
n[d] = c;
|
|
18
18
|
}
|
|
19
|
-
}),
|
|
19
|
+
}), n;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function u() {
|
|
22
|
+
l();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
t[
|
|
24
|
+
function p(n, d) {
|
|
25
|
+
t[n] = d;
|
|
26
26
|
}
|
|
27
|
-
return { filters: t, onSearch:
|
|
27
|
+
return { filters: t, onSearch: s, onReset: u, setFilter: p };
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const t =
|
|
29
|
+
function W(e = 10) {
|
|
30
|
+
const t = R(1), l = R(e), s = C(() => ({
|
|
31
31
|
current: t.value,
|
|
32
|
-
pageSize:
|
|
32
|
+
pageSize: l.value
|
|
33
33
|
}));
|
|
34
|
-
function
|
|
35
|
-
t.value =
|
|
34
|
+
function u(n, d) {
|
|
35
|
+
t.value = n, d !== l.value && (l.value = d, t.value = 1);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function p() {
|
|
38
38
|
t.value = 1;
|
|
39
39
|
}
|
|
40
|
-
return { currentPage: t, pageSize:
|
|
40
|
+
return { currentPage: t, pageSize: l, pagination: s, onPageChange: u, resetPage: p };
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, 1e3));
|
|
49
|
-
}
|
|
50
|
-
function o() {
|
|
51
|
-
d && (clearInterval(d), d = null);
|
|
52
|
-
}
|
|
53
|
-
function s(w) {
|
|
54
|
-
n.value = w ?? !n.value, n.value ? c() : (o(), r.value = e.interval);
|
|
42
|
+
function G(e, t) {
|
|
43
|
+
let l = null;
|
|
44
|
+
function s() {
|
|
45
|
+
u(), !(e.interval <= 0) && (l = setInterval(() => {
|
|
46
|
+
t();
|
|
47
|
+
}, e.interval * 1e3));
|
|
55
48
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
49
|
+
function u() {
|
|
50
|
+
l && (clearInterval(l), l = null);
|
|
58
51
|
}
|
|
59
52
|
function p() {
|
|
60
|
-
|
|
53
|
+
document.hidden ? u() : s();
|
|
61
54
|
}
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
}), {
|
|
55
|
+
return M(() => {
|
|
56
|
+
e.interval > 0 && (s(), document.addEventListener("visibilitychange", p));
|
|
57
|
+
}), j(() => {
|
|
58
|
+
u(), document.removeEventListener("visibilitychange", p);
|
|
59
|
+
}), { stopTimer: u, startTimer: s };
|
|
67
60
|
}
|
|
68
|
-
function
|
|
69
|
-
const t =
|
|
70
|
-
interval:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
S,
|
|
61
|
+
function J(e) {
|
|
62
|
+
const t = R(!1), l = R([]), s = R(0), { filters: u, onSearch: p, onReset: n, setFilter: d } = H(e.queryFields ?? []), { currentPage: c, pageSize: b, pagination: P, onPageChange: D, resetPage: w } = W(e.pageSize ?? 10), k = e.autoRefresh ?? {
|
|
63
|
+
interval: 30
|
|
64
|
+
}, { stopTimer: T, startTimer: F } = G(
|
|
65
|
+
k,
|
|
74
66
|
() => {
|
|
75
|
-
|
|
67
|
+
h();
|
|
76
68
|
}
|
|
77
69
|
);
|
|
78
|
-
async function
|
|
70
|
+
async function h() {
|
|
79
71
|
t.value = !0;
|
|
80
72
|
try {
|
|
81
|
-
const
|
|
82
|
-
page:
|
|
83
|
-
pageSize:
|
|
84
|
-
filters:
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
} catch (
|
|
88
|
-
console.error("[VueExportTable] fetch error:",
|
|
73
|
+
const f = {
|
|
74
|
+
page: c.value,
|
|
75
|
+
pageSize: b.value,
|
|
76
|
+
filters: p()
|
|
77
|
+
}, $ = await e.fetchData(f);
|
|
78
|
+
l.value = $.list, s.value = $.total;
|
|
79
|
+
} catch (f) {
|
|
80
|
+
console.error("[VueExportTable] fetch error:", f);
|
|
89
81
|
} finally {
|
|
90
82
|
t.value = !1;
|
|
91
83
|
}
|
|
92
84
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
85
|
+
function r() {
|
|
86
|
+
w(), h();
|
|
95
87
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
88
|
+
function a() {
|
|
89
|
+
n(), w(), h();
|
|
98
90
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
91
|
+
function o(f, $) {
|
|
92
|
+
D(f, $), h();
|
|
101
93
|
}
|
|
102
|
-
return
|
|
103
|
-
e.immediate !== !1 &&
|
|
94
|
+
return M(() => {
|
|
95
|
+
e.immediate !== !1 && h();
|
|
104
96
|
}), {
|
|
105
97
|
// 状态
|
|
106
98
|
loading: t,
|
|
107
|
-
data:
|
|
108
|
-
total:
|
|
109
|
-
filters:
|
|
110
|
-
pagination:
|
|
111
|
-
currentPage:
|
|
112
|
-
pageSize:
|
|
99
|
+
data: l,
|
|
100
|
+
total: s,
|
|
101
|
+
filters: u,
|
|
102
|
+
pagination: P,
|
|
103
|
+
currentPage: c,
|
|
104
|
+
pageSize: b,
|
|
113
105
|
// 查询
|
|
114
|
-
handleSearch:
|
|
115
|
-
handleReset:
|
|
116
|
-
setFilter:
|
|
106
|
+
handleSearch: r,
|
|
107
|
+
handleReset: a,
|
|
108
|
+
setFilter: d,
|
|
117
109
|
// 分页
|
|
118
|
-
handlePageChange:
|
|
110
|
+
handlePageChange: o,
|
|
119
111
|
// 刷新
|
|
120
|
-
refresh:
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
112
|
+
refresh: h,
|
|
113
|
+
// 自动刷新控制
|
|
114
|
+
stopAutoRefresh: T,
|
|
115
|
+
startAutoRefresh: F
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const X = {
|
|
119
|
+
placeholder: {
|
|
120
|
+
input: (e) => `请输入${e}`,
|
|
121
|
+
select: (e) => `请选择${e}`,
|
|
122
|
+
startDate: "开始日期",
|
|
123
|
+
endDate: "结束日期"
|
|
124
|
+
},
|
|
125
|
+
button: {
|
|
126
|
+
search: "查询",
|
|
127
|
+
reset: "重置",
|
|
128
|
+
download: "下载"
|
|
129
|
+
},
|
|
130
|
+
pagination: {
|
|
131
|
+
itemsPerPage: "条/页",
|
|
132
|
+
showTotal: (e) => `共 ${e} 条`
|
|
133
|
+
},
|
|
134
|
+
status: {
|
|
135
|
+
running: "运行中",
|
|
136
|
+
failed: "失败",
|
|
137
|
+
completed: "已完成"
|
|
138
|
+
},
|
|
139
|
+
columns: {
|
|
140
|
+
moduleName: "功能模块",
|
|
141
|
+
fileName: "文件名称",
|
|
142
|
+
operateTime: "操作时间",
|
|
143
|
+
completeTime: "完成时间",
|
|
144
|
+
status: "状态",
|
|
145
|
+
remark: "备注",
|
|
146
|
+
username: "用户名",
|
|
147
|
+
action: "操作"
|
|
148
|
+
},
|
|
149
|
+
queryFields: {
|
|
150
|
+
fileName: "文件名称",
|
|
151
|
+
fileNamePlaceholder: "请输入文件名称"
|
|
152
|
+
}
|
|
153
|
+
}, Q = O({ ...X });
|
|
154
|
+
function Y(e) {
|
|
155
|
+
Object.assign(Q, e);
|
|
156
|
+
}
|
|
157
|
+
function Z() {
|
|
158
|
+
return Q;
|
|
159
|
+
}
|
|
160
|
+
const _ = {
|
|
161
|
+
running: "blue",
|
|
162
|
+
failed: "red",
|
|
163
|
+
completed: "green"
|
|
164
|
+
};
|
|
165
|
+
function x(e) {
|
|
166
|
+
return {
|
|
167
|
+
running: e.status.running,
|
|
168
|
+
// 运行中
|
|
169
|
+
failed: e.status.failed,
|
|
170
|
+
// 失败
|
|
171
|
+
completed: e.status.completed
|
|
172
|
+
// 已完成
|
|
125
173
|
};
|
|
126
174
|
}
|
|
127
|
-
|
|
175
|
+
function ee(e) {
|
|
176
|
+
return [
|
|
177
|
+
{ title: e.columns.moduleName, dataIndex: "moduleName", width: 150 },
|
|
178
|
+
// 功能模块
|
|
179
|
+
{ title: e.columns.fileName, dataIndex: "fileName", width: 200 },
|
|
180
|
+
// 文件名称
|
|
181
|
+
{ title: e.columns.operateTime, dataIndex: "operateTime", width: 180 },
|
|
182
|
+
// 操作时间
|
|
183
|
+
{ title: e.columns.completeTime, dataIndex: "completeTime", width: 180 },
|
|
184
|
+
// 完成时间
|
|
185
|
+
{ title: e.columns.status, dataIndex: "status", width: 100 },
|
|
186
|
+
// 状态
|
|
187
|
+
{ title: e.columns.remark, dataIndex: "remark", width: 200 },
|
|
188
|
+
// 备注
|
|
189
|
+
{ title: e.columns.username, dataIndex: "username", width: 120 },
|
|
190
|
+
// 用户名
|
|
191
|
+
{ title: e.columns.action, dataIndex: "action", width: 100, fixed: "right" }
|
|
192
|
+
// 操作
|
|
193
|
+
];
|
|
194
|
+
}
|
|
195
|
+
function E(e) {
|
|
196
|
+
return [
|
|
197
|
+
{ name: "fileName", label: e.queryFields.fileName, type: "input", placeholder: e.queryFields.fileNamePlaceholder }
|
|
198
|
+
// 文件名称
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
const ae = B({
|
|
128
202
|
name: "DownloadTable",
|
|
129
203
|
props: {
|
|
130
204
|
columns: {
|
|
131
205
|
type: Array,
|
|
132
|
-
|
|
206
|
+
default: void 0
|
|
133
207
|
},
|
|
134
208
|
queryFields: {
|
|
135
209
|
type: Array,
|
|
136
|
-
default:
|
|
210
|
+
default: void 0
|
|
137
211
|
},
|
|
138
212
|
fetchData: {
|
|
139
213
|
type: Function,
|
|
@@ -163,169 +237,153 @@ const J = L({
|
|
|
163
237
|
type: Number,
|
|
164
238
|
default: 10
|
|
165
239
|
},
|
|
166
|
-
showIndex: {
|
|
167
|
-
type: Boolean,
|
|
168
|
-
default: !1
|
|
169
|
-
},
|
|
170
240
|
immediate: {
|
|
171
241
|
type: Boolean,
|
|
172
242
|
default: !0
|
|
173
243
|
}
|
|
174
244
|
},
|
|
175
245
|
setup(e, { slots: t }) {
|
|
176
|
-
const {
|
|
177
|
-
loading:
|
|
178
|
-
data:
|
|
179
|
-
total:
|
|
180
|
-
filters:
|
|
181
|
-
currentPage:
|
|
182
|
-
pageSize:
|
|
183
|
-
handleSearch:
|
|
184
|
-
handleReset:
|
|
185
|
-
handlePageChange:
|
|
186
|
-
refresh:
|
|
187
|
-
|
|
188
|
-
countdown: S,
|
|
189
|
-
toggleAutoRefresh: P
|
|
190
|
-
} = G({
|
|
246
|
+
const l = Z(), {
|
|
247
|
+
loading: s,
|
|
248
|
+
data: u,
|
|
249
|
+
total: p,
|
|
250
|
+
filters: n,
|
|
251
|
+
currentPage: d,
|
|
252
|
+
pageSize: c,
|
|
253
|
+
handleSearch: b,
|
|
254
|
+
handleReset: P,
|
|
255
|
+
handlePageChange: D,
|
|
256
|
+
refresh: w
|
|
257
|
+
} = J({
|
|
191
258
|
fetchData: e.fetchData,
|
|
192
|
-
queryFields: e.queryFields,
|
|
259
|
+
queryFields: e.queryFields ?? E(l),
|
|
193
260
|
pageSize: e.pageSize,
|
|
194
261
|
autoRefresh: e.autoRefresh,
|
|
195
262
|
immediate: e.immediate
|
|
196
|
-
}),
|
|
197
|
-
const
|
|
198
|
-
return
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
align: "center",
|
|
204
|
-
customRender: ({ index: l }) => (o.value - 1) * s.value + l + 1
|
|
205
|
-
}), [...a, ...e.columns];
|
|
206
|
-
}), $ = E(() => {
|
|
207
|
-
const a = D.value.reduce((l, y) => {
|
|
208
|
-
const A = typeof y.width == "number" ? y.width : 0;
|
|
209
|
-
return l + A;
|
|
263
|
+
}), k = C(() => {
|
|
264
|
+
const r = e.columns;
|
|
265
|
+
return r && r.length > 0 ? r : ee(l);
|
|
266
|
+
}), T = C(() => e.queryFields ?? E(l)), F = C(() => {
|
|
267
|
+
const r = k.value.reduce((a, o) => {
|
|
268
|
+
const f = typeof o.width == "number" ? o.width : 0;
|
|
269
|
+
return a + f;
|
|
210
270
|
}, 0);
|
|
211
|
-
return
|
|
212
|
-
}),
|
|
213
|
-
const
|
|
214
|
-
return Object.keys(t).forEach((
|
|
215
|
-
|
|
216
|
-
}),
|
|
271
|
+
return r > 0 ? { x: r } : void 0;
|
|
272
|
+
}), h = C(() => {
|
|
273
|
+
const r = ["query-form", "toolbar"], a = {};
|
|
274
|
+
return Object.keys(t).forEach((o) => {
|
|
275
|
+
r.includes(o) || (a[o] = !0);
|
|
276
|
+
}), a;
|
|
217
277
|
});
|
|
218
278
|
return {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
279
|
+
locale: l,
|
|
280
|
+
loading: s,
|
|
281
|
+
data: u,
|
|
282
|
+
total: p,
|
|
283
|
+
filters: n,
|
|
284
|
+
currentPage: d,
|
|
285
|
+
pageSize: c,
|
|
286
|
+
handleSearch: b,
|
|
287
|
+
handleReset: P,
|
|
288
|
+
handlePageChange: D,
|
|
289
|
+
refresh: w,
|
|
290
|
+
download: C(() => e.download),
|
|
291
|
+
canDownload: (r) => e.download ? e.download.canDownload ? e.download.canDownload(r) : r && r.status === "completed" : !1,
|
|
292
|
+
columns: k,
|
|
293
|
+
effectiveQueryFields: T,
|
|
294
|
+
statusColorMap: _,
|
|
295
|
+
statusLabelMap: x(l),
|
|
296
|
+
scroll: F,
|
|
297
|
+
filteredSlots: h
|
|
237
298
|
};
|
|
238
299
|
}
|
|
239
|
-
}),
|
|
240
|
-
const
|
|
241
|
-
for (const [
|
|
242
|
-
|
|
243
|
-
return
|
|
244
|
-
},
|
|
300
|
+
}), te = (e, t) => {
|
|
301
|
+
const l = e.__vccOpts || e;
|
|
302
|
+
for (const [s, u] of t)
|
|
303
|
+
l[s] = u;
|
|
304
|
+
return l;
|
|
305
|
+
}, le = { class: "vet-download-table-wrapper" }, oe = {
|
|
245
306
|
key: 0,
|
|
246
307
|
class: "vet-query-form-wrapper"
|
|
247
|
-
},
|
|
248
|
-
key: 0,
|
|
249
|
-
class: "vet-table-title"
|
|
250
|
-
}, te = { class: "vet-toolbar-right" }, ne = {
|
|
251
|
-
key: 1,
|
|
252
|
-
class: "vet-countdown-text"
|
|
253
|
-
}, oe = {
|
|
308
|
+
}, ne = {
|
|
254
309
|
key: 1,
|
|
310
|
+
class: "vet-toolbar-wrapper"
|
|
311
|
+
}, re = { class: "vet-toolbar-left" }, se = { class: "vet-table-title" }, ue = {
|
|
312
|
+
key: 2,
|
|
255
313
|
class: "vet-pagination-wrapper"
|
|
256
314
|
};
|
|
257
|
-
function
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
e.
|
|
261
|
-
|
|
315
|
+
function ie(e, t, l, s, u, p) {
|
|
316
|
+
const n = m("a-input"), d = m("a-input-number"), c = m("a-select"), b = m("a-date-picker"), P = m("a-range-picker"), D = m("a-form-item"), w = m("a-button"), k = m("a-space"), T = m("a-form"), F = m("a-tag"), h = m("a-table"), r = m("a-pagination");
|
|
317
|
+
return i(), g("div", le, [
|
|
318
|
+
e.effectiveQueryFields && e.effectiveQueryFields.length > 0 ? (i(), g("div", oe, [
|
|
319
|
+
N(e.$slots, "query-form", {
|
|
262
320
|
filters: e.filters,
|
|
263
321
|
handleSearch: e.handleSearch,
|
|
264
322
|
handleReset: e.handleReset
|
|
265
323
|
}, () => [
|
|
266
|
-
|
|
324
|
+
y(T, {
|
|
267
325
|
layout: "inline",
|
|
268
326
|
model: e.filters
|
|
269
327
|
}, {
|
|
270
328
|
default: v(() => [
|
|
271
|
-
(
|
|
329
|
+
(i(!0), g(U, null, I(e.effectiveQueryFields, (a) => (i(), S(D, {
|
|
272
330
|
key: a.name,
|
|
273
331
|
label: a.label
|
|
274
332
|
}, {
|
|
275
333
|
default: v(() => [
|
|
276
|
-
a.type === "input" ? (
|
|
334
|
+
a.type === "input" ? (i(), S(n, {
|
|
277
335
|
key: 0,
|
|
278
336
|
modelValue: e.filters[a.name],
|
|
279
|
-
"onUpdate:modelValue": (
|
|
280
|
-
placeholder: a.placeholder ||
|
|
337
|
+
"onUpdate:modelValue": (o) => e.filters[a.name] = o,
|
|
338
|
+
placeholder: a.placeholder || e.locale.placeholder.input(a.label),
|
|
281
339
|
"allow-clear": ""
|
|
282
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : a.type === "number" ? (
|
|
340
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : a.type === "number" ? (i(), S(d, {
|
|
283
341
|
key: 1,
|
|
284
342
|
modelValue: e.filters[a.name],
|
|
285
|
-
"onUpdate:modelValue": (
|
|
286
|
-
placeholder: a.placeholder ||
|
|
343
|
+
"onUpdate:modelValue": (o) => e.filters[a.name] = o,
|
|
344
|
+
placeholder: a.placeholder || e.locale.placeholder.input(a.label),
|
|
287
345
|
style: { width: "180px" }
|
|
288
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : a.type === "select" ? (
|
|
346
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : a.type === "select" ? (i(), S(c, {
|
|
289
347
|
key: 2,
|
|
290
348
|
modelValue: e.filters[a.name],
|
|
291
|
-
"onUpdate:modelValue": (
|
|
292
|
-
placeholder: a.placeholder ||
|
|
349
|
+
"onUpdate:modelValue": (o) => e.filters[a.name] = o,
|
|
350
|
+
placeholder: a.placeholder || e.locale.placeholder.select(a.label),
|
|
293
351
|
options: a.options,
|
|
294
352
|
"allow-clear": "",
|
|
295
353
|
style: { "min-width": "150px" }
|
|
296
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "options"])) : a.type === "datePicker" ? (
|
|
354
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "options"])) : a.type === "datePicker" ? (i(), S(b, {
|
|
297
355
|
key: 3,
|
|
298
356
|
modelValue: e.filters[a.name],
|
|
299
|
-
"onUpdate:modelValue": (
|
|
300
|
-
placeholder: a.placeholder ||
|
|
357
|
+
"onUpdate:modelValue": (o) => e.filters[a.name] = o,
|
|
358
|
+
placeholder: a.placeholder || e.locale.placeholder.select(a.label),
|
|
301
359
|
style: { width: "180px" }
|
|
302
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : a.type === "rangePicker" ? (
|
|
360
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : a.type === "rangePicker" ? (i(), S(P, {
|
|
303
361
|
key: 4,
|
|
304
362
|
modelValue: e.filters[a.name],
|
|
305
|
-
"onUpdate:modelValue": (
|
|
306
|
-
placeholder: [a.placeholder ||
|
|
363
|
+
"onUpdate:modelValue": (o) => e.filters[a.name] = o,
|
|
364
|
+
placeholder: [a.placeholder || e.locale.placeholder.startDate, a.placeholder || e.locale.placeholder.endDate],
|
|
307
365
|
style: { width: "240px" }
|
|
308
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) :
|
|
366
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : z("", !0)
|
|
309
367
|
]),
|
|
310
368
|
_: 2
|
|
311
369
|
}, 1032, ["label"]))), 128)),
|
|
312
|
-
|
|
370
|
+
y(D, null, {
|
|
313
371
|
default: v(() => [
|
|
314
|
-
|
|
372
|
+
y(k, null, {
|
|
315
373
|
default: v(() => [
|
|
316
|
-
|
|
374
|
+
y(w, {
|
|
317
375
|
type: "primary",
|
|
318
376
|
onClick: e.handleSearch
|
|
319
377
|
}, {
|
|
320
|
-
default: v(() => [
|
|
321
|
-
|
|
322
|
-
])
|
|
378
|
+
default: v(() => [
|
|
379
|
+
q(V(e.locale.button.search), 1)
|
|
380
|
+
]),
|
|
323
381
|
_: 1
|
|
324
382
|
}, 8, ["onClick"]),
|
|
325
|
-
|
|
326
|
-
default: v(() => [
|
|
327
|
-
|
|
328
|
-
])
|
|
383
|
+
y(w, { onClick: e.handleReset }, {
|
|
384
|
+
default: v(() => [
|
|
385
|
+
q(V(e.locale.button.reset), 1)
|
|
386
|
+
]),
|
|
329
387
|
_: 1
|
|
330
388
|
}, 8, ["onClick"])
|
|
331
389
|
]),
|
|
@@ -338,53 +396,20 @@ function le(e, t, n, r, d, c) {
|
|
|
338
396
|
_: 1
|
|
339
397
|
}, 8, ["model"])
|
|
340
398
|
])
|
|
341
|
-
])) :
|
|
342
|
-
|
|
343
|
-
|
|
399
|
+
])) : z("", !0),
|
|
400
|
+
e.title ? (i(), g("div", ne, [
|
|
401
|
+
N(e.$slots, "toolbar", {
|
|
344
402
|
loading: e.loading,
|
|
345
403
|
refresh: e.refresh
|
|
346
404
|
}, () => [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
]),
|
|
350
|
-
q("div", te, [
|
|
351
|
-
f(S, null, {
|
|
352
|
-
default: v(() => [
|
|
353
|
-
f(g, {
|
|
354
|
-
loading: e.loading,
|
|
355
|
-
onClick: e.refresh
|
|
356
|
-
}, {
|
|
357
|
-
default: v(() => [...t[3] || (t[3] = [
|
|
358
|
-
q("svg", {
|
|
359
|
-
class: "vet-icon-svg",
|
|
360
|
-
viewBox: "64 64 896 896",
|
|
361
|
-
width: "1em",
|
|
362
|
-
height: "1em",
|
|
363
|
-
fill: "currentColor"
|
|
364
|
-
}, [
|
|
365
|
-
q("path", { d: "M909.1 209.3l-56.4 44.1C775.8 155.1 653.5 96 512 96 282.7 96 96 282.7 96 512s186.7 416 416 416c165.3 0 309.1-96.4 376-236.1 8.3-17.2-4.3-37.1-23.1-37.1H745.6c-9.2 0-17.2 5.8-20.3 14.3C680.5 773.5 600.5 832 512 832c-176.7 0-320-143.3-320-320s143.3-320 320-320c88.5 0 168.5 36.1 226.4 94.3L704 356.3c-4.7-4.7-1.3-12.7 5.3-13.1l193.7-12.5c6.6-.4 12.3 4.9 12.3 11.5v193.7c0 6.6-8 10-12.7 5.3z" })
|
|
366
|
-
], -1),
|
|
367
|
-
T(" 刷新 ", -1)
|
|
368
|
-
])]),
|
|
369
|
-
_: 1
|
|
370
|
-
}, 8, ["loading", "onClick"]),
|
|
371
|
-
e.autoRefresh ? (u(), b(D, {
|
|
372
|
-
key: 0,
|
|
373
|
-
checked: e.autoRefreshEnabled,
|
|
374
|
-
"checked-children": "自动刷新",
|
|
375
|
-
"un-checked-children": "自动刷新",
|
|
376
|
-
onChange: e.toggleAutoRefresh
|
|
377
|
-
}, null, 8, ["checked", "onChange"])) : k("", !0),
|
|
378
|
-
e.autoRefresh && e.autoRefreshEnabled ? (u(), m("span", ne, O(e.countdown) + "s ", 1)) : k("", !0)
|
|
379
|
-
]),
|
|
380
|
-
_: 1
|
|
381
|
-
})
|
|
405
|
+
L("div", re, [
|
|
406
|
+
L("span", se, V(e.title), 1)
|
|
382
407
|
])
|
|
383
408
|
])
|
|
384
|
-
]),
|
|
385
|
-
|
|
409
|
+
])) : z("", !0),
|
|
410
|
+
y(h, A({
|
|
386
411
|
"data-source": e.data,
|
|
387
|
-
columns: e.
|
|
412
|
+
columns: e.columns,
|
|
388
413
|
loading: e.loading,
|
|
389
414
|
pagination: !1,
|
|
390
415
|
"row-key": e.rowKey,
|
|
@@ -392,51 +417,67 @@ function le(e, t, n, r, d, c) {
|
|
|
392
417
|
scroll: e.scroll
|
|
393
418
|
}, e.$attrs, K(e.$listeners)), {
|
|
394
419
|
default: v(() => [
|
|
395
|
-
(
|
|
396
|
-
|
|
420
|
+
(i(!0), g(U, null, I(e.filteredSlots, (a, o) => (i(), g(U, null, [
|
|
421
|
+
o === "action" ? N(e.$slots, "action", {
|
|
397
422
|
key: 0,
|
|
398
423
|
record: e.slotData && e.slotData.record,
|
|
399
424
|
index: e.slotData && e.slotData.index
|
|
400
425
|
}, () => [
|
|
401
|
-
e.download && e.canDownload(e.slotData && e.slotData.record) ? (
|
|
426
|
+
e.download && e.canDownload(e.slotData && e.slotData.record) ? (i(), g("a", {
|
|
402
427
|
key: 0,
|
|
403
|
-
onClick: t[0] || (t[0] = (
|
|
404
|
-
},
|
|
405
|
-
]) :
|
|
428
|
+
onClick: t[0] || (t[0] = (f) => e.download.handleDownload(e.slotData.record))
|
|
429
|
+
}, V(e.locale.button.download), 1)) : z("", !0)
|
|
430
|
+
]) : o === "status" ? N(e.$slots, "status", {
|
|
406
431
|
key: 1,
|
|
432
|
+
record: e.slotData && e.slotData.record,
|
|
433
|
+
index: e.slotData && e.slotData.index
|
|
434
|
+
}, () => [
|
|
435
|
+
y(F, {
|
|
436
|
+
color: e.statusColorMap[e.slotData && e.slotData.text] || "default"
|
|
437
|
+
}, {
|
|
438
|
+
default: v(() => [
|
|
439
|
+
q(V(e.statusLabelMap[e.slotData && e.slotData.text] || e.slotData && e.slotData.text), 1)
|
|
440
|
+
]),
|
|
441
|
+
_: 1
|
|
442
|
+
}, 8, ["color"])
|
|
443
|
+
]) : N(e.$slots, o, A({
|
|
444
|
+
key: 2,
|
|
407
445
|
ref_for: !0
|
|
408
446
|
}, e.slotData || {}), () => [
|
|
409
|
-
|
|
447
|
+
q(V(e.slotData ? e.slotData.text : ""), 1)
|
|
410
448
|
])
|
|
411
449
|
], 64))), 256))
|
|
412
450
|
]),
|
|
413
451
|
_: 3
|
|
414
452
|
}, 16, ["data-source", "columns", "loading", "row-key", "bordered", "scroll"]),
|
|
415
|
-
e.total > 0 ? (
|
|
416
|
-
|
|
453
|
+
e.total > 0 ? (i(), g("div", ue, [
|
|
454
|
+
y(r, {
|
|
417
455
|
current: e.currentPage,
|
|
418
456
|
"page-size": e.pageSize,
|
|
419
457
|
total: e.total,
|
|
420
458
|
"show-size-changer": !0,
|
|
421
|
-
"
|
|
422
|
-
|
|
459
|
+
"page-size-options": ["10", "20", "50"],
|
|
460
|
+
locale: { items_per_page: e.locale.pagination.itemsPerPage },
|
|
461
|
+
"show-total": e.locale.pagination.showTotal,
|
|
423
462
|
onChange: e.handlePageChange,
|
|
424
463
|
onShowSizeChange: e.handlePageChange
|
|
425
|
-
}, null, 8, ["current", "page-size", "total", "show-total", "onChange", "onShowSizeChange"])
|
|
426
|
-
])) :
|
|
464
|
+
}, null, 8, ["current", "page-size", "total", "locale", "show-total", "onChange", "onShowSizeChange"])
|
|
465
|
+
])) : z("", !0)
|
|
427
466
|
]);
|
|
428
467
|
}
|
|
429
|
-
const
|
|
430
|
-
install(e) {
|
|
431
|
-
e.component("DownloadTable",
|
|
468
|
+
const de = /* @__PURE__ */ te(ae, [["render", ie]]), pe = {
|
|
469
|
+
install(e, t) {
|
|
470
|
+
e.component("DownloadTable", de), t != null && t.locale && Y(t.locale);
|
|
432
471
|
}
|
|
433
472
|
};
|
|
434
473
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
474
|
+
de as DownloadTable,
|
|
475
|
+
pe as VueExportTable,
|
|
476
|
+
pe as default,
|
|
477
|
+
Y as setLocale,
|
|
478
|
+
G as useAutoRefresh,
|
|
479
|
+
Z as useLocale,
|
|
480
|
+
W as usePagination,
|
|
481
|
+
H as useQuery,
|
|
482
|
+
J as useTable
|
|
442
483
|
};
|