vue-export-table 1.1.2 → 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.
@@ -1,139 +1,213 @@
1
- import { reactive as N, ref as C, computed as E, onMounted as j, onUnmounted as H, defineComponent as L } from "vue-demi";
2
- import { resolveComponent as h, openBlock as s, createElementBlock as m, renderSlot as U, createVNode as f, withCtx as g, Fragment as _, renderList as O, createBlock as b, createCommentVNode as k, createTextVNode as T, createElementVNode as q, toDisplayString as B, mergeProps as I, toHandlers as K } from "vue";
3
- function M(e) {
4
- const t = N({});
5
- function n() {
6
- e.forEach((o) => {
7
- o.defaultValue !== void 0 ? t[o.name] = o.defaultValue : t[o.name] = o.type === "rangePicker" ? [] : void 0;
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
- n();
11
- function r() {
12
- const o = {};
13
- return Object.keys(t).forEach((u) => {
14
- const i = t[u];
15
- if (i != null && i !== "") {
16
- if (Array.isArray(i) && i.length === 0) return;
17
- o[u] = i;
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
- }), o;
19
+ }), n;
20
20
  }
21
- function d() {
22
- n();
21
+ function u() {
22
+ l();
23
23
  }
24
- function c(o, u) {
25
- t[o] = u;
24
+ function p(n, d) {
25
+ t[n] = d;
26
26
  }
27
- return { filters: t, onSearch: r, onReset: d, setFilter: c };
27
+ return { filters: t, onSearch: s, onReset: u, setFilter: p };
28
28
  }
29
- function Q(e = 10) {
30
- const t = C(1), n = C(e), r = E(() => ({
29
+ function W(e = 10) {
30
+ const t = R(1), l = R(e), s = C(() => ({
31
31
  current: t.value,
32
- pageSize: n.value
32
+ pageSize: l.value
33
33
  }));
34
- function d(o, u) {
35
- t.value = o, u !== n.value && (n.value = u, t.value = 1);
34
+ function u(n, d) {
35
+ t.value = n, d !== l.value && (l.value = d, t.value = 1);
36
36
  }
37
- function c() {
37
+ function p() {
38
38
  t.value = 1;
39
39
  }
40
- return { currentPage: t, pageSize: n, pagination: r, onPageChange: d, resetPage: c };
40
+ return { currentPage: t, pageSize: l, pagination: s, onPageChange: u, resetPage: p };
41
41
  }
42
- function W(e, t) {
43
- const n = C(e.enabled ?? e.interval > 0), r = C(e.interval);
44
- let d = null;
45
- function c() {
46
- o(), !(!n.value || e.interval <= 0) && (r.value = e.interval, d = setInterval(() => {
47
- r.value -= 1, r.value <= 0 && (r.value = e.interval, t());
48
- }, 1e3));
49
- }
50
- function o() {
51
- d && (clearInterval(d), d = null);
52
- }
53
- function u(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 i() {
57
- n.value && (r.value = e.interval);
49
+ function u() {
50
+ l && (clearInterval(l), l = null);
58
51
  }
59
52
  function p() {
60
- e.pauseOnHidden && (document.hidden ? o() : n.value && c());
53
+ document.hidden ? u() : s();
61
54
  }
62
- return j(() => {
63
- n.value && e.interval > 0 && (c(), e.pauseOnHidden && document.addEventListener("visibilitychange", p));
64
- }), H(() => {
65
- o(), document.removeEventListener("visibilitychange", p);
66
- }), { enabled: n, countdown: r, toggle: u, resetCountdown: i };
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 G(e) {
69
- const t = C(!1), n = C([]), r = C(0), { filters: d, onSearch: c, onReset: o, setFilter: u } = M(e.queryFields ?? []), { currentPage: i, pageSize: p, pagination: w, onPageChange: V, resetPage: v } = Q(e.pageSize ?? 10), S = e.autoRefresh ?? {
70
- interval: 0,
71
- enabled: !1
72
- }, { enabled: P, countdown: D, toggle: $, resetCountdown: R } = W(
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
- a();
67
+ h();
76
68
  }
77
69
  );
78
- async function a() {
70
+ async function h() {
79
71
  t.value = !0;
80
72
  try {
81
- const z = {
82
- page: i.value,
83
- pageSize: p.value,
84
- filters: c()
85
- }, F = await e.fetchData(z);
86
- n.value = F.list, r.value = F.total;
87
- } catch (z) {
88
- console.error("[VueExportTable] fetch error:", z);
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 l() {
94
- v(), a(), R();
85
+ function r() {
86
+ w(), h();
95
87
  }
96
- function y() {
97
- o(), v(), a();
88
+ function a() {
89
+ n(), w(), h();
98
90
  }
99
- function A(z, F) {
100
- V(z, F), a(), R();
91
+ function o(f, $) {
92
+ D(f, $), h();
101
93
  }
102
- return j(() => {
103
- e.immediate !== !1 && a();
94
+ return M(() => {
95
+ e.immediate !== !1 && h();
104
96
  }), {
105
97
  // 状态
106
98
  loading: t,
107
- data: n,
108
- total: r,
109
- filters: d,
110
- pagination: w,
111
- currentPage: i,
112
- pageSize: p,
99
+ data: l,
100
+ total: s,
101
+ filters: u,
102
+ pagination: P,
103
+ currentPage: c,
104
+ pageSize: b,
113
105
  // 查询
114
- handleSearch: l,
115
- handleReset: y,
116
- setFilter: u,
106
+ handleSearch: r,
107
+ handleReset: a,
108
+ setFilter: d,
117
109
  // 分页
118
- handlePageChange: A,
110
+ handlePageChange: o,
119
111
  // 刷新
120
- refresh: a,
121
- // 自动刷新
122
- autoRefreshEnabled: P,
123
- countdown: D,
124
- toggleAutoRefresh: $
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
- const J = L({
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
- required: !0
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: n,
178
- data: r,
179
- total: d,
180
- filters: c,
181
- currentPage: o,
182
- pageSize: u,
183
- handleSearch: i,
184
- handleReset: p,
185
- handlePageChange: w,
186
- refresh: V,
187
- autoRefreshEnabled: v,
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
- }), D = E(() => {
197
- const a = [];
198
- return e.showIndex && a.push({
199
- title: "序号",
200
- dataIndex: "index",
201
- key: "index",
202
- width: 80,
203
- align: "center",
204
- customRender: ({ index: l }) => (o.value - 1) * u.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 a > 0 ? { x: a } : void 0;
212
- }), R = E(() => {
213
- const a = ["query-form", "toolbar"], l = {};
214
- return Object.keys(t).forEach((y) => {
215
- a.includes(y) || (l[y] = !0);
216
- }), l;
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
- loading: n,
220
- data: r,
221
- total: d,
222
- filters: c,
223
- currentPage: o,
224
- pageSize: u,
225
- handleSearch: i,
226
- handleReset: p,
227
- handlePageChange: w,
228
- refresh: V,
229
- download: E(() => e.download),
230
- canDownload: (a) => e.download ? e.download.canDownload ? e.download.canDownload(a) : a && a.status === "completed" : !1,
231
- autoRefreshEnabled: v,
232
- countdown: S,
233
- toggleAutoRefresh: P,
234
- computedColumns: D,
235
- scroll: $,
236
- filteredSlots: R
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
- }), X = (e, t) => {
240
- const n = e.__vccOpts || e;
241
- for (const [r, d] of t)
242
- n[r] = d;
243
- return n;
244
- }, Y = { class: "download-table-wrapper" }, Z = {
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
- class: "query-form-wrapper"
247
- }, x = { class: "toolbar-wrapper" }, ee = { class: "toolbar-left" }, ae = {
248
- key: 0,
249
- class: "table-title"
250
- }, te = { class: "toolbar-right" }, ne = {
251
- key: 1,
252
- class: "countdown-text"
253
- }, oe = {
307
+ class: "vet-query-form-wrapper"
308
+ }, ne = {
254
309
  key: 1,
255
- class: "pagination-wrapper"
310
+ class: "vet-toolbar-wrapper"
311
+ }, re = { class: "vet-toolbar-left" }, se = { class: "vet-table-title" }, ue = {
312
+ key: 2,
313
+ class: "vet-pagination-wrapper"
256
314
  };
257
- function le(e, t, n, r, d, c) {
258
- const o = h("a-input"), u = h("a-input-number"), i = h("a-select"), p = h("a-date-picker"), w = h("a-range-picker"), V = h("a-form-item"), v = h("a-button"), S = h("a-space"), P = h("a-form"), D = h("a-switch"), $ = h("a-table"), R = h("a-pagination");
259
- return s(), m("div", Y, [
260
- e.queryFields && e.queryFields.length > 0 ? (s(), m("div", Z, [
261
- U(e.$slots, "query-form", {
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
- f(P, {
324
+ y(T, {
267
325
  layout: "inline",
268
326
  model: e.filters
269
327
  }, {
270
- default: g(() => [
271
- (s(!0), m(_, null, O(e.queryFields, (a) => (s(), b(V, {
328
+ default: v(() => [
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
- default: g(() => [
276
- a.type === "input" ? (s(), b(o, {
333
+ default: v(() => [
334
+ a.type === "input" ? (i(), S(n, {
277
335
  key: 0,
278
336
  modelValue: e.filters[a.name],
279
- "onUpdate:modelValue": (l) => e.filters[a.name] = l,
280
- placeholder: a.placeholder || `请输入${a.label}`,
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" ? (s(), b(u, {
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": (l) => e.filters[a.name] = l,
286
- placeholder: a.placeholder || `请输入${a.label}`,
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" ? (s(), b(i, {
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": (l) => e.filters[a.name] = l,
292
- placeholder: a.placeholder || `请选择${a.label}`,
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" ? (s(), b(p, {
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": (l) => e.filters[a.name] = l,
300
- placeholder: a.placeholder || `请选择${a.label}`,
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" ? (s(), b(w, {
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": (l) => e.filters[a.name] = l,
306
- placeholder: [a.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"])) : k("", !0)
366
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : z("", !0)
309
367
  ]),
310
368
  _: 2
311
369
  }, 1032, ["label"]))), 128)),
312
- f(V, null, {
313
- default: g(() => [
314
- f(S, null, {
315
- default: g(() => [
316
- f(v, {
370
+ y(D, null, {
371
+ default: v(() => [
372
+ y(k, null, {
373
+ default: v(() => [
374
+ y(w, {
317
375
  type: "primary",
318
376
  onClick: e.handleSearch
319
377
  }, {
320
- default: g(() => [...t[1] || (t[1] = [
321
- T("查询", -1)
322
- ])]),
378
+ default: v(() => [
379
+ q(V(e.locale.button.search), 1)
380
+ ]),
323
381
  _: 1
324
382
  }, 8, ["onClick"]),
325
- f(v, { onClick: e.handleReset }, {
326
- default: g(() => [...t[2] || (t[2] = [
327
- T("重置", -1)
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
  ]),
@@ -337,106 +395,89 @@ function le(e, t, n, r, d, c) {
337
395
  ]),
338
396
  _: 1
339
397
  }, 8, ["model"])
340
- ], !0)
341
- ])) : k("", !0),
342
- q("div", x, [
343
- U(e.$slots, "toolbar", {
398
+ ])
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
- q("div", ee, [
348
- e.title ? (s(), m("span", ae, B(e.title), 1)) : k("", !0)
349
- ]),
350
- q("div", te, [
351
- f(S, null, {
352
- default: g(() => [
353
- f(v, {
354
- loading: e.loading,
355
- onClick: e.refresh
356
- }, {
357
- default: g(() => [...t[3] || (t[3] = [
358
- q("svg", {
359
- class: "icon-refresh",
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 ? (s(), 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 ? (s(), m("span", ne, B(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
- ], !0)
384
- ]),
385
- f($, I({
408
+ ])
409
+ ])) : z("", !0),
410
+ y(h, A({
386
411
  "data-source": e.data,
387
- columns: e.computedColumns,
412
+ columns: e.columns,
388
413
  loading: e.loading,
389
414
  pagination: !1,
390
415
  "row-key": e.rowKey,
391
416
  bordered: e.bordered,
392
417
  scroll: e.scroll
393
418
  }, e.$attrs, K(e.$listeners)), {
394
- default: g(() => [
395
- (s(!0), m(_, null, O(e.filteredSlots, (a, l) => (s(), m(_, null, [
396
- l === "action" ? U(e.$slots, "action", {
419
+ default: v(() => [
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) ? (s(), m("a", {
426
+ e.download && e.canDownload(e.slotData && e.slotData.record) ? (i(), g("a", {
402
427
  key: 0,
403
- onClick: t[0] || (t[0] = (y) => e.download.handleDownload(e.slotData.record))
404
- }, "下载")) : k("", !0)
405
- ], !0) : U(e.$slots, l, I({
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
- T(B(e.slotData ? e.slotData.text : ""), 1)
410
- ], !0)
447
+ q(V(e.slotData ? e.slotData.text : ""), 1)
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 ? (s(), m("div", oe, [
416
- f(R, {
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
- "show-quick-jumper": !0,
422
- "show-total": (a) => `共 ${a} 条`,
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
- ])) : k("", !0)
464
+ }, null, 8, ["current", "page-size", "total", "locale", "show-total", "onChange", "onShowSizeChange"])
465
+ ])) : z("", !0)
427
466
  ]);
428
467
  }
429
- const re = /* @__PURE__ */ X(J, [["render", le], ["__scopeId", "data-v-c29396f5"]]), de = {
430
- install(e) {
431
- e.component("DownloadTable", re);
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
- re as DownloadTable,
436
- de as VueExportTable,
437
- de as default,
438
- W as useAutoRefresh,
439
- Q as usePagination,
440
- M as useQuery,
441
- G as useTable
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
  };