@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.
Files changed (41) hide show
  1. package/es/components/app-layout/AppBody.vue.mjs +2 -2
  2. package/es/components/app-layout/AppBody.vue2.mjs +33 -35
  3. package/es/components/app-layout/AppBreadcrumb.vue.mjs +2 -2
  4. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +6 -7
  5. package/es/components/app-layout/AppLayout.vue.mjs +1 -1
  6. package/es/components/app-layout/AppLayout.vue2.mjs +25 -28
  7. package/es/components/data-view/DataListView.vue.mjs +2 -2
  8. package/es/components/data-view/DataListView.vue2.mjs +19 -17
  9. package/es/components/display/BooleanTag.vue.mjs +30 -0
  10. package/es/components/display/BooleanTag.vue2.mjs +4 -0
  11. package/es/components/list-page/ListPage.vue.mjs +1 -1
  12. package/es/components/list-page/ListPage.vue2.mjs +101 -89
  13. package/es/components/misc/ActionBtn.vue.mjs +29 -29
  14. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  15. package/es/components/misc/AutoRefresh.vue2.mjs +50 -42
  16. package/es/components/misc/AutoRefreshGroup.vue.mjs +7 -0
  17. package/es/components/misc/AutoRefreshGroup.vue2.mjs +60 -0
  18. package/es/components/table/TableMain.vue.mjs +3 -3
  19. package/es/components/table/TableMain.vue2.mjs +177 -167
  20. package/es/components/table/TableToolbar.vue.mjs +2 -2
  21. package/es/components/table/TableToolbar.vue2.mjs +98 -109
  22. package/es/index.mjs +148 -144
  23. package/es/style.css +1 -1
  24. package/package.json +2 -2
  25. package/types/components/app-layout/AppBody.vue.d.ts +0 -2
  26. package/types/components/app-layout/AppBreadcrumb.vue.d.ts +0 -1
  27. package/types/components/data-view/DataListView.vue.d.ts +2 -2
  28. package/types/components/data-view/types.d.ts +4 -2
  29. package/types/components/display/BooleanTag.vue.d.ts +8 -0
  30. package/types/components/display/index.d.ts +7 -1
  31. package/types/components/display/types.d.ts +19 -0
  32. package/types/components/list-page/ListPage.vue.d.ts +9 -13
  33. package/types/components/list-page/types.d.ts +1 -1
  34. package/types/components/misc/AutoRefresh.vue.d.ts +3 -9
  35. package/types/components/misc/AutoRefreshGroup.vue.d.ts +17 -0
  36. package/types/components/misc/index.d.ts +2 -1
  37. package/types/components/misc/types.d.ts +15 -0
  38. package/types/components/table/TableMain.vue.d.ts +9 -13
  39. package/types/components/table/TableToolbar.vue.d.ts +6 -2
  40. package/types/components/table/types.d.ts +20 -19
  41. package/types/hooks/activated.d.ts +2 -0
@@ -1,20 +1,20 @@
1
- import { ElLoadingDirective as he } from "element-plus/es";
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 fe, useCssVars as ge, unref as a, useSlots as de, computed as o, useModel as me, ref as u, shallowRef as K, watch as ve, withDirectives as pe, openBlock as C, createElementBlock as Ce, createBlock as O, withCtx as h, renderSlot as f, createCommentVNode as T, createVNode as q, mergeProps as y, createSlots as x, renderList as H, normalizeProps as S, guardReactiveProps as b, mergeModels as E } from "vue";
5
- import ye from "../form/FormSearch.vue.mjs";
6
- import { generateFormData as He, stringifyFormData as Se } from "../form/utils.mjs";
7
- import L from "../display/WatchSize.vue.mjs";
8
- import be from "../table/TableMain.vue.mjs";
9
- import we from "lodash/pick";
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 ke } from "../../hooks/use-channel-viewport-height.mjs";
12
- const $e = {
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
- }, Te = /* @__PURE__ */ fe({
15
+ }, xe = /* @__PURE__ */ ve({
16
16
  __name: "ListPage",
17
- props: /* @__PURE__ */ E({
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__ */ E(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
38
- setup(i, { expose: N, emit: J }) {
39
- ge((e) => ({
40
- v9d0f4540: a(X)
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 = i, w = J, R = de(), k = o(() => !!R.header), $ = o(() => !!R.operation), m = me(i, "isAutoRefresh"), v = u({}), p = u(
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), s = K(), c = K(), { viewportHeightFinal: Q } = ke(n, {
50
+ ), D = u(!1), i = q(), c = q(), { viewportHeightFinal: G } = Me(n, {
45
51
  fallback: 500
46
- }), F = u(0), I = u(0), M = u(0), z = o(() => ({
52
+ }), F = u(0), P = u(0), j = u(0), W = o(() => ({
47
53
  ...p.value,
48
54
  ...n.staticQuery
49
- })), P = u(!1), U = o(() => P.value ? F.value + 10 : 0), G = o(() => $.value ? I.value + 10 : 0), W = o(() => k.value ? M.value + 10 : 0), j = o(() => Q.value - n.refineReduceHeight), X = o(() => n.refine ? `${j.value}px` : "auto"), Y = o(() => n.refine ? j.value - U.value - G.value - W.value : void 0), A = (e, t = "search") => {
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
- F.value = e;
67
+ V("dataChange", e);
68
68
  }, re = (e) => {
69
- I.value = e;
69
+ V("pageInfoChange", e);
70
70
  }, ae = (e) => {
71
- M.value = e;
72
- }, oe = o(() => n.list), ne = o(() => n.rowKey), V = o(() => v.value), B = {
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 (s.value)
87
- return s.value.validate();
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 = s.value) == null ? void 0 : e.resetFields();
98
+ return (e = i.value) == null ? void 0 : e.resetFields();
93
99
  },
94
100
  clearValidate: (e) => {
95
101
  var t;
96
- return (t = s.value) == null ? void 0 : t.clearValidate(e);
102
+ return (t = i.value) == null ? void 0 : t.clearValidate(e);
97
103
  },
98
104
  triggerReset: () => {
99
105
  var e;
100
- return (e = s.value) == null ? void 0 : e.triggerReset();
106
+ return (e = i.value) == null ? void 0 : e.triggerReset();
101
107
  },
102
108
  triggerSearch: () => {
103
109
  var e;
104
- return (e = s.value) == null ? void 0 : e.triggerSearch();
110
+ return (e = i.value) == null ? void 0 : e.triggerSearch();
105
111
  },
106
112
  toggleCollapse: (e) => {
107
113
  var t;
108
- return (t = s.value) == null ? void 0 : t.toggleCollapse(e);
114
+ return (t = i.value) == null ? void 0 : t.toggleCollapse(e);
109
115
  },
110
116
  isCollapsed: o(() => {
111
117
  var e;
112
- return ((e = s.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
118
+ return ((e = i.value) == null ? void 0 : e.isCollapsed.value) ?? !1;
113
119
  }),
114
120
  update: (e, t) => {
115
- v.value[e] = t;
121
+ m.value[e] = t;
116
122
  }
117
- }, se = o(() => {
118
- const e = we(B, [
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
- }), ie = (e) => e, le = (e) => e, ue = (e) => e, ce = (e) => {
128
- P.value = e;
133
+ }), ce = (e) => e, he = (e) => e, fe = (e) => e, ge = (e) => {
134
+ A.value = e;
129
135
  };
130
- return N(B), ve(
136
+ return Q(T), we(
131
137
  () => n.list,
132
138
  (e) => {
133
- const t = He(e);
134
- v.value = t, A(Se(t, e));
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 = he;
141
- return pe((C(), Ce("div", $e, [
142
- a(k) ? (C(), O(a(L), {
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: ae
151
+ onHeightChange: ne
146
152
  }, {
147
153
  default: h(() => [
148
154
  f(e.$slots, "header", {}, void 0, !0)
149
155
  ]),
150
156
  _: 3
151
- })) : T("", !0),
152
- q(a(ye), y({
157
+ })) : E("", !0),
158
+ L(a(Ce), y({
153
159
  ref_key: "formSearch",
154
- ref: s,
155
- list: a(oe),
156
- data: a(V)
157
- }, i.formSearchProps, {
158
- onSearch: A,
159
- onHeightChange: te,
160
- onVisibleChange: ce
161
- }), x({ _: 2 }, [
162
- H(i.list, (r) => ({
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}`, S(b(l)), void 0, !0)
171
+ f(e.$slots, `form-${r.key}`, b(H(l)), void 0, !0)
166
172
  ])
167
173
  }))
168
174
  ]), 1040, ["list", "data"]),
169
- a($) ? (C(), O(a(L), {
175
+ a(M) ? (S(), x(a(J), {
170
176
  key: 1,
171
177
  class: "list-page-operation",
172
- onHeightChange: re
178
+ onHeightChange: se
173
179
  }, {
174
180
  default: h(() => [
175
181
  f(e.$slots, "operation", {}, void 0, !0)
176
182
  ]),
177
183
  _: 3
178
- })) : T("", !0),
179
- q(a(be), y({
184
+ })) : E("", !0),
185
+ L(a(Ve), y({
180
186
  ref_key: "tableMain",
181
187
  ref: c,
182
- "is-auto-refresh": m.value,
183
- "onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => m.value = r),
184
- api: i.api,
185
- columns: i.columns,
186
- query: a(z),
187
- maxHeight: a(Y),
188
- rowKey: a(ne)
189
- }, i.tableMainProps, {
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(se),
192
- onLoadingChange: ee,
193
- onDataChange: Z,
194
- onPageInfoChange: _
195
- }), x({
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", S(b(ue(r))), void 0, !0)
209
+ f(e.$slots, "custom-view-item", b(H(fe(r))), void 0, !0)
198
210
  ]),
199
211
  _: 2
200
212
  }, [
201
- H(i.columns, (r) => ({
213
+ C(s.columns, (r) => ({
202
214
  name: r.prop,
203
215
  fn: h((l) => [
204
- f(e.$slots, `table-${r.prop}`, S(b(ie(l))), void 0, !0)
216
+ f(e.$slots, `table-${r.prop}`, b(H(ce(l))), void 0, !0)
205
217
  ])
206
218
  })),
207
- H(i.columns, (r) => ({
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(le(l), {
213
- searchFormData: a(V),
214
- triggerSearch: (d = a(s)) == null ? void 0 : d.triggerSearch
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, !m.value && a(D)]
233
+ [g, !v.value && a(D)]
222
234
  ]);
223
235
  };
224
236
  }
225
237
  });
226
238
  export {
227
- Te as default
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 C, watch as R, openBlock as b, createBlock as x, unref as u, withCtx as d, createVNode as V, mergeProps as w, renderSlot as A } from "vue";
2
- import { ElButton as I } from "element-plus";
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 v = _, { confirmConfig: s, confirmMode: T, beforeOpen: f } = E(v), r = M(), o = p(!1), c = p(!1), l = p();
33
- let m;
34
- const F = C(
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
- ), y = C(() => {
37
- const e = v, t = {}, a = [
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
- }), L = (e) => !!e && typeof e.then == "function", O = () => {
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
- }, g = () => {
63
- const e = O();
62
+ }, k = () => {
63
+ const e = P();
64
64
  if (!e.length) return;
65
- const t = m;
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(L);
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
- }, P = g, k = async (e) => {
77
+ }, S = k, B = async (e) => {
78
78
  if (o.value || c.value) return;
79
- m = e;
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) : g();
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, B, h;
98
- return F.value ? (b(), x($, {
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] = (S) => c.value = S),
102
- mode: u(T) || "popconfirm",
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": (B = l.value) == null ? void 0 : B.cancelText,
107
- type: (h = l.value) == null ? void 0 : h.type,
108
- "submit-fn": u(P)
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(I), w(y.value, {
111
+ V(u(T), A(g.value, {
112
112
  loading: o.value,
113
- onClick: k
113
+ onClick: B
114
114
  }), {
115
115
  default: d(() => [
116
- A(e.$slots, "default")
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"])) : (b(), x(u(I), w({ key: 1 }, y.value, {
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: k
124
+ onClick: B
125
125
  }), {
126
126
  default: d(() => [
127
- A(e.$slots, "default")
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 f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9d78ca06"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1f8a1089"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,63 +1,71 @@
1
- import { ElInputNumber as N, ElSwitch as R } from "element-plus/es";
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/switch/style/css";
3
+ import "element-plus/es/components/popover/style/css";
4
4
  import "element-plus/es/components/input-number/style/css";
5
- import { defineComponent as w, useModel as c, computed as B, watch as k, openBlock as f, createElementBlock as p, Fragment as x, createElementVNode as v, createVNode as V, createCommentVNode as F, unref as h, mergeModels as T } from "vue";
6
- import { Refresh as E } from "@element-plus/icons-vue";
7
- import { useTimeout as g } from "../../hooks/timeout.mjs";
8
- import { useActivatedExec as A } from "../../hooks/activated.mjs";
9
- const C = { class: "auto-refresh" }, D = /* @__PURE__ */ w({
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
- enabled: { type: Boolean, default: !0 }
14
+ disabled: { type: Boolean }
14
15
  }, {
15
16
  modelValue: { type: Boolean, default: !1 },
16
17
  modelModifiers: {},
17
- interval: { default: 30 },
18
+ interval: { default: 5 },
18
19
  intervalModifiers: {}
19
20
  }),
20
21
  emits: ["update:modelValue", "update:interval"],
21
- setup(n) {
22
- const u = n, t = c(n, "modelValue"), l = c(n, "interval"), r = B(() => t.value && u.enabled), [b, m] = g();
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 d = () => (o || (o = u.refreshFn().catch(() => {
25
+ const c = () => (o || (o = u.refreshFn().catch(() => {
25
26
  }).finally(() => {
26
27
  o = null;
27
28
  })), o), i = () => {
28
- b(async () => {
29
- await d(), r.value && i();
30
- }, l.value * 1e3);
29
+ E(async () => {
30
+ await c(), n.value && i();
31
+ }, t.value * 1e3);
31
32
  };
32
- return k([r, l], ([a]) => {
33
- a ? i() : m();
34
- }), A(({ triggerType: a }) => {
35
- r.value && (a === "activated" && (m(), d()), i());
36
- }), (a, e) => {
37
- const y = N, M = R;
38
- return f(), p("div", C, [
39
- t.value ? (f(), p(x, { key: 0 }, [
40
- e[2] || (e[2] = v("span", { class: "auto-refresh-label" }, "刷新间隔", -1)),
41
- V(y, {
42
- modelValue: l.value,
43
- "onUpdate:modelValue": e[0] || (e[0] = (s) => l.value = s),
44
- min: 1,
45
- step: 1,
46
- size: "small",
47
- class: "auto-refresh-interval"
48
- }, null, 8, ["modelValue"]),
49
- e[3] || (e[3] = v("span", { class: "auto-refresh-label" }, "秒", -1))
50
- ], 64)) : F("", !0),
51
- V(M, {
52
- modelValue: t.value,
53
- "onUpdate:modelValue": e[1] || (e[1] = (s) => t.value = s),
54
- "active-action-icon": h(E),
55
- "inactive-action-icon": h(E)
56
- }, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"])
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
- D as default
70
+ H as default
63
71
  };
@@ -0,0 +1,7 @@
1
+ import o from "./AutoRefreshGroup.vue2.mjs";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9cac8b09"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -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 a from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-653f3a9c"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-05684b89"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };