@done-coding/admin-core 0.5.1-alpha.1 → 0.6.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/app-layout/AppBody.vue.mjs +2 -2
- package/es/components/app-layout/AppBody.vue2.mjs +33 -35
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +2 -2
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +6 -7
- package/es/components/app-layout/AppLayout.vue.mjs +1 -1
- package/es/components/app-layout/AppLayout.vue2.mjs +25 -28
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +19 -17
- package/es/components/display/BooleanTag.vue.mjs +30 -0
- package/es/components/display/BooleanTag.vue2.mjs +4 -0
- package/es/components/list-page/ListPage.vue.mjs +1 -1
- package/es/components/list-page/ListPage.vue2.mjs +101 -89
- package/es/components/misc/ActionBtn.vue.mjs +29 -29
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +50 -42
- package/es/components/misc/AutoRefreshGroup.vue.mjs +7 -0
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +60 -0
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +177 -167
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +98 -109
- package/es/index.mjs +148 -144
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/app-layout/AppBody.vue.d.ts +0 -2
- package/types/components/app-layout/AppBreadcrumb.vue.d.ts +0 -1
- package/types/components/data-view/DataListView.vue.d.ts +2 -2
- package/types/components/data-view/types.d.ts +4 -2
- package/types/components/display/BooleanTag.vue.d.ts +8 -0
- package/types/components/display/index.d.ts +7 -1
- package/types/components/display/types.d.ts +19 -0
- package/types/components/list-page/ListPage.vue.d.ts +9 -13
- package/types/components/list-page/types.d.ts +1 -1
- package/types/components/misc/AutoRefresh.vue.d.ts +3 -9
- package/types/components/misc/AutoRefreshGroup.vue.d.ts +17 -0
- package/types/components/misc/index.d.ts +2 -1
- package/types/components/misc/types.d.ts +15 -0
- package/types/components/table/TableMain.vue.d.ts +9 -13
- package/types/components/table/TableToolbar.vue.d.ts +6 -2
- package/types/components/table/types.d.ts +20 -19
- package/types/hooks/activated.d.ts +2 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ElLoadingDirective as
|
|
1
|
+
import { ElLoadingDirective as de } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/loading/style/css";
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import
|
|
6
|
-
import { generateFormData as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import { defineComponent as ve, useCssVars as me, unref as a, useSlots as pe, computed as o, useModel as w, ref as u, shallowRef as q, watch as we, withDirectives as Se, openBlock as S, createElementBlock as ye, createBlock as x, withCtx as h, renderSlot as f, createCommentVNode as E, createVNode as L, mergeProps as y, createSlots as N, renderList as C, normalizeProps as b, guardReactiveProps as H, mergeModels as U } from "vue";
|
|
5
|
+
import Ce from "../form/FormSearch.vue.mjs";
|
|
6
|
+
import { generateFormData as be, stringifyFormData as He } from "../form/utils.mjs";
|
|
7
|
+
import J from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import Ve from "../table/TableMain.vue.mjs";
|
|
9
|
+
import Ie from "lodash/pick";
|
|
10
10
|
import Re from "lodash/cloneDeep";
|
|
11
|
-
import { useChannelViewportHeight as
|
|
12
|
-
const
|
|
11
|
+
import { useChannelViewportHeight as Me } from "../../hooks/use-channel-viewport-height.mjs";
|
|
12
|
+
const ke = {
|
|
13
13
|
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
14
14
|
class: "list-page"
|
|
15
|
-
},
|
|
15
|
+
}, xe = /* @__PURE__ */ ve({
|
|
16
16
|
__name: "ListPage",
|
|
17
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ U({
|
|
18
18
|
staticQuery: { default: () => ({}) },
|
|
19
19
|
formSearchProps: {},
|
|
20
20
|
columns: {},
|
|
@@ -23,6 +23,8 @@ const $e = {
|
|
|
23
23
|
refineReduceHeight: { default: 0 },
|
|
24
24
|
viewportHeight: {},
|
|
25
25
|
parentChannel: {},
|
|
26
|
+
toolbar: {},
|
|
27
|
+
showSwitchView: { type: Boolean },
|
|
26
28
|
tableMainProps: {},
|
|
27
29
|
list: { default: () => [] },
|
|
28
30
|
api: {},
|
|
@@ -32,21 +34,25 @@ const $e = {
|
|
|
32
34
|
clearTableFilterOnReset: { type: Boolean }
|
|
33
35
|
}, {
|
|
34
36
|
isAutoRefresh: { type: Boolean },
|
|
35
|
-
isAutoRefreshModifiers: {}
|
|
37
|
+
isAutoRefreshModifiers: {},
|
|
38
|
+
refreshInterval: {},
|
|
39
|
+
refreshIntervalModifiers: {},
|
|
40
|
+
customView: { type: Boolean, default: !1 },
|
|
41
|
+
customViewModifiers: {}
|
|
36
42
|
}),
|
|
37
|
-
emits: /* @__PURE__ */
|
|
38
|
-
setup(
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
emits: /* @__PURE__ */ U(["dataChange", "pageInfoChange"], ["update:isAutoRefresh", "update:refreshInterval", "update:customView"]),
|
|
44
|
+
setup(s, { expose: Q, emit: z }) {
|
|
45
|
+
me((e) => ({
|
|
46
|
+
v9299b0d4: a(_)
|
|
41
47
|
}));
|
|
42
|
-
const n =
|
|
48
|
+
const n = s, V = z, I = pe(), R = o(() => !!I.header), M = o(() => !!I.operation), v = w(s, "isAutoRefresh"), k = w(s, "refreshInterval"), $ = w(s, "customView"), m = u({}), p = u(
|
|
43
49
|
{}
|
|
44
|
-
), D = u(!1),
|
|
50
|
+
), D = u(!1), i = q(), c = q(), { viewportHeightFinal: G } = Me(n, {
|
|
45
51
|
fallback: 500
|
|
46
|
-
}), F = u(0),
|
|
52
|
+
}), F = u(0), P = u(0), j = u(0), W = o(() => ({
|
|
47
53
|
...p.value,
|
|
48
54
|
...n.staticQuery
|
|
49
|
-
})),
|
|
55
|
+
})), A = u(!1), X = o(() => A.value ? F.value + 10 : 0), Y = o(() => M.value ? P.value + 10 : 0), Z = o(() => R.value ? j.value + 10 : 0), B = o(() => G.value - n.refineReduceHeight), _ = o(() => n.refine ? `${B.value}px` : "auto"), ee = o(() => n.refine ? B.value - X.value - Y.value - Z.value : void 0), K = (e, t = "search") => {
|
|
50
56
|
var r, l, d;
|
|
51
57
|
let g = e;
|
|
52
58
|
if (n.beforeSearch && (g = n.beforeSearch(
|
|
@@ -57,19 +63,19 @@ const $e = {
|
|
|
57
63
|
p.value = {
|
|
58
64
|
...g
|
|
59
65
|
};
|
|
60
|
-
}, Z = (e) => {
|
|
61
|
-
w("dataChange", e);
|
|
62
|
-
}, _ = (e) => {
|
|
63
|
-
w("pageInfoChange", e);
|
|
64
|
-
}, ee = (e) => {
|
|
65
|
-
D.value = e;
|
|
66
66
|
}, te = (e) => {
|
|
67
|
-
|
|
67
|
+
V("dataChange", e);
|
|
68
68
|
}, re = (e) => {
|
|
69
|
-
|
|
69
|
+
V("pageInfoChange", e);
|
|
70
70
|
}, ae = (e) => {
|
|
71
|
-
|
|
72
|
-
}, oe =
|
|
71
|
+
D.value = e;
|
|
72
|
+
}, oe = (e) => {
|
|
73
|
+
F.value = e;
|
|
74
|
+
}, se = (e) => {
|
|
75
|
+
P.value = e;
|
|
76
|
+
}, ne = (e) => {
|
|
77
|
+
j.value = e;
|
|
78
|
+
}, ie = o(() => n.list), le = o(() => n.rowKey), O = o(() => m.value), T = {
|
|
73
79
|
refresh: async (e = !1) => {
|
|
74
80
|
var t;
|
|
75
81
|
return (t = c.value) == null ? void 0 : t.refresh(e);
|
|
@@ -83,39 +89,39 @@ const $e = {
|
|
|
83
89
|
return (e = c.value) == null ? void 0 : e.getTableInstance();
|
|
84
90
|
},
|
|
85
91
|
validate: () => {
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
92
|
+
if (i.value)
|
|
93
|
+
return i.value.validate();
|
|
88
94
|
throw new Error("实例化未完成");
|
|
89
95
|
},
|
|
90
96
|
resetFields: () => {
|
|
91
97
|
var e;
|
|
92
|
-
return (e =
|
|
98
|
+
return (e = i.value) == null ? void 0 : e.resetFields();
|
|
93
99
|
},
|
|
94
100
|
clearValidate: (e) => {
|
|
95
101
|
var t;
|
|
96
|
-
return (t =
|
|
102
|
+
return (t = i.value) == null ? void 0 : t.clearValidate(e);
|
|
97
103
|
},
|
|
98
104
|
triggerReset: () => {
|
|
99
105
|
var e;
|
|
100
|
-
return (e =
|
|
106
|
+
return (e = i.value) == null ? void 0 : e.triggerReset();
|
|
101
107
|
},
|
|
102
108
|
triggerSearch: () => {
|
|
103
109
|
var e;
|
|
104
|
-
return (e =
|
|
110
|
+
return (e = i.value) == null ? void 0 : e.triggerSearch();
|
|
105
111
|
},
|
|
106
112
|
toggleCollapse: (e) => {
|
|
107
113
|
var t;
|
|
108
|
-
return (t =
|
|
114
|
+
return (t = i.value) == null ? void 0 : t.toggleCollapse(e);
|
|
109
115
|
},
|
|
110
116
|
isCollapsed: o(() => {
|
|
111
117
|
var e;
|
|
112
|
-
return ((e =
|
|
118
|
+
return ((e = i.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
|
|
113
119
|
}),
|
|
114
120
|
update: (e, t) => {
|
|
115
|
-
|
|
121
|
+
m.value[e] = t;
|
|
116
122
|
}
|
|
117
|
-
},
|
|
118
|
-
const e =
|
|
123
|
+
}, ue = o(() => {
|
|
124
|
+
const e = Ie(T, [
|
|
119
125
|
"triggerReset",
|
|
120
126
|
"triggerSearch",
|
|
121
127
|
"update"
|
|
@@ -124,105 +130,111 @@ const $e = {
|
|
|
124
130
|
...n.injectInfo || {},
|
|
125
131
|
...e
|
|
126
132
|
};
|
|
127
|
-
}),
|
|
128
|
-
|
|
133
|
+
}), ce = (e) => e, he = (e) => e, fe = (e) => e, ge = (e) => {
|
|
134
|
+
A.value = e;
|
|
129
135
|
};
|
|
130
|
-
return
|
|
136
|
+
return Q(T), we(
|
|
131
137
|
() => n.list,
|
|
132
138
|
(e) => {
|
|
133
|
-
const t =
|
|
134
|
-
|
|
139
|
+
const t = be(e);
|
|
140
|
+
m.value = t, K(He(t, e));
|
|
135
141
|
},
|
|
136
142
|
{
|
|
137
143
|
immediate: !0
|
|
138
144
|
}
|
|
139
145
|
), (e, t) => {
|
|
140
|
-
const g =
|
|
141
|
-
return
|
|
142
|
-
a(
|
|
146
|
+
const g = de;
|
|
147
|
+
return Se((S(), ye("div", ke, [
|
|
148
|
+
a(R) ? (S(), x(a(J), {
|
|
143
149
|
key: 0,
|
|
144
150
|
class: "list-page-header",
|
|
145
|
-
onHeightChange:
|
|
151
|
+
onHeightChange: ne
|
|
146
152
|
}, {
|
|
147
153
|
default: h(() => [
|
|
148
154
|
f(e.$slots, "header", {}, void 0, !0)
|
|
149
155
|
]),
|
|
150
156
|
_: 3
|
|
151
|
-
})) :
|
|
152
|
-
|
|
157
|
+
})) : E("", !0),
|
|
158
|
+
L(a(Ce), y({
|
|
153
159
|
ref_key: "formSearch",
|
|
154
|
-
ref:
|
|
155
|
-
list: a(
|
|
156
|
-
data: a(
|
|
157
|
-
},
|
|
158
|
-
onSearch:
|
|
159
|
-
onHeightChange:
|
|
160
|
-
onVisibleChange:
|
|
161
|
-
}),
|
|
162
|
-
|
|
160
|
+
ref: i,
|
|
161
|
+
list: a(ie),
|
|
162
|
+
data: a(O)
|
|
163
|
+
}, s.formSearchProps, {
|
|
164
|
+
onSearch: K,
|
|
165
|
+
onHeightChange: oe,
|
|
166
|
+
onVisibleChange: ge
|
|
167
|
+
}), N({ _: 2 }, [
|
|
168
|
+
C(s.list, (r) => ({
|
|
163
169
|
name: r.key,
|
|
164
170
|
fn: h((l) => [
|
|
165
|
-
f(e.$slots, `form-${r.key}`,
|
|
171
|
+
f(e.$slots, `form-${r.key}`, b(H(l)), void 0, !0)
|
|
166
172
|
])
|
|
167
173
|
}))
|
|
168
174
|
]), 1040, ["list", "data"]),
|
|
169
|
-
a(
|
|
175
|
+
a(M) ? (S(), x(a(J), {
|
|
170
176
|
key: 1,
|
|
171
177
|
class: "list-page-operation",
|
|
172
|
-
onHeightChange:
|
|
178
|
+
onHeightChange: se
|
|
173
179
|
}, {
|
|
174
180
|
default: h(() => [
|
|
175
181
|
f(e.$slots, "operation", {}, void 0, !0)
|
|
176
182
|
]),
|
|
177
183
|
_: 3
|
|
178
|
-
})) :
|
|
179
|
-
|
|
184
|
+
})) : E("", !0),
|
|
185
|
+
L(a(Ve), y({
|
|
180
186
|
ref_key: "tableMain",
|
|
181
187
|
ref: c,
|
|
182
|
-
"is-auto-refresh":
|
|
183
|
-
"onUpdate:isAutoRefresh": t[0] || (t[0] = (r) =>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
"is-auto-refresh": v.value,
|
|
189
|
+
"onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => v.value = r),
|
|
190
|
+
"refresh-interval": k.value,
|
|
191
|
+
"onUpdate:refreshInterval": t[1] || (t[1] = (r) => k.value = r),
|
|
192
|
+
"custom-view": $.value,
|
|
193
|
+
"onUpdate:customView": t[2] || (t[2] = (r) => $.value = r),
|
|
194
|
+
api: s.api,
|
|
195
|
+
columns: s.columns,
|
|
196
|
+
query: a(W),
|
|
197
|
+
maxHeight: a(ee),
|
|
198
|
+
rowKey: a(le),
|
|
199
|
+
toolbar: s.toolbar,
|
|
200
|
+
showSwitchView: s.showSwitchView
|
|
201
|
+
}, s.tableMainProps, {
|
|
190
202
|
refine: !1,
|
|
191
|
-
injectInfo: a(
|
|
192
|
-
onLoadingChange:
|
|
193
|
-
onDataChange:
|
|
194
|
-
onPageInfoChange:
|
|
195
|
-
}),
|
|
203
|
+
injectInfo: a(ue),
|
|
204
|
+
onLoadingChange: ae,
|
|
205
|
+
onDataChange: te,
|
|
206
|
+
onPageInfoChange: re
|
|
207
|
+
}), N({
|
|
196
208
|
"custom-view-item": h((r) => [
|
|
197
|
-
f(e.$slots, "custom-view-item",
|
|
209
|
+
f(e.$slots, "custom-view-item", b(H(fe(r))), void 0, !0)
|
|
198
210
|
]),
|
|
199
211
|
_: 2
|
|
200
212
|
}, [
|
|
201
|
-
|
|
213
|
+
C(s.columns, (r) => ({
|
|
202
214
|
name: r.prop,
|
|
203
215
|
fn: h((l) => [
|
|
204
|
-
f(e.$slots, `table-${r.prop}`,
|
|
216
|
+
f(e.$slots, `table-${r.prop}`, b(H(ce(l))), void 0, !0)
|
|
205
217
|
])
|
|
206
218
|
})),
|
|
207
|
-
|
|
219
|
+
C(s.columns, (r) => ({
|
|
208
220
|
name: `header-${r.prop}`,
|
|
209
221
|
fn: h((l) => {
|
|
210
222
|
var d;
|
|
211
223
|
return [
|
|
212
|
-
f(e.$slots, `table-header-${r.columnKey || r.prop}`, y(
|
|
213
|
-
searchFormData: a(
|
|
214
|
-
triggerSearch: (d = a(
|
|
224
|
+
f(e.$slots, `table-header-${r.columnKey || r.prop}`, y(he(l), {
|
|
225
|
+
searchFormData: a(O),
|
|
226
|
+
triggerSearch: (d = a(i)) == null ? void 0 : d.triggerSearch
|
|
215
227
|
}), void 0, !0)
|
|
216
228
|
];
|
|
217
229
|
})
|
|
218
230
|
}))
|
|
219
|
-
]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
|
|
231
|
+
]), 1040, ["is-auto-refresh", "refresh-interval", "custom-view", "api", "columns", "query", "maxHeight", "rowKey", "toolbar", "showSwitchView", "injectInfo"])
|
|
220
232
|
])), [
|
|
221
|
-
[g, !
|
|
233
|
+
[g, !v.value && a(D)]
|
|
222
234
|
]);
|
|
223
235
|
};
|
|
224
236
|
}
|
|
225
237
|
});
|
|
226
238
|
export {
|
|
227
|
-
|
|
239
|
+
xe as default
|
|
228
240
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as z, toRefs as E, getCurrentInstance as M, ref as p, computed as
|
|
2
|
-
import { ElButton as
|
|
1
|
+
import { defineComponent as z, toRefs as E, getCurrentInstance as M, ref as p, computed as b, watch as R, openBlock as x, createBlock as w, unref as u, withCtx as d, createVNode as V, mergeProps as A, renderSlot as I } from "vue";
|
|
2
|
+
import { ElButton as T } from "element-plus";
|
|
3
3
|
import $ from "./ActionConfirm.vue.mjs";
|
|
4
4
|
const q = /* @__PURE__ */ z({
|
|
5
5
|
inheritAttrs: !1,
|
|
@@ -28,13 +28,13 @@ const q = /* @__PURE__ */ z({
|
|
|
28
28
|
beforeOpen: { type: Function }
|
|
29
29
|
},
|
|
30
30
|
emits: ["click"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
let
|
|
34
|
-
const
|
|
31
|
+
setup(v) {
|
|
32
|
+
const m = v, { confirmConfig: s, confirmMode: F, beforeOpen: f } = E(m), r = M(), o = p(!1), c = p(!1), l = p();
|
|
33
|
+
let y;
|
|
34
|
+
const L = b(
|
|
35
35
|
() => !!s.value || !!f.value
|
|
36
|
-
),
|
|
37
|
-
const e =
|
|
36
|
+
), g = b(() => {
|
|
37
|
+
const e = m, t = {}, a = [
|
|
38
38
|
"type",
|
|
39
39
|
"size",
|
|
40
40
|
"plain",
|
|
@@ -55,28 +55,28 @@ const q = /* @__PURE__ */ z({
|
|
|
55
55
|
];
|
|
56
56
|
for (const n of a) e[n] !== void 0 && (t[n] = e[n]);
|
|
57
57
|
return { ...r == null ? void 0 : r.attrs, ...t };
|
|
58
|
-
}),
|
|
58
|
+
}), O = (e) => !!e && typeof e.then == "function", P = () => {
|
|
59
59
|
var t;
|
|
60
60
|
const e = (t = r == null ? void 0 : r.vnode.props) == null ? void 0 : t.onClick;
|
|
61
61
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
62
|
-
},
|
|
63
|
-
const e =
|
|
62
|
+
}, k = () => {
|
|
63
|
+
const e = P();
|
|
64
64
|
if (!e.length) return;
|
|
65
|
-
const t =
|
|
65
|
+
const t = y;
|
|
66
66
|
let a;
|
|
67
67
|
try {
|
|
68
68
|
a = e.map((i) => i(t));
|
|
69
69
|
} catch (i) {
|
|
70
70
|
throw o.value = !1, i;
|
|
71
71
|
}
|
|
72
|
-
const n = a.filter(
|
|
72
|
+
const n = a.filter(O);
|
|
73
73
|
if (n.length)
|
|
74
74
|
return o.value = !0, Promise.all(n).finally(() => {
|
|
75
75
|
o.value = !1;
|
|
76
76
|
});
|
|
77
|
-
},
|
|
77
|
+
}, S = k, B = async (e) => {
|
|
78
78
|
if (o.value || c.value) return;
|
|
79
|
-
|
|
79
|
+
y = e;
|
|
80
80
|
let t;
|
|
81
81
|
if (f.value) {
|
|
82
82
|
o.value = !0;
|
|
@@ -89,42 +89,42 @@ const q = /* @__PURE__ */ z({
|
|
|
89
89
|
o.value = !1;
|
|
90
90
|
} else
|
|
91
91
|
t = void 0;
|
|
92
|
-
s.value ? (l.value = typeof s.value == "function" ? s.value(t) : s.value, c.value = !0) :
|
|
92
|
+
s.value ? (l.value = typeof s.value == "function" ? s.value(t) : s.value, c.value = !0) : k();
|
|
93
93
|
};
|
|
94
94
|
return R(c, (e) => {
|
|
95
95
|
e || (l.value = void 0);
|
|
96
96
|
}), (e, t) => {
|
|
97
|
-
var a, n, i,
|
|
98
|
-
return
|
|
97
|
+
var a, n, i, h, C;
|
|
98
|
+
return L.value ? (x(), w($, {
|
|
99
99
|
key: 0,
|
|
100
100
|
show: c.value,
|
|
101
|
-
"onUpdate:show": t[0] || (t[0] = (
|
|
102
|
-
mode: u(
|
|
101
|
+
"onUpdate:show": t[0] || (t[0] = (_) => c.value = _),
|
|
102
|
+
mode: u(F) || "popconfirm",
|
|
103
103
|
title: (a = l.value) == null ? void 0 : a.title,
|
|
104
104
|
content: (n = l.value) == null ? void 0 : n.content,
|
|
105
105
|
"confirm-text": (i = l.value) == null ? void 0 : i.confirmText,
|
|
106
|
-
"cancel-text": (
|
|
107
|
-
type: (
|
|
108
|
-
"submit-fn": u(
|
|
106
|
+
"cancel-text": (h = l.value) == null ? void 0 : h.cancelText,
|
|
107
|
+
type: ((C = l.value) == null ? void 0 : C.type) ?? v.type,
|
|
108
|
+
"submit-fn": u(S)
|
|
109
109
|
}, {
|
|
110
110
|
default: d(() => [
|
|
111
|
-
V(u(
|
|
111
|
+
V(u(T), A(g.value, {
|
|
112
112
|
loading: o.value,
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: B
|
|
114
114
|
}), {
|
|
115
115
|
default: d(() => [
|
|
116
|
-
|
|
116
|
+
I(e.$slots, "default")
|
|
117
117
|
]),
|
|
118
118
|
_: 3
|
|
119
119
|
}, 16, ["loading"])
|
|
120
120
|
]),
|
|
121
121
|
_: 3
|
|
122
|
-
}, 8, ["show", "mode", "title", "content", "confirm-text", "cancel-text", "type", "submit-fn"])) : (
|
|
122
|
+
}, 8, ["show", "mode", "title", "content", "confirm-text", "cancel-text", "type", "submit-fn"])) : (x(), w(u(T), A({ key: 1 }, g.value, {
|
|
123
123
|
loading: o.value,
|
|
124
|
-
onClick:
|
|
124
|
+
onClick: B
|
|
125
125
|
}), {
|
|
126
126
|
default: d(() => [
|
|
127
|
-
|
|
127
|
+
I(e.$slots, "default")
|
|
128
128
|
]),
|
|
129
129
|
_: 3
|
|
130
130
|
}, 16, ["loading"]));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AutoRefresh.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1f8a1089"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,63 +1,71 @@
|
|
|
1
|
-
import { ElInputNumber as
|
|
1
|
+
import { ElPopover as M, ElInputNumber as R, ElSwitch as y } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
|
-
import "element-plus/es/components/
|
|
3
|
+
import "element-plus/es/components/popover/style/css";
|
|
4
4
|
import "element-plus/es/components/input-number/style/css";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import "element-plus/es/components/switch/style/css";
|
|
6
|
+
import { defineComponent as B, useModel as d, computed as N, watch as g, openBlock as x, createBlock as P, withCtx as f, createElementVNode as p, createVNode as v, unref as h, mergeModels as T } from "vue";
|
|
7
|
+
import { Refresh as V } from "@element-plus/icons-vue";
|
|
8
|
+
import { useTimeout as k } from "../../hooks/timeout.mjs";
|
|
9
|
+
import { useActivated as A } from "../../hooks/activated.mjs";
|
|
10
|
+
const C = { class: "auto-refresh" }, H = /* @__PURE__ */ B({
|
|
10
11
|
__name: "AutoRefresh",
|
|
11
12
|
props: /* @__PURE__ */ T({
|
|
12
13
|
refreshFn: {},
|
|
13
|
-
|
|
14
|
+
disabled: { type: Boolean }
|
|
14
15
|
}, {
|
|
15
16
|
modelValue: { type: Boolean, default: !1 },
|
|
16
17
|
modelModifiers: {},
|
|
17
|
-
interval: { default:
|
|
18
|
+
interval: { default: 5 },
|
|
18
19
|
intervalModifiers: {}
|
|
19
20
|
}),
|
|
20
21
|
emits: ["update:modelValue", "update:interval"],
|
|
21
|
-
setup(
|
|
22
|
-
const u =
|
|
22
|
+
setup(r) {
|
|
23
|
+
const u = r, a = d(r, "modelValue"), t = d(r, "interval"), n = N(() => a.value && !u.disabled), [E, m] = k();
|
|
23
24
|
let o = null;
|
|
24
|
-
const
|
|
25
|
+
const c = () => (o || (o = u.refreshFn().catch(() => {
|
|
25
26
|
}).finally(() => {
|
|
26
27
|
o = null;
|
|
27
28
|
})), o), i = () => {
|
|
28
|
-
|
|
29
|
-
await
|
|
30
|
-
},
|
|
29
|
+
E(async () => {
|
|
30
|
+
await c(), n.value && i();
|
|
31
|
+
}, t.value * 1e3);
|
|
31
32
|
};
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
}), A(({ triggerType:
|
|
35
|
-
|
|
36
|
-
}), (
|
|
37
|
-
const y =
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, null, 8, ["modelValue"])
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
return g([n, t], ([l]) => {
|
|
34
|
+
l ? i() : m();
|
|
35
|
+
}), A(({ isActivated: l, triggerType: e }) => {
|
|
36
|
+
l && n.value && (e === "activated" && (m(), c()), i());
|
|
37
|
+
}), (l, e) => {
|
|
38
|
+
const b = y, _ = R, w = M;
|
|
39
|
+
return x(), P(w, {
|
|
40
|
+
trigger: "hover",
|
|
41
|
+
placement: "bottom-start"
|
|
42
|
+
}, {
|
|
43
|
+
reference: f(() => [
|
|
44
|
+
v(b, {
|
|
45
|
+
modelValue: a.value,
|
|
46
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => a.value = s),
|
|
47
|
+
"active-action-icon": h(V),
|
|
48
|
+
"inactive-action-icon": h(V)
|
|
49
|
+
}, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"])
|
|
50
|
+
]),
|
|
51
|
+
default: f(() => [
|
|
52
|
+
p("div", C, [
|
|
53
|
+
e[2] || (e[2] = p("div", { class: "auto-refresh-label" }, "自动刷新间隔(秒)", -1)),
|
|
54
|
+
v(_, {
|
|
55
|
+
modelValue: t.value,
|
|
56
|
+
"onUpdate:modelValue": e[1] || (e[1] = (s) => t.value = s),
|
|
57
|
+
min: 1,
|
|
58
|
+
step: 1,
|
|
59
|
+
size: "small",
|
|
60
|
+
class: "auto-refresh-interval"
|
|
61
|
+
}, null, 8, ["modelValue"])
|
|
62
|
+
])
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
});
|
|
58
66
|
};
|
|
59
67
|
}
|
|
60
68
|
});
|
|
61
69
|
export {
|
|
62
|
-
|
|
70
|
+
H as default
|
|
63
71
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ElButton as h, ElIcon as c } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/button/style/css";
|
|
4
|
+
import "element-plus/es/components/icon/style/css";
|
|
5
|
+
import { defineComponent as v, useModel as s, openBlock as r, createElementBlock as R, Fragment as p, createBlock as a, createCommentVNode as u, withCtx as i, createVNode as f, normalizeClass as A, unref as B, mergeModels as g } from "vue";
|
|
6
|
+
import k from "./AutoRefresh.vue.mjs";
|
|
7
|
+
import { Refresh as y } from "@element-plus/icons-vue";
|
|
8
|
+
const b = /* @__PURE__ */ v({
|
|
9
|
+
__name: "AutoRefreshGroup",
|
|
10
|
+
props: /* @__PURE__ */ g({
|
|
11
|
+
showAutoRefresh: { type: Boolean, default: !0 },
|
|
12
|
+
showRefresh: { type: Boolean, default: !0 },
|
|
13
|
+
loading: { type: Boolean },
|
|
14
|
+
refreshFn: {}
|
|
15
|
+
}, {
|
|
16
|
+
isAutoRefresh: { type: Boolean },
|
|
17
|
+
isAutoRefreshModifiers: {},
|
|
18
|
+
interval: { default: 5 },
|
|
19
|
+
intervalModifiers: {}
|
|
20
|
+
}),
|
|
21
|
+
emits: ["update:isAutoRefresh", "update:interval"],
|
|
22
|
+
setup(e) {
|
|
23
|
+
const l = s(e, "isAutoRefresh"), n = s(e, "interval");
|
|
24
|
+
return (F, t) => {
|
|
25
|
+
const d = c, m = h;
|
|
26
|
+
return r(), R(p, null, [
|
|
27
|
+
e.showAutoRefresh ? (r(), a(k, {
|
|
28
|
+
key: 0,
|
|
29
|
+
modelValue: l.value,
|
|
30
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => l.value = o),
|
|
31
|
+
interval: n.value,
|
|
32
|
+
"onUpdate:interval": t[1] || (t[1] = (o) => n.value = o),
|
|
33
|
+
refreshFn: e.refreshFn,
|
|
34
|
+
disabled: e.loading
|
|
35
|
+
}, null, 8, ["modelValue", "interval", "refreshFn", "disabled"])) : u("", !0),
|
|
36
|
+
e.showRefresh ? (r(), a(m, {
|
|
37
|
+
key: 1,
|
|
38
|
+
size: "small",
|
|
39
|
+
circle: "",
|
|
40
|
+
onClick: t[2] || (t[2] = (o) => e.refreshFn())
|
|
41
|
+
}, {
|
|
42
|
+
default: i(() => [
|
|
43
|
+
f(d, {
|
|
44
|
+
class: A({ "auto-refresh-group-icon--rotating": e.loading })
|
|
45
|
+
}, {
|
|
46
|
+
default: i(() => [
|
|
47
|
+
f(B(y))
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["class"])
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
})) : u("", !0)
|
|
54
|
+
], 64);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
b as default
|
|
60
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableMain.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-05684b89"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|