@done-coding/admin-core 0.1.1-alpha.1 → 0.1.1-alpha.3
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/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +97 -84
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +32 -30
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +152 -134
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +157 -39
- package/es/helpers/list-helper.mjs +29 -33
- package/es/index.mjs +79 -74
- package/es/style.css +1 -1
- package/es/utils/export.mjs +23 -0
- package/package.json +2 -2
- package/types/components/list-page/ListPage.vue.d.ts +2 -0
- package/types/components/list-page/types.d.ts +2 -0
- package/types/components/table/TableToolbar.vue.d.ts +40 -8
- package/types/components/table/types.d.ts +42 -8
- package/types/utils/export.d.ts +23 -0
- package/types/utils/index.d.ts +1 -0
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { ElTable as
|
|
1
|
+
import { ElTable as pe, ElTableColumn as ge, ElEmpty as ce, ElPagination as de } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/pagination/style/css";
|
|
4
4
|
import "element-plus/es/components/table/style/css";
|
|
5
5
|
import "element-plus/es/components/empty/style/css";
|
|
6
6
|
import "element-plus/es/components/table-column/style/css";
|
|
7
|
-
import { defineComponent as
|
|
7
|
+
import { defineComponent as me, useCssVars as he, useModel as ve, useAttrs as ye, ref as u, computed as g, shallowRef as be, inject as Ce, onMounted as Se, onActivated as _e, watch as d, openBlock as s, createElementBlock as y, unref as n, createBlock as b, withCtx as C, createVNode as I, mergeProps as c, createCommentVNode as Ee, Fragment as T, renderList as xe, createSlots as Te, renderSlot as $, resolveDynamicComponent as Y, createTextVNode as R, toDisplayString as q, withDirectives as we, createElementVNode as Pe, isRef as F, vShow as Ie, mergeModels as G } from "vue";
|
|
8
8
|
import U from "lodash/cloneDeep";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
9
|
+
import D from "lodash/omit";
|
|
10
|
+
import W from "lodash/set";
|
|
11
|
+
import Z from "lodash/get";
|
|
12
|
+
import Re from "./TableToolbar.vue.mjs";
|
|
13
|
+
import ke from "../display/WatchSize.vue.mjs";
|
|
14
|
+
import { pickExportColumns as ze } from "../../utils/export.mjs";
|
|
15
|
+
import { BODY_CONTENT_VIEWPORT_HEIGHT as He } from "../../inject/key.mjs";
|
|
16
|
+
import { APP_API_LIST_MODEL_KEY_CONFIG as w } from "../../config/list-model.mjs";
|
|
17
|
+
const Ne = { class: "table-main" }, Oe = { class: "table-main-pagination" }, Ze = /* @__PURE__ */ me({
|
|
17
18
|
__name: "TableMain",
|
|
18
19
|
props: /* @__PURE__ */ G({
|
|
19
20
|
showPager: { type: Boolean, default: !0 },
|
|
@@ -37,180 +38,197 @@ const Oe = { class: "table-main" }, ze = { class: "table-main-pagination" }, qe
|
|
|
37
38
|
isAutoRefreshModifiers: {}
|
|
38
39
|
}),
|
|
39
40
|
emits: /* @__PURE__ */ G(["pageChange", "pageSizeChange", "dataChange", "loadingChange", "pageInfoChange"], ["update:isAutoRefresh"]),
|
|
40
|
-
setup(
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
setup(f, { expose: Q, emit: X }) {
|
|
42
|
+
he((e) => ({
|
|
43
|
+
v16a9ca77: e.headerColor
|
|
43
44
|
}));
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const o = f, m = X, k = ve(f, "isAutoRefresh"), ee = ye(), S = u([]), _ = u(0), i = u(0), l = u(1), h = u(!1), P = u(!1), z = u([]), te = g(() => ({
|
|
46
|
+
columns: ze(o.columns),
|
|
47
|
+
selectedList: z.value,
|
|
48
|
+
currentPageList: S.value,
|
|
49
|
+
api: o.api,
|
|
50
|
+
query: o.query || {},
|
|
51
|
+
total: _.value,
|
|
52
|
+
hasSelection: o.columns.some((e) => e.type === "selection")
|
|
53
|
+
})), H = u(0), oe = (e) => {
|
|
54
|
+
H.value = e;
|
|
55
|
+
}, N = be(), re = Ce(
|
|
56
|
+
He,
|
|
48
57
|
500
|
|
49
|
-
),
|
|
50
|
-
var
|
|
51
|
-
if (
|
|
52
|
-
const e = (
|
|
53
|
-
return e === void 0 || e.length > 0;
|
|
54
|
-
}),
|
|
55
|
-
() =>
|
|
56
|
-
),
|
|
57
|
-
const { maxHeight: e, refine: t } =
|
|
58
|
+
), O = g(() => o.showPager ? 35 : 0), A = g(() => {
|
|
59
|
+
var a, x;
|
|
60
|
+
if (o.showToolbar === !1) return !1;
|
|
61
|
+
const e = (a = o.toolbar) == null ? void 0 : a.leftFeatures, t = (x = o.toolbar) == null ? void 0 : x.rightFeatures;
|
|
62
|
+
return e === void 0 || e.length > 0 || t === void 0 || t.length > 0;
|
|
63
|
+
}), L = g(
|
|
64
|
+
() => A.value ? H.value : 0
|
|
65
|
+
), ae = g(() => {
|
|
66
|
+
const { maxHeight: e, refine: t } = o;
|
|
58
67
|
return e ? Math.max(
|
|
59
|
-
e -
|
|
68
|
+
e - O.value - L.value,
|
|
60
69
|
200
|
|
61
70
|
) : t ? Math.max(
|
|
62
|
-
|
|
71
|
+
re.value - O.value - L.value - o.refineReduceHeight,
|
|
63
72
|
200
|
|
64
73
|
) : void 0;
|
|
65
|
-
}),
|
|
66
|
-
const e = U(
|
|
67
|
-
return
|
|
74
|
+
}), E = g(() => {
|
|
75
|
+
const e = U(o.query || {});
|
|
76
|
+
return W(e, w.PAGE_SIZE_KEY, i.value), W(
|
|
68
77
|
e,
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
w.CURRENT_PAGE_KEY,
|
|
79
|
+
l.value
|
|
71
80
|
), e;
|
|
72
|
-
}),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
}), ne = g(() => {
|
|
82
|
+
var t;
|
|
83
|
+
const e = (t = o.tableProps) == null ? void 0 : t.onSelectionChange;
|
|
84
|
+
return {
|
|
85
|
+
...o.tableProps,
|
|
86
|
+
...ee,
|
|
87
|
+
/** 合并内部选中存储与外部 onSelectionChange */
|
|
88
|
+
onSelectionChange: (a) => {
|
|
89
|
+
z.value = a, e == null || e(a);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}), K = (e, t = !0) => {
|
|
93
|
+
const a = JSON.stringify(e) === JSON.stringify(E.value);
|
|
94
|
+
return !a && t && console.warn(
|
|
78
95
|
`同一地方 并发请求 参数冰花 当前不是最新的参数 丢弃结果 ${JSON.stringify(
|
|
79
96
|
e
|
|
80
|
-
)} => ${JSON.stringify(
|
|
81
|
-
),
|
|
82
|
-
},
|
|
83
|
-
if (!
|
|
84
|
-
h.value ? console.warn("请求并发") : h.value = !0, e || (
|
|
85
|
-
const t = U(
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
),
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
)} => ${JSON.stringify(E.value)}`
|
|
98
|
+
), a;
|
|
99
|
+
}, j = (e = !1) => {
|
|
100
|
+
if (!i.value) return;
|
|
101
|
+
h.value ? console.warn("请求并发") : h.value = !0, e || (P.value = !0);
|
|
102
|
+
const t = U(E.value);
|
|
103
|
+
return o.api(t).then((a) => {
|
|
104
|
+
K(t, !1) && (S.value = Z(
|
|
105
|
+
a,
|
|
106
|
+
w.LIST_KEY
|
|
107
|
+
), _.value = Z(
|
|
108
|
+
a,
|
|
109
|
+
w.TOTAL_KEY
|
|
93
110
|
), m("pageInfoChange", {
|
|
94
|
-
pageSize:
|
|
95
|
-
currentPage:
|
|
96
|
-
total:
|
|
111
|
+
pageSize: i.value,
|
|
112
|
+
currentPage: l.value,
|
|
113
|
+
total: _.value
|
|
97
114
|
}));
|
|
98
115
|
}).finally(() => {
|
|
99
|
-
|
|
116
|
+
K(t) && (h.value = !1, P.value = !1);
|
|
100
117
|
});
|
|
101
|
-
},
|
|
118
|
+
}, B = async (e = !1) => {
|
|
102
119
|
var t;
|
|
103
|
-
return (t =
|
|
120
|
+
return (t = j(e)) == null ? void 0 : t.catch(() => {
|
|
104
121
|
});
|
|
105
|
-
},
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
refresh:
|
|
111
|
-
reload:
|
|
112
|
-
getTableInstance: () =>
|
|
113
|
-
},
|
|
114
|
-
...
|
|
115
|
-
injectInfo:
|
|
122
|
+
}, le = async (e = !1) => {
|
|
123
|
+
if (l.value === 1)
|
|
124
|
+
return B(e);
|
|
125
|
+
l.value = 1;
|
|
126
|
+
}, se = (e) => e, v = {
|
|
127
|
+
refresh: B,
|
|
128
|
+
reload: le,
|
|
129
|
+
getTableInstance: () => N.value
|
|
130
|
+
}, M = (e, t = []) => ({
|
|
131
|
+
...D(e, ["render", "headerRender"].concat(t)),
|
|
132
|
+
injectInfo: o.injectInfo || {},
|
|
116
133
|
exposeInfo: v
|
|
117
|
-
}),
|
|
118
|
-
...
|
|
119
|
-
injectInfo:
|
|
134
|
+
}), J = (e) => ({
|
|
135
|
+
...D(e, ["render", "headerRender"]),
|
|
136
|
+
injectInfo: o.injectInfo || {},
|
|
120
137
|
exposeInfo: v
|
|
121
138
|
});
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
return
|
|
127
|
-
|
|
139
|
+
Q(v);
|
|
140
|
+
const ie = (e) => {
|
|
141
|
+
i.value = e, l.value = 1;
|
|
142
|
+
}, V = (e) => !e || e === "expand";
|
|
143
|
+
return Se(() => {
|
|
144
|
+
i.value = o.pageSizeInit, _e(() => {
|
|
128
145
|
v.refresh();
|
|
129
146
|
});
|
|
130
|
-
}),
|
|
147
|
+
}), d(S, (e) => {
|
|
131
148
|
m("dataChange", e);
|
|
132
|
-
}),
|
|
133
|
-
() =>
|
|
149
|
+
}), d(
|
|
150
|
+
() => o.query,
|
|
134
151
|
(e, t) => {
|
|
135
|
-
JSON.stringify(e) !== JSON.stringify(t) && (
|
|
152
|
+
JSON.stringify(e) !== JSON.stringify(t) && (l.value = 1);
|
|
136
153
|
}
|
|
137
|
-
),
|
|
138
|
-
|
|
154
|
+
), d(
|
|
155
|
+
E,
|
|
139
156
|
(e, t) => {
|
|
140
|
-
JSON.stringify(e) !== JSON.stringify(t) &&
|
|
157
|
+
JSON.stringify(e) !== JSON.stringify(t) && j();
|
|
141
158
|
},
|
|
142
159
|
{
|
|
143
160
|
immediate: !0
|
|
144
161
|
}
|
|
145
|
-
),
|
|
162
|
+
), d(P, (e) => {
|
|
146
163
|
m("loadingChange", e);
|
|
147
|
-
}),
|
|
164
|
+
}), d(i, (e) => {
|
|
148
165
|
m("pageSizeChange", e);
|
|
149
|
-
}),
|
|
166
|
+
}), d(l, (e) => {
|
|
150
167
|
m("pageChange", e);
|
|
151
168
|
}), (e, t) => {
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
|
|
169
|
+
const a = ge, x = ce, ue = pe, fe = de;
|
|
170
|
+
return s(), y("div", Ne, [
|
|
171
|
+
n(A) ? (s(), b(n(ke), {
|
|
155
172
|
key: 0,
|
|
156
|
-
onHeightChange:
|
|
173
|
+
onHeightChange: oe
|
|
157
174
|
}, {
|
|
158
175
|
default: C(() => [
|
|
159
|
-
I(
|
|
160
|
-
"is-auto-refresh":
|
|
161
|
-
"onUpdate:isAutoRefresh": t[0] || (t[0] = (r) =>
|
|
176
|
+
I(Re, c({
|
|
177
|
+
"is-auto-refresh": k.value,
|
|
178
|
+
"onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => k.value = r),
|
|
162
179
|
tableExpose: v,
|
|
163
|
-
loading:
|
|
164
|
-
|
|
180
|
+
loading: n(h),
|
|
181
|
+
exportContext: n(te)
|
|
182
|
+
}, o.toolbar), null, 16, ["is-auto-refresh", "loading", "exportContext"])
|
|
165
183
|
]),
|
|
166
184
|
_: 1
|
|
167
|
-
})) :
|
|
168
|
-
I(
|
|
185
|
+
})) : Ee("", !0),
|
|
186
|
+
I(ue, c({
|
|
169
187
|
ref_key: "elTable",
|
|
170
|
-
ref:
|
|
188
|
+
ref: N,
|
|
171
189
|
class: "table-main-table",
|
|
172
190
|
stripe: "",
|
|
173
191
|
border: "",
|
|
174
192
|
highlightCurrentRow: ""
|
|
175
|
-
},
|
|
176
|
-
maxHeight:
|
|
177
|
-
data:
|
|
178
|
-
rowKey:
|
|
193
|
+
}, n(ne), {
|
|
194
|
+
maxHeight: n(ae),
|
|
195
|
+
data: n(S),
|
|
196
|
+
rowKey: se(f.rowKey)
|
|
179
197
|
}), {
|
|
180
198
|
empty: C(() => [
|
|
181
|
-
|
|
199
|
+
n(h) ? (s(), y(T, { key: 0 }, [
|
|
182
200
|
R("加载中...")
|
|
183
|
-
], 64)) : (
|
|
201
|
+
], 64)) : (s(), b(x, { key: 1 }))
|
|
184
202
|
]),
|
|
185
203
|
default: C(() => [
|
|
186
|
-
(
|
|
204
|
+
(s(!0), y(T, null, xe(f.columns, (r) => (s(), b(a, c({
|
|
187
205
|
key: r.columnKey || r.prop
|
|
188
|
-
}, { ref_for: !0 }, r),
|
|
189
|
-
|
|
206
|
+
}, { ref_for: !0 }, r), Te({ _: 2 }, [
|
|
207
|
+
V(r.type) ? {
|
|
190
208
|
name: "default",
|
|
191
|
-
fn: C((
|
|
192
|
-
|
|
193
|
-
r.render ? (
|
|
209
|
+
fn: C((p) => [
|
|
210
|
+
$(e.$slots, r.prop, c({ ref_for: !0 }, M(p)), () => [
|
|
211
|
+
r.render ? (s(), b(Y(r.render), c({
|
|
194
212
|
key: 0,
|
|
195
213
|
ref_for: !0
|
|
196
|
-
},
|
|
197
|
-
_index:
|
|
198
|
-
}), null, 16, ["_index"])) : (
|
|
199
|
-
R(
|
|
214
|
+
}, M(p, ["$index"]), {
|
|
215
|
+
_index: p.$index
|
|
216
|
+
}), null, 16, ["_index"])) : (s(), y(T, { key: 1 }, [
|
|
217
|
+
R(q(p.row[r.prop]), 1)
|
|
200
218
|
], 64))
|
|
201
219
|
], !0)
|
|
202
220
|
]),
|
|
203
221
|
key: "0"
|
|
204
222
|
} : void 0,
|
|
205
|
-
|
|
223
|
+
V(r.type) ? {
|
|
206
224
|
name: "header",
|
|
207
|
-
fn: C((
|
|
208
|
-
|
|
209
|
-
r.headerRender ? (
|
|
225
|
+
fn: C((p) => [
|
|
226
|
+
$(e.$slots, `header-${r.prop}`, c({ ref_for: !0 }, J(p)), () => [
|
|
227
|
+
r.headerRender ? (s(), b(Y(r.headerRender), c({
|
|
210
228
|
key: 0,
|
|
211
229
|
ref_for: !0
|
|
212
|
-
},
|
|
213
|
-
R(
|
|
230
|
+
}, J(p)), null, 16)) : (s(), y(T, { key: 1 }, [
|
|
231
|
+
R(q(r.label), 1)
|
|
214
232
|
], 64))
|
|
215
233
|
], !0)
|
|
216
234
|
]),
|
|
@@ -220,26 +238,26 @@ const Oe = { class: "table-main" }, ze = { class: "table-main-pagination" }, qe
|
|
|
220
238
|
]),
|
|
221
239
|
_: 3
|
|
222
240
|
}, 16, ["maxHeight", "data", "rowKey"]),
|
|
223
|
-
|
|
224
|
-
I(
|
|
225
|
-
"current-page": l
|
|
226
|
-
"onUpdate:currentPage": t[1] || (t[1] = (r) =>
|
|
227
|
-
"page-size":
|
|
228
|
-
"onUpdate:pageSize": t[2] || (t[2] = (r) =>
|
|
229
|
-
"page-sizes":
|
|
241
|
+
we(Pe("div", Oe, [
|
|
242
|
+
I(fe, {
|
|
243
|
+
"current-page": n(l),
|
|
244
|
+
"onUpdate:currentPage": t[1] || (t[1] = (r) => F(l) ? l.value = r : null),
|
|
245
|
+
"page-size": n(i),
|
|
246
|
+
"onUpdate:pageSize": t[2] || (t[2] = (r) => F(i) ? i.value = r : null),
|
|
247
|
+
"page-sizes": f.pageSizeOptions,
|
|
230
248
|
size: "small",
|
|
231
249
|
background: "",
|
|
232
|
-
layout:
|
|
233
|
-
total:
|
|
234
|
-
onSizeChange:
|
|
250
|
+
layout: f.pageLayout,
|
|
251
|
+
total: n(_),
|
|
252
|
+
onSizeChange: ie
|
|
235
253
|
}, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total"])
|
|
236
254
|
], 512), [
|
|
237
|
-
[
|
|
255
|
+
[Ie, f.showPager]
|
|
238
256
|
])
|
|
239
257
|
]);
|
|
240
258
|
};
|
|
241
259
|
}
|
|
242
260
|
});
|
|
243
261
|
export {
|
|
244
|
-
|
|
262
|
+
Ze as default
|
|
245
263
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableToolbar.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-760501d0"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,69 +1,187 @@
|
|
|
1
|
-
import { ElButton as
|
|
1
|
+
import { ElDropdown as _, ElButton as D, ElIcon as V, ElDropdownMenu as T, ElDropdownItem as $ } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/dropdown/style/css";
|
|
4
|
+
import "element-plus/es/components/dropdown-menu/style/css";
|
|
5
|
+
import "element-plus/es/components/dropdown-item/style/css";
|
|
3
6
|
import "element-plus/es/components/button/style/css";
|
|
4
7
|
import "element-plus/es/components/icon/style/css";
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
8
|
+
import { defineComponent as L, useModel as N, computed as b, ref as y, watch as z, openBlock as f, createElementBlock as P, createElementVNode as F, createBlock as h, withCtx as r, createVNode as n, createTextVNode as v, unref as B, createCommentVNode as w, normalizeClass as S, mergeModels as U } from "vue";
|
|
9
|
+
import { ElMessageBox as X, ElMessage as q } from "element-plus";
|
|
10
|
+
import { ArrowDown as O, Refresh as j } from "@element-plus/icons-vue";
|
|
11
|
+
import G from "../misc/AutoRefresh.vue.mjs";
|
|
12
|
+
import { countAll as H, fetchListAll as k } from "../../helpers/list-helper.mjs";
|
|
13
|
+
import { EXPORT_MAX_LIMIT as c, exportCSV as J } from "../../utils/export.mjs";
|
|
14
|
+
const K = { class: "table-toolbar" }, Q = { class: "table-toolbar-left" }, W = { class: "table-toolbar-right" }, me = /* @__PURE__ */ L({
|
|
9
15
|
__name: "TableToolbar",
|
|
10
|
-
props: /* @__PURE__ */
|
|
11
|
-
|
|
16
|
+
props: /* @__PURE__ */ U({
|
|
17
|
+
leftFeatures: { default: () => ["export"] },
|
|
18
|
+
rightFeatures: { default: () => ["refresh", "autoRefresh"] },
|
|
12
19
|
refreshInterval: { default: 30 },
|
|
20
|
+
exportByFe: { type: Boolean, default: !0 },
|
|
21
|
+
exportFn: {},
|
|
13
22
|
tableExpose: {},
|
|
14
|
-
loading: { type: Boolean }
|
|
23
|
+
loading: { type: Boolean },
|
|
24
|
+
exportContext: {}
|
|
15
25
|
}, {
|
|
16
26
|
isAutoRefresh: { type: Boolean },
|
|
17
27
|
isAutoRefreshModifiers: {}
|
|
18
28
|
}),
|
|
19
29
|
emits: ["update:isAutoRefresh"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
() =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
setup(u) {
|
|
31
|
+
const t = u, g = N(u, "isAutoRefresh"), R = b(() => {
|
|
32
|
+
var o;
|
|
33
|
+
return (o = t.leftFeatures) == null ? void 0 : o.includes("export");
|
|
34
|
+
}), A = b(
|
|
35
|
+
() => t.rightFeatures === void 0 || t.rightFeatures.includes("refresh")
|
|
36
|
+
), C = b(
|
|
37
|
+
() => t.rightFeatures === void 0 || t.rightFeatures.includes("autoRefresh")
|
|
38
|
+
), E = y(30);
|
|
39
|
+
z(
|
|
40
|
+
() => t.refreshInterval,
|
|
41
|
+
(o) => {
|
|
42
|
+
E.value = o;
|
|
30
43
|
},
|
|
31
44
|
{ immediate: !0 }
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
);
|
|
46
|
+
const p = y(!1), M = async (o) => {
|
|
47
|
+
const { columns: e, selectedList: a, currentPageList: x, api: s, query: m } = t.exportContext;
|
|
48
|
+
let i;
|
|
49
|
+
switch (o) {
|
|
50
|
+
case "selected":
|
|
51
|
+
i = a;
|
|
52
|
+
break;
|
|
53
|
+
case "current":
|
|
54
|
+
i = x;
|
|
55
|
+
break;
|
|
56
|
+
case "all":
|
|
57
|
+
try {
|
|
58
|
+
const l = await H(s, m);
|
|
59
|
+
if (l > c) {
|
|
60
|
+
try {
|
|
61
|
+
await X.confirm(
|
|
62
|
+
`数据量超过 ${c} 条(共 ${l} 条),是否只导出前 ${c} 条?`,
|
|
63
|
+
"提示",
|
|
64
|
+
{
|
|
65
|
+
confirmButtonText: "导出",
|
|
66
|
+
cancelButtonText: "取消",
|
|
67
|
+
type: "warning"
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
} catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
i = await k(s, m, { limit: c });
|
|
74
|
+
} else
|
|
75
|
+
i = await k(s, m, { limit: c });
|
|
76
|
+
} catch (l) {
|
|
77
|
+
q.error(`导出失败:${(l == null ? void 0 : l.message) || (l == null ? void 0 : l.toString())}`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
const d = `${document.title}-${Date.now()}`;
|
|
83
|
+
J({ columns: e, list: i, filename: d });
|
|
84
|
+
}, I = (o) => {
|
|
85
|
+
var a;
|
|
86
|
+
if (p.value) return;
|
|
87
|
+
p.value = !0;
|
|
88
|
+
const e = t.exportByFe ? M(o) : (a = t.exportFn) == null ? void 0 : a.call(t, o);
|
|
89
|
+
Promise.resolve(e).catch(() => {
|
|
90
|
+
}).finally(() => {
|
|
91
|
+
p.value = !1;
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
return (o, e) => {
|
|
95
|
+
const a = V, x = D, s = $, m = T, i = _;
|
|
96
|
+
return f(), P("div", K, [
|
|
97
|
+
F("div", Q, [
|
|
98
|
+
R.value ? (f(), h(i, {
|
|
99
|
+
key: 0,
|
|
100
|
+
disabled: !u.exportContext.total,
|
|
101
|
+
onCommand: I
|
|
102
|
+
}, {
|
|
103
|
+
dropdown: r(() => [
|
|
104
|
+
n(m, null, {
|
|
105
|
+
default: r(() => [
|
|
106
|
+
u.exportContext.hasSelection ? (f(), h(s, {
|
|
107
|
+
key: 0,
|
|
108
|
+
command: "selected"
|
|
109
|
+
}, {
|
|
110
|
+
default: r(() => [...e[4] || (e[4] = [
|
|
111
|
+
v(" 导出选择 ", -1)
|
|
112
|
+
])]),
|
|
113
|
+
_: 1
|
|
114
|
+
})) : w("", !0),
|
|
115
|
+
n(s, { command: "current" }, {
|
|
116
|
+
default: r(() => [...e[5] || (e[5] = [
|
|
117
|
+
v("导出本页", -1)
|
|
118
|
+
])]),
|
|
119
|
+
_: 1
|
|
120
|
+
}),
|
|
121
|
+
n(s, { command: "all" }, {
|
|
122
|
+
default: r(() => [...e[6] || (e[6] = [
|
|
123
|
+
v("导出全部", -1)
|
|
124
|
+
])]),
|
|
125
|
+
_: 1
|
|
126
|
+
})
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
})
|
|
130
|
+
]),
|
|
131
|
+
default: r(() => [
|
|
132
|
+
n(x, {
|
|
133
|
+
size: "small",
|
|
134
|
+
type: "primary",
|
|
135
|
+
loading: p.value
|
|
136
|
+
}, {
|
|
137
|
+
default: r(() => [
|
|
138
|
+
e[3] || (e[3] = v(" 导出 ", -1)),
|
|
139
|
+
n(a, null, {
|
|
140
|
+
default: r(() => [
|
|
141
|
+
n(B(O))
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
})
|
|
145
|
+
]),
|
|
146
|
+
_: 1
|
|
147
|
+
}, 8, ["loading"])
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
}, 8, ["disabled"])) : w("", !0)
|
|
151
|
+
]),
|
|
152
|
+
F("div", W, [
|
|
153
|
+
C.value ? (f(), h(G, {
|
|
37
154
|
key: 0,
|
|
38
|
-
modelValue:
|
|
39
|
-
"onUpdate:modelValue":
|
|
40
|
-
interval:
|
|
41
|
-
"onUpdate:interval":
|
|
42
|
-
refreshFn:
|
|
43
|
-
enabled: !
|
|
44
|
-
}, null, 8, ["modelValue", "interval", "refreshFn", "enabled"])) :
|
|
45
|
-
|
|
155
|
+
modelValue: g.value,
|
|
156
|
+
"onUpdate:modelValue": e[0] || (e[0] = (d) => g.value = d),
|
|
157
|
+
interval: E.value,
|
|
158
|
+
"onUpdate:interval": e[1] || (e[1] = (d) => E.value = d),
|
|
159
|
+
refreshFn: t.tableExpose.refresh,
|
|
160
|
+
enabled: !u.loading
|
|
161
|
+
}, null, 8, ["modelValue", "interval", "refreshFn", "enabled"])) : w("", !0),
|
|
162
|
+
A.value ? (f(), h(x, {
|
|
46
163
|
key: 1,
|
|
164
|
+
size: "small",
|
|
47
165
|
circle: "",
|
|
48
|
-
onClick:
|
|
166
|
+
onClick: e[2] || (e[2] = (d) => t.tableExpose.refresh())
|
|
49
167
|
}, {
|
|
50
|
-
default:
|
|
51
|
-
|
|
52
|
-
class:
|
|
168
|
+
default: r(() => [
|
|
169
|
+
n(a, {
|
|
170
|
+
class: S({ "table-toolbar-icon--rotating": u.loading })
|
|
53
171
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
172
|
+
default: r(() => [
|
|
173
|
+
n(B(j))
|
|
56
174
|
]),
|
|
57
175
|
_: 1
|
|
58
176
|
}, 8, ["class"])
|
|
59
177
|
]),
|
|
60
178
|
_: 1
|
|
61
|
-
})) :
|
|
179
|
+
})) : w("", !0)
|
|
62
180
|
])
|
|
63
181
|
]);
|
|
64
182
|
};
|
|
65
183
|
}
|
|
66
184
|
});
|
|
67
185
|
export {
|
|
68
|
-
|
|
186
|
+
me as default
|
|
69
187
|
};
|