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,265 +1,322 @@
1
- import { defineComponent as Y, resolveComponent as m, openBlock as h, createElementBlock as b, renderSlot as E, unref as a, createVNode as f, withCtx as g, Fragment as Z, renderList as ee, createBlock as k, createCommentVNode as _, createTextVNode as T, createElementVNode as D, toDisplayString as A, isRef as K, mergeProps as te } from "vue";
2
- import { reactive as ae, ref as C, computed as L, onMounted as M, onUnmounted as ne } from "vue-demi";
3
- function oe(e) {
4
- const o = ae({});
5
- function l() {
6
- e.forEach((n) => {
7
- n.defaultValue !== void 0 ? o[n.name] = n.defaultValue : o[n.name] = n.type === "rangePicker" ? [] : void 0;
1
+ import { defineComponent as ae, resolveComponent as m, openBlock as h, createElementBlock as b, unref as t, renderSlot as D, createVNode as y, withCtx as w, Fragment as ne, renderList as oe, createBlock as k, createCommentVNode as z, createTextVNode as x, toDisplayString as S, createElementVNode as B, mergeProps as le, isRef as K } from "vue";
2
+ import { reactive as Q, ref as R, computed as N, onMounted as j, onUnmounted as re } from "vue-demi";
3
+ function ue(e) {
4
+ const a = Q({});
5
+ function o() {
6
+ e.forEach((r) => {
7
+ r.defaultValue !== void 0 ? a[r.name] = r.defaultValue : a[r.name] = r.type === "rangePicker" ? [] : void 0;
8
8
  });
9
9
  }
10
- l();
11
- function u() {
12
- const n = {};
13
- return Object.keys(o).forEach((c) => {
14
- const i = o[c];
15
- if (i != null && i !== "") {
16
- if (Array.isArray(i) && i.length === 0) return;
17
- n[c] = i;
10
+ o();
11
+ function d() {
12
+ const r = {};
13
+ return Object.keys(a).forEach((l) => {
14
+ const c = a[l];
15
+ if (c != null && c !== "") {
16
+ if (Array.isArray(c) && c.length === 0) return;
17
+ r[l] = c;
18
18
  }
19
- }), n;
19
+ }), r;
20
20
  }
21
- function d() {
22
- l();
21
+ function i() {
22
+ o();
23
23
  }
24
- function v(n, c) {
25
- o[n] = c;
24
+ function f(r, l) {
25
+ a[r] = l;
26
26
  }
27
- return { filters: o, onSearch: u, onReset: d, setFilter: v };
27
+ return { filters: a, onSearch: d, onReset: i, setFilter: f };
28
28
  }
29
- function le(e = 10) {
30
- const o = C(1), l = C(e), u = L(() => ({
31
- current: o.value,
32
- pageSize: l.value
29
+ function se(e = 10) {
30
+ const a = R(1), o = R(e), d = N(() => ({
31
+ current: a.value,
32
+ pageSize: o.value
33
33
  }));
34
- function d(n, c) {
35
- o.value = n, c !== l.value && (l.value = c, o.value = 1);
34
+ function i(r, l) {
35
+ a.value = r, l !== o.value && (o.value = l, a.value = 1);
36
36
  }
37
- function v() {
38
- o.value = 1;
37
+ function f() {
38
+ a.value = 1;
39
39
  }
40
- return { currentPage: o, pageSize: l, pagination: u, onPageChange: d, resetPage: v };
40
+ return { currentPage: a, pageSize: o, pagination: d, onPageChange: i, resetPage: f };
41
41
  }
42
- function re(e, o) {
43
- const l = C(e.enabled ?? e.interval > 0), u = C(e.interval);
44
- let d = null;
45
- function v() {
46
- n(), !(!l.value || e.interval <= 0) && (u.value = e.interval, d = setInterval(() => {
47
- u.value -= 1, u.value <= 0 && (u.value = e.interval, o());
48
- }, 1e3));
49
- }
50
- function n() {
51
- d && (clearInterval(d), d = null);
52
- }
53
- function c(S) {
54
- l.value = S ?? !l.value, l.value ? v() : (n(), u.value = e.interval);
42
+ function ie(e, a) {
43
+ let o = null;
44
+ function d() {
45
+ i(), !(e.interval <= 0) && (o = setInterval(() => {
46
+ a();
47
+ }, e.interval * 1e3));
55
48
  }
56
49
  function i() {
57
- l.value && (u.value = e.interval);
50
+ o && (clearInterval(o), o = null);
58
51
  }
59
- function y() {
60
- e.pauseOnHidden && (document.hidden ? n() : l.value && v());
52
+ function f() {
53
+ document.hidden ? i() : d();
61
54
  }
62
- return M(() => {
63
- l.value && e.interval > 0 && (v(), e.pauseOnHidden && document.addEventListener("visibilitychange", y));
64
- }), ne(() => {
65
- n(), document.removeEventListener("visibilitychange", y);
66
- }), { enabled: l, countdown: u, toggle: c, resetCountdown: i };
55
+ return j(() => {
56
+ e.interval > 0 && (d(), document.addEventListener("visibilitychange", f));
57
+ }), re(() => {
58
+ i(), document.removeEventListener("visibilitychange", f);
59
+ }), { stopTimer: i, startTimer: d };
67
60
  }
68
- function ue(e) {
69
- const o = C(!1), l = C([]), u = C(0), { filters: d, onSearch: v, onReset: n, setFilter: c } = oe(e.queryFields ?? []), { currentPage: i, pageSize: y, pagination: S, onPageChange: F, resetPage: x } = le(e.pageSize ?? 10), R = e.autoRefresh ?? {
70
- interval: 0,
71
- enabled: !1
72
- }, { enabled: V, countdown: I, toggle: $, resetCountdown: q } = re(
73
- R,
61
+ function ce(e) {
62
+ const a = R(!1), o = R([]), d = R(0), { filters: i, onSearch: f, onReset: r, setFilter: l } = ue(e.queryFields ?? []), { currentPage: c, pageSize: _, pagination: F, onPageChange: U, resetPage: C } = se(e.pageSize ?? 10), q = e.autoRefresh ?? {
63
+ interval: 30
64
+ }, { stopTimer: I, startTimer: P } = ie(
65
+ q,
74
66
  () => {
75
- r();
67
+ v();
76
68
  }
77
69
  );
78
- async function r() {
79
- o.value = !0;
70
+ async function v() {
71
+ a.value = !0;
80
72
  try {
81
- const w = {
82
- page: i.value,
83
- pageSize: y.value,
84
- filters: v()
85
- }, P = await e.fetchData(w);
86
- l.value = P.list, u.value = P.total;
87
- } catch (w) {
88
- console.error("[VueExportTable] fetch error:", w);
73
+ const p = {
74
+ page: c.value,
75
+ pageSize: _.value,
76
+ filters: f()
77
+ }, g = await e.fetchData(p);
78
+ o.value = g.list, d.value = g.total;
79
+ } catch (p) {
80
+ console.error("[VueExportTable] fetch error:", p);
89
81
  } finally {
90
- o.value = !1;
82
+ a.value = !1;
91
83
  }
92
84
  }
93
- function s() {
94
- x(), r(), q();
85
+ function $() {
86
+ C(), v();
95
87
  }
96
- function z() {
97
- n(), x(), r();
88
+ function L() {
89
+ r(), C(), v();
98
90
  }
99
- function U(w, P) {
100
- F(w, P), r(), q();
91
+ function s(p, g) {
92
+ U(p, g), v();
101
93
  }
102
- return M(() => {
103
- e.immediate !== !1 && r();
94
+ return j(() => {
95
+ e.immediate !== !1 && v();
104
96
  }), {
105
97
  // 状态
106
- loading: o,
107
- data: l,
108
- total: u,
109
- filters: d,
110
- pagination: S,
111
- currentPage: i,
112
- pageSize: y,
98
+ loading: a,
99
+ data: o,
100
+ total: d,
101
+ filters: i,
102
+ pagination: F,
103
+ currentPage: c,
104
+ pageSize: _,
113
105
  // 查询
114
- handleSearch: s,
115
- handleReset: z,
116
- setFilter: c,
106
+ handleSearch: $,
107
+ handleReset: L,
108
+ setFilter: l,
117
109
  // 分页
118
- handlePageChange: U,
110
+ handlePageChange: s,
119
111
  // 刷新
120
- refresh: r,
121
- // 自动刷新
122
- autoRefreshEnabled: V,
123
- countdown: I,
124
- toggleAutoRefresh: $
112
+ refresh: v,
113
+ // 自动刷新控制
114
+ stopAutoRefresh: I,
115
+ startAutoRefresh: P
125
116
  };
126
117
  }
127
- const se = { class: "download-table-wrapper" }, ce = {
128
- key: 0,
129
- class: "query-form-wrapper"
130
- }, ie = { class: "toolbar-wrapper" }, de = { class: "toolbar-left" }, pe = {
118
+ const de = {
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
+ }, W = Q({ ...de });
154
+ function pe(e) {
155
+ Object.assign(W, e);
156
+ }
157
+ function me() {
158
+ return W;
159
+ }
160
+ const he = {
161
+ running: "blue",
162
+ failed: "red",
163
+ completed: "green"
164
+ };
165
+ function fe(e) {
166
+ return {
167
+ running: e.status.running,
168
+ // 运行中
169
+ failed: e.status.failed,
170
+ // 失败
171
+ completed: e.status.completed
172
+ // 已完成
173
+ };
174
+ }
175
+ function ge(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 O(e) {
196
+ return [
197
+ { name: "fileName", label: e.queryFields.fileName, type: "input", placeholder: e.queryFields.fileNamePlaceholder }
198
+ // 文件名称
199
+ ];
200
+ }
201
+ const ve = { class: "vet-download-table-wrapper" }, ye = {
131
202
  key: 0,
132
- class: "table-title"
133
- }, he = { class: "toolbar-right" }, ve = {
134
- key: 1,
135
- class: "countdown-text"
136
- }, me = ["onClick"], fe = {
203
+ class: "vet-query-form-wrapper"
204
+ }, we = {
137
205
  key: 1,
138
- class: "pagination-wrapper"
139
- }, ge = /* @__PURE__ */ Y({
206
+ class: "vet-toolbar-wrapper"
207
+ }, _e = { class: "vet-toolbar-left" }, be = { class: "vet-table-title" }, ke = ["onClick"], Se = {
208
+ key: 2,
209
+ class: "vet-pagination-wrapper"
210
+ }, Ce = /* @__PURE__ */ ae({
140
211
  __name: "DownloadTable",
141
212
  props: {
142
- columns: {},
143
- queryFields: {},
213
+ columns: { default: void 0 },
214
+ queryFields: { default: void 0 },
144
215
  fetchData: {},
145
216
  download: { default: void 0 },
146
217
  autoRefresh: {},
147
218
  rowKey: { type: [String, Function], default: "id" },
148
219
  title: {},
149
220
  bordered: { type: Boolean, default: !0 },
150
- pageSize: { default: 10 },
151
- showIndex: { type: Boolean, default: !1 }
221
+ pageSize: { default: 10 }
152
222
  },
153
223
  setup(e) {
154
- const o = e, l = (r) => o.download ? o.download.canDownload ? o.download.canDownload(r) : r.status === "completed" : !1, {
155
- loading: u,
156
- data: d,
157
- total: v,
158
- filters: n,
224
+ const a = me(), o = e, d = (s) => o.download ? o.download.canDownload ? o.download.canDownload(s) : s.status === "completed" : !1, {
225
+ loading: i,
226
+ data: f,
227
+ total: r,
228
+ filters: l,
159
229
  currentPage: c,
160
- pageSize: i,
161
- handleSearch: y,
162
- handleReset: S,
163
- handlePageChange: F,
164
- refresh: x,
165
- autoRefreshEnabled: R,
166
- countdown: V,
167
- toggleAutoRefresh: I
168
- } = ue({
230
+ pageSize: _,
231
+ handleSearch: F,
232
+ handleReset: U,
233
+ handlePageChange: C,
234
+ refresh: q
235
+ } = ce({
169
236
  fetchData: o.fetchData,
170
- queryFields: o.queryFields,
237
+ queryFields: o.queryFields ?? O(a),
171
238
  pageSize: o.pageSize,
172
239
  autoRefresh: o.autoRefresh,
173
240
  immediate: !0
174
- }), $ = L(() => {
175
- const r = [];
176
- return o.showIndex && r.push({
177
- title: "序号",
178
- dataIndex: "index",
179
- key: "index",
180
- width: 80,
181
- align: "center",
182
- customRender: ({ index: s }) => (c.value - 1) * i.value + s + 1
183
- }), [...r, ...o.columns];
184
- }), q = L(() => {
185
- const r = $.value.reduce((s, z) => {
186
- const U = typeof z.width == "number" ? z.width : 0;
187
- return s + U;
241
+ }), I = N(() => o.columns && o.columns.length > 0 ? o.columns : ge(a)), P = N(() => o.queryFields ?? O(a)), v = N(() => {
242
+ const s = I.value.reduce((p, g) => {
243
+ const V = typeof g.width == "number" ? g.width : 0;
244
+ return p + V;
188
245
  }, 0);
189
- return r > 0 ? { x: r } : void 0;
190
- });
191
- return (r, s) => {
192
- const z = m("a-input"), U = m("a-input-number"), w = m("a-select"), P = m("a-date-picker"), Q = m("a-range-picker"), N = m("a-form-item"), B = m("a-button"), O = m("a-space"), W = m("a-form"), G = m("a-switch"), J = m("a-table"), X = m("a-pagination");
193
- return h(), b("div", se, [
194
- e.queryFields && e.queryFields.length > 0 ? (h(), b("div", ce, [
195
- E(r.$slots, "query-form", {
196
- filters: a(n),
197
- handleSearch: a(y),
198
- handleReset: a(S)
246
+ return s > 0 ? { x: s } : void 0;
247
+ }), $ = he, L = N(() => fe(a));
248
+ return (s, p) => {
249
+ const g = m("a-input"), V = m("a-input-number"), G = m("a-select"), H = m("a-date-picker"), J = m("a-range-picker"), A = m("a-form-item"), M = m("a-button"), X = m("a-space"), Y = m("a-form"), Z = m("a-tag"), ee = m("a-table"), te = m("a-pagination");
250
+ return h(), b("div", ve, [
251
+ t(P) && t(P).length > 0 ? (h(), b("div", ye, [
252
+ D(s.$slots, "query-form", {
253
+ filters: t(l),
254
+ handleSearch: t(F),
255
+ handleReset: t(U)
199
256
  }, () => [
200
- f(W, {
257
+ y(Y, {
201
258
  layout: "inline",
202
- model: a(n)
259
+ model: t(l)
203
260
  }, {
204
- default: g(() => [
205
- (h(!0), b(Z, null, ee(e.queryFields, (t) => (h(), k(N, {
206
- key: t.name,
207
- label: t.label
261
+ default: w(() => [
262
+ (h(!0), b(ne, null, oe(t(P), (n) => (h(), k(A, {
263
+ key: n.name,
264
+ label: n.label
208
265
  }, {
209
- default: g(() => [
210
- t.type === "input" ? (h(), k(z, {
266
+ default: w(() => [
267
+ n.type === "input" ? (h(), k(g, {
211
268
  key: 0,
212
- value: a(n)[t.name],
213
- "onUpdate:value": (p) => a(n)[t.name] = p,
214
- placeholder: t.placeholder || `请输入${t.label}`,
269
+ value: t(l)[n.name],
270
+ "onUpdate:value": (u) => t(l)[n.name] = u,
271
+ placeholder: n.placeholder || t(a).placeholder.input(n.label),
215
272
  "allow-clear": ""
216
- }, null, 8, ["value", "onUpdate:value", "placeholder"])) : t.type === "number" ? (h(), k(U, {
273
+ }, null, 8, ["value", "onUpdate:value", "placeholder"])) : n.type === "number" ? (h(), k(V, {
217
274
  key: 1,
218
- value: a(n)[t.name],
219
- "onUpdate:value": (p) => a(n)[t.name] = p,
220
- placeholder: t.placeholder || `请输入${t.label}`,
275
+ value: t(l)[n.name],
276
+ "onUpdate:value": (u) => t(l)[n.name] = u,
277
+ placeholder: n.placeholder || t(a).placeholder.input(n.label),
221
278
  style: { width: "180px" }
222
- }, null, 8, ["value", "onUpdate:value", "placeholder"])) : t.type === "select" ? (h(), k(w, {
279
+ }, null, 8, ["value", "onUpdate:value", "placeholder"])) : n.type === "select" ? (h(), k(G, {
223
280
  key: 2,
224
- value: a(n)[t.name],
225
- "onUpdate:value": (p) => a(n)[t.name] = p,
226
- placeholder: t.placeholder || `请选择${t.label}`,
227
- options: t.options,
281
+ value: t(l)[n.name],
282
+ "onUpdate:value": (u) => t(l)[n.name] = u,
283
+ placeholder: n.placeholder || t(a).placeholder.select(n.label),
284
+ options: n.options,
228
285
  "allow-clear": "",
229
286
  style: { "min-width": "150px" }
230
- }, null, 8, ["value", "onUpdate:value", "placeholder", "options"])) : t.type === "datePicker" ? (h(), k(P, {
287
+ }, null, 8, ["value", "onUpdate:value", "placeholder", "options"])) : n.type === "datePicker" ? (h(), k(H, {
231
288
  key: 3,
232
- value: a(n)[t.name],
233
- "onUpdate:value": (p) => a(n)[t.name] = p,
234
- placeholder: t.placeholder || `请选择${t.label}`,
289
+ value: t(l)[n.name],
290
+ "onUpdate:value": (u) => t(l)[n.name] = u,
291
+ placeholder: n.placeholder || t(a).placeholder.select(n.label),
235
292
  style: { width: "180px" }
236
- }, null, 8, ["value", "onUpdate:value", "placeholder"])) : t.type === "rangePicker" ? (h(), k(Q, {
293
+ }, null, 8, ["value", "onUpdate:value", "placeholder"])) : n.type === "rangePicker" ? (h(), k(J, {
237
294
  key: 4,
238
- value: a(n)[t.name],
239
- "onUpdate:value": (p) => a(n)[t.name] = p,
240
- placeholder: [t.placeholder || "开始日期", t.placeholder || "结束日期"],
295
+ value: t(l)[n.name],
296
+ "onUpdate:value": (u) => t(l)[n.name] = u,
297
+ placeholder: [n.placeholder || t(a).placeholder.startDate, n.placeholder || t(a).placeholder.endDate],
241
298
  style: { width: "240px" }
242
- }, null, 8, ["value", "onUpdate:value", "placeholder"])) : _("", !0)
299
+ }, null, 8, ["value", "onUpdate:value", "placeholder"])) : z("", !0)
243
300
  ]),
244
301
  _: 2
245
302
  }, 1032, ["label"]))), 128)),
246
- f(N, null, {
247
- default: g(() => [
248
- f(O, null, {
249
- default: g(() => [
250
- f(B, {
303
+ y(A, null, {
304
+ default: w(() => [
305
+ y(X, null, {
306
+ default: w(() => [
307
+ y(M, {
251
308
  type: "primary",
252
- onClick: a(y)
309
+ onClick: t(F)
253
310
  }, {
254
- default: g(() => [...s[3] || (s[3] = [
255
- T("查询", -1)
256
- ])]),
311
+ default: w(() => [
312
+ x(S(t(a).button.search), 1)
313
+ ]),
257
314
  _: 1
258
315
  }, 8, ["onClick"]),
259
- f(B, { onClick: a(S) }, {
260
- default: g(() => [...s[4] || (s[4] = [
261
- T("重置", -1)
262
- ])]),
316
+ y(M, { onClick: t(U) }, {
317
+ default: w(() => [
318
+ x(S(t(a).button.reset), 1)
319
+ ]),
263
320
  _: 1
264
321
  }, 8, ["onClick"])
265
322
  ]),
@@ -271,115 +328,92 @@ const se = { class: "download-table-wrapper" }, ce = {
271
328
  ]),
272
329
  _: 1
273
330
  }, 8, ["model"])
274
- ], !0)
275
- ])) : _("", !0),
276
- D("div", ie, [
277
- E(r.$slots, "toolbar", {
278
- loading: a(u),
279
- refresh: a(x)
331
+ ])
332
+ ])) : z("", !0),
333
+ e.title ? (h(), b("div", we, [
334
+ D(s.$slots, "toolbar", {
335
+ loading: t(i),
336
+ refresh: t(q)
280
337
  }, () => [
281
- D("div", de, [
282
- e.title ? (h(), b("span", pe, A(e.title), 1)) : _("", !0)
283
- ]),
284
- D("div", he, [
285
- f(O, null, {
286
- default: g(() => [
287
- f(B, {
288
- loading: a(u),
289
- onClick: a(x)
290
- }, {
291
- default: g(() => [...s[5] || (s[5] = [
292
- D("svg", {
293
- class: "icon-svg",
294
- viewBox: "64 64 896 896",
295
- width: "1em",
296
- height: "1em",
297
- fill: "currentColor"
298
- }, [
299
- D("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" })
300
- ], -1),
301
- T(" 刷新 ", -1)
302
- ])]),
303
- _: 1
304
- }, 8, ["loading", "onClick"]),
305
- e.autoRefresh ? (h(), k(G, {
306
- key: 0,
307
- checked: a(R),
308
- "onUpdate:checked": s[0] || (s[0] = (t) => K(R) ? R.value = t : null),
309
- "checked-children": "自动刷新",
310
- "un-checked-children": "自动刷新",
311
- onChange: a(I)
312
- }, null, 8, ["checked", "onChange"])) : _("", !0),
313
- e.autoRefresh && a(R) ? (h(), b("span", ve, A(a(V)) + "s ", 1)) : _("", !0)
314
- ]),
315
- _: 1
316
- })
338
+ B("div", _e, [
339
+ B("span", be, S(e.title), 1)
317
340
  ])
318
- ], !0)
319
- ]),
320
- f(J, te({
321
- dataSource: a(d),
322
- columns: a($),
323
- loading: a(u),
341
+ ])
342
+ ])) : z("", !0),
343
+ y(ee, le({
344
+ dataSource: t(f),
345
+ columns: t(I),
346
+ loading: t(i),
324
347
  pagination: !1,
325
348
  rowKey: e.rowKey,
326
349
  bordered: e.bordered,
327
- scroll: a(q)
328
- }, r.$attrs), {
329
- bodyCell: g(({ column: t, record: p, index: H, text: j }) => [
330
- t.dataIndex === "action" ? E(r.$slots, "action", {
350
+ scroll: t(v)
351
+ }, s.$attrs), {
352
+ bodyCell: w(({ column: n, record: u, index: E, text: T }) => [
353
+ n.dataIndex === "action" ? D(s.$slots, "action", {
331
354
  key: 0,
332
- record: p,
333
- index: H
355
+ record: u,
356
+ index: E
334
357
  }, () => [
335
- e.download && l(p) ? (h(), b("a", {
358
+ e.download && d(u) ? (h(), b("a", {
336
359
  key: 0,
337
- onClick: (be) => e.download.handleDownload(p)
338
- }, "下载", 8, me)) : _("", !0)
339
- ], !0) : E(r.$slots, t.dataIndex, {
360
+ onClick: (Pe) => e.download.handleDownload(u)
361
+ }, S(t(a).button.download), 9, ke)) : z("", !0)
362
+ ]) : n.dataIndex === "status" ? D(s.$slots, "status", {
340
363
  key: 1,
341
- record: p,
342
- index: H,
343
- text: j
364
+ record: u,
365
+ index: E
344
366
  }, () => [
345
- T(A(j), 1)
346
- ], !0)
367
+ y(Z, {
368
+ color: t($)[T] || "default"
369
+ }, {
370
+ default: w(() => [
371
+ x(S(t(L)[T] || T), 1)
372
+ ]),
373
+ _: 2
374
+ }, 1032, ["color"])
375
+ ]) : D(s.$slots, n.dataIndex, {
376
+ key: 2,
377
+ record: u,
378
+ index: E,
379
+ text: T
380
+ }, () => [
381
+ x(S(T), 1)
382
+ ])
347
383
  ]),
348
384
  _: 3
349
385
  }, 16, ["dataSource", "columns", "loading", "rowKey", "bordered", "scroll"]),
350
- a(v) > 0 ? (h(), b("div", fe, [
351
- f(X, {
352
- current: a(c),
353
- "onUpdate:current": s[1] || (s[1] = (t) => K(c) ? c.value = t : null),
354
- pageSize: a(i),
355
- "onUpdate:pageSize": s[2] || (s[2] = (t) => K(i) ? i.value = t : null),
356
- total: a(v),
386
+ t(r) > 0 ? (h(), b("div", Se, [
387
+ y(te, {
388
+ current: t(c),
389
+ "onUpdate:current": p[0] || (p[0] = (n) => K(c) ? c.value = n : null),
390
+ pageSize: t(_),
391
+ "onUpdate:pageSize": p[1] || (p[1] = (n) => K(_) ? _.value = n : null),
392
+ total: t(r),
357
393
  "show-size-changer": !0,
358
- "show-quick-jumper": !0,
359
- "show-total": (t) => `共 ${t} 条`,
360
- onChange: a(F),
361
- onShowSizeChange: a(F)
362
- }, null, 8, ["current", "pageSize", "total", "show-total", "onChange", "onShowSizeChange"])
363
- ])) : _("", !0)
394
+ "page-size-options": ["10", "20", "50"],
395
+ locale: { items_per_page: t(a).pagination.itemsPerPage },
396
+ "show-total": t(a).pagination.showTotal,
397
+ onChange: t(C),
398
+ onShowSizeChange: t(C)
399
+ }, null, 8, ["current", "pageSize", "total", "locale", "show-total", "onChange", "onShowSizeChange"])
400
+ ])) : z("", !0)
364
401
  ]);
365
402
  };
366
403
  }
367
- }), ye = (e, o) => {
368
- const l = e.__vccOpts || e;
369
- for (const [u, d] of o)
370
- l[u] = d;
371
- return l;
372
- }, we = /* @__PURE__ */ ye(ge, [["__scopeId", "data-v-13092ac7"]]), Ce = {
373
- install(e) {
374
- e.component("DownloadTable", we);
404
+ }), ze = {
405
+ install(e, a) {
406
+ e.component("DownloadTable", Ce), a != null && a.locale && pe(a.locale);
375
407
  }
376
408
  };
377
409
  export {
378
- we as DownloadTable,
379
- Ce as VueExportTable,
380
- Ce as default,
381
- re as useAutoRefresh,
382
- le as usePagination,
383
- oe as useQuery,
384
- ue as useTable
410
+ Ce as DownloadTable,
411
+ ze as VueExportTable,
412
+ ze as default,
413
+ pe as setLocale,
414
+ ie as useAutoRefresh,
415
+ me as useLocale,
416
+ se as usePagination,
417
+ ue as useQuery,
418
+ ce as useTable
385
419
  };