@done-coding/admin-core 0.0.1-alpha.1 → 0.0.1-alpha.2

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 (44) hide show
  1. package/es/components/display/TabsMain.vue.mjs +61 -0
  2. package/es/components/display/TabsMain.vue2.mjs +4 -0
  3. package/es/components/display/index.mjs +9 -7
  4. package/es/components/form/FormDateTimeRange.vue.mjs +46 -0
  5. package/es/components/form/FormDateTimeRange.vue2.mjs +4 -0
  6. package/es/components/form/FormRadio.vue.mjs +69 -0
  7. package/es/components/form/FormRadio.vue2.mjs +4 -0
  8. package/es/components/form/index.mjs +29 -23
  9. package/es/components/list-page/ListPage.vue.mjs +2 -2
  10. package/es/components/list-page/ListPage.vue2.mjs +102 -97
  11. package/es/components/misc/AutoRefresh.vue.mjs +7 -0
  12. package/es/components/misc/AutoRefresh.vue2.mjs +57 -0
  13. package/es/components/misc/index.mjs +7 -5
  14. package/es/components/table/TableMain.vue.mjs +3 -3
  15. package/es/components/table/TableMain.vue2.mjs +158 -121
  16. package/es/components/table/TableToolbar.vue.mjs +7 -0
  17. package/es/components/table/TableToolbar.vue2.mjs +75 -0
  18. package/es/config/route.mjs +3 -2
  19. package/es/helpers/list-helper.mjs +66 -0
  20. package/es/hooks/timeout.mjs +21 -0
  21. package/es/index.mjs +88 -73
  22. package/es/style.css +1 -1
  23. package/package.json +2 -2
  24. package/types/components/display/TabsMain.vue.d.ts +52 -0
  25. package/types/components/display/index.d.ts +2 -1
  26. package/types/components/form/FormDateTimeRange.vue.d.ts +18 -0
  27. package/types/components/form/FormRadio.vue.d.ts +35 -0
  28. package/types/components/form/FormSearch.vue.d.ts +1 -1
  29. package/types/components/form/FormSelect.vue.d.ts +2 -6
  30. package/types/components/form/index.d.ts +3 -1
  31. package/types/components/form/types.d.ts +12 -0
  32. package/types/components/list-page/ListPage.vue.d.ts +2 -0
  33. package/types/components/misc/AutoRefresh.vue.d.ts +14 -0
  34. package/types/components/misc/index.d.ts +2 -1
  35. package/types/components/modal/ConfirmModal.vue.d.ts +1 -1
  36. package/types/components/table/TableMain.vue.d.ts +3 -1
  37. package/types/components/table/TableToolbar.vue.d.ts +43 -0
  38. package/types/components/table/types.d.ts +22 -2
  39. package/types/config/route.d.ts +2 -0
  40. package/types/helpers/index.d.ts +2 -0
  41. package/types/helpers/list-helper.d.ts +36 -0
  42. package/types/helpers/types.d.ts +15 -0
  43. package/types/hooks/index.d.ts +1 -0
  44. package/types/hooks/timeout.d.ts +7 -0
@@ -0,0 +1,61 @@
1
+ import { ElTabs as v, ElTabPane as b } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/tabs/style/css";
4
+ import "element-plus/es/components/tab-pane/style/css";
5
+ import { defineComponent as y, useModel as V, computed as _, openBlock as n, createBlock as m, isRef as B, unref as i, withCtx as d, createElementBlock as M, Fragment as T, renderList as g, renderSlot as k, mergeModels as R } from "vue";
6
+ import { useRouter as E } from "vue-router";
7
+ import { TabsMainReplaceQueryKey as Q } from "../../config/route.mjs";
8
+ const F = /* @__PURE__ */ y({
9
+ __name: "TabsMain",
10
+ props: /* @__PURE__ */ R({
11
+ list: {},
12
+ replaceQuery: { type: Boolean, default: !1 },
13
+ notNull: { type: Boolean, default: !0 }
14
+ }, {
15
+ modelValue: {},
16
+ modelModifiers: {}
17
+ }),
18
+ emits: ["update:modelValue"],
19
+ setup(a) {
20
+ const t = a, o = V(a, "modelValue"), s = E(), c = (e) => e === void 0 || e === "" ? !1 : t.list.some((u) => u.value === e), r = _({
21
+ get() {
22
+ return c(o.value) ? o.value : t.notNull && t.list.length > 0 ? t.list[0].value : o.value;
23
+ },
24
+ set(e) {
25
+ o.value = e, t.replaceQuery && s.replace({
26
+ query: {
27
+ ...s.currentRoute.value.query,
28
+ [Q]: e
29
+ }
30
+ });
31
+ }
32
+ });
33
+ return (e, u) => {
34
+ const p = b, f = v;
35
+ return n(), m(f, {
36
+ modelValue: i(r),
37
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => B(r) ? r.value = l : null)
38
+ }, {
39
+ default: d(() => [
40
+ (n(!0), M(T, null, g(a.list, (l) => (n(), m(p, {
41
+ key: l.value,
42
+ label: l.title,
43
+ name: l.value
44
+ }, {
45
+ default: d(() => [
46
+ k(e.$slots, `content-${l.value}`, {
47
+ item: l,
48
+ currentValue: i(r)
49
+ })
50
+ ]),
51
+ _: 2
52
+ }, 1032, ["label", "name"]))), 128))
53
+ ]),
54
+ _: 3
55
+ }, 8, ["modelValue"]);
56
+ };
57
+ }
58
+ });
59
+ export {
60
+ F as default
61
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TabsMain.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,12 +1,14 @@
1
- import c from "./WatchSize.vue.mjs";
2
- const s = { WatchSize: c }, e = {
3
- install(t) {
4
- Object.entries(s).forEach(([n, o]) => {
5
- t.component(n, o);
1
+ import t from "./WatchSize.vue.mjs";
2
+ import o from "./TabsMain.vue.mjs";
3
+ const i = { WatchSize: t, TabsMain: o }, m = {
4
+ install(a) {
5
+ Object.entries(i).forEach(([n, s]) => {
6
+ a.component(n, s);
6
7
  });
7
8
  }
8
9
  };
9
10
  export {
10
- c as WatchSize,
11
- e as displayInstall
11
+ o as TabsMain,
12
+ t as WatchSize,
13
+ m as displayInstall
12
14
  };
@@ -0,0 +1,46 @@
1
+ import { ElDatePicker as d, ElButton 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/date-picker/style/css";
5
+ import { defineComponent as p, useModel as f, useAttrs as k, openBlock as o, createElementBlock as r, createVNode as V, mergeProps as _, unref as g, Fragment as y, renderList as B, createBlock as C, withCtx as D, createTextVNode as E, toDisplayString as v, mergeModels as w } from "vue";
6
+ const x = { class: "form-date-time-range" }, N = /* @__PURE__ */ p({
7
+ name: "FormDateTimeRange",
8
+ inheritAttrs: !1,
9
+ __name: "FormDateTimeRange",
10
+ props: /* @__PURE__ */ w({
11
+ swiftOptions: { default: () => [] }
12
+ }, {
13
+ modelValue: { default: null },
14
+ modelModifiers: {}
15
+ }),
16
+ emits: ["update:modelValue"],
17
+ setup(l) {
18
+ const t = f(l, "modelValue"), m = k(), i = (n) => {
19
+ t.value = n.set();
20
+ };
21
+ return (n, a) => {
22
+ const s = d, u = c;
23
+ return o(), r("span", x, [
24
+ V(s, _({
25
+ modelValue: t.value,
26
+ "onUpdate:modelValue": a[0] || (a[0] = (e) => t.value = e),
27
+ type: "datetimerange"
28
+ }, g(m)), null, 16, ["modelValue"]),
29
+ (o(!0), r(y, null, B(l.swiftOptions, (e) => (o(), C(u, {
30
+ key: e.key,
31
+ type: "primary",
32
+ link: "",
33
+ onClick: (h) => i(e)
34
+ }, {
35
+ default: D(() => [
36
+ E(v(e.key), 1)
37
+ ]),
38
+ _: 2
39
+ }, 1032, ["onClick"]))), 128))
40
+ ]);
41
+ };
42
+ }
43
+ });
44
+ export {
45
+ N as default
46
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormDateTimeRange.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,69 @@
1
+ import { ElRadioGroup as h, ElRadioButton as y, ElRadio as B } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/radio-group/style/css";
4
+ import "element-plus/es/components/radio/style/css";
5
+ import "element-plus/es/components/radio-button/style/css";
6
+ import { defineComponent as V, useModel as _, computed as b, watch as g, openBlock as a, createBlock as r, unref as x, withCtx as d, createElementBlock as m, Fragment as c, renderList as s, createTextVNode as v, toDisplayString as p, createCommentVNode as M, mergeModels as N } from "vue";
7
+ const D = /* @__PURE__ */ V({
8
+ name: "FormRadio",
9
+ inheritAttrs: !0,
10
+ __name: "FormRadio",
11
+ props: /* @__PURE__ */ N({
12
+ list: {},
13
+ mode: { default: "radio" },
14
+ notNull: { type: Boolean, default: !0 }
15
+ }, {
16
+ modelValue: {},
17
+ modelModifiers: {}
18
+ }),
19
+ emits: ["update:modelValue"],
20
+ setup(o) {
21
+ const u = o, l = _(o, "modelValue"), n = b(() => {
22
+ if (u.notNull && u.list.length > 0) {
23
+ const e = u.list.some((i) => i.value === l.value);
24
+ if (l.value === void 0 || !e)
25
+ return u.list[0].value;
26
+ }
27
+ return l.value;
28
+ }), f = (e) => {
29
+ l.value = e;
30
+ };
31
+ return g(
32
+ n,
33
+ (e) => {
34
+ e !== void 0 && e !== l.value && (l.value = e);
35
+ },
36
+ { immediate: !0 }
37
+ ), (e, i) => {
38
+ const R = y, k = B, E = h;
39
+ return a(), r(E, {
40
+ "model-value": x(n),
41
+ "onUpdate:modelValue": f
42
+ }, {
43
+ default: d(() => [
44
+ o.mode === "buttonGroup" ? (a(!0), m(c, { key: 0 }, s(o.list, (t) => (a(), r(R, {
45
+ key: t.value,
46
+ value: t.value
47
+ }, {
48
+ default: d(() => [
49
+ v(p(t.label), 1)
50
+ ]),
51
+ _: 2
52
+ }, 1032, ["value"]))), 128)) : o.mode === "radio" ? (a(!0), m(c, { key: 1 }, s(o.list, (t) => (a(), r(k, {
53
+ key: t.value,
54
+ value: t.value
55
+ }, {
56
+ default: d(() => [
57
+ v(p(t.label), 1)
58
+ ]),
59
+ _: 2
60
+ }, 1032, ["value"]))), 128)) : M("", !0)
61
+ ]),
62
+ _: 1
63
+ }, 8, ["model-value"]);
64
+ };
65
+ }
66
+ });
67
+ export {
68
+ D as default
69
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormRadio.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,32 +1,38 @@
1
- import e from "./FormMain.vue.mjs";
1
+ import a from "./FormMain.vue.mjs";
2
2
  import i from "./FormSelect.vue.mjs";
3
- import a from "./FormRadioGroup.vue.mjs";
4
- import t from "./FormTree.vue.mjs";
5
- import f from "./FormSearch.vue.mjs";
6
- import n from "./FormVerifyImage.vue.mjs";
7
- import s from "./FormVerifyCode.vue.mjs";
8
- const c = {
9
- FormMain: e,
3
+ import e from "./FormRadioGroup.vue.mjs";
4
+ import t from "./FormRadio.vue.mjs";
5
+ import f from "./FormTree.vue.mjs";
6
+ import n from "./FormSearch.vue.mjs";
7
+ import s from "./FormVerifyImage.vue.mjs";
8
+ import c from "./FormVerifyCode.vue.mjs";
9
+ import F from "./FormDateTimeRange.vue.mjs";
10
+ const p = {
11
+ FormMain: a,
10
12
  FormSelect: i,
11
- FormRadioGroup: a,
12
- FormTree: t,
13
- FormSearch: f,
14
- FormVerifyImage: n,
15
- FormVerifyCode: s
16
- }, S = {
13
+ FormRadioGroup: e,
14
+ FormRadio: t,
15
+ FormTree: f,
16
+ FormSearch: n,
17
+ FormVerifyImage: s,
18
+ FormVerifyCode: c,
19
+ FormDateTimeRange: F
20
+ }, V = {
17
21
  install(o) {
18
- Object.entries(c).forEach(([r, m]) => {
19
- o.component(r, m);
22
+ Object.entries(p).forEach(([m, r]) => {
23
+ o.component(m, r);
20
24
  });
21
25
  }
22
26
  };
23
27
  export {
24
- e as FormMain,
25
- a as FormRadioGroup,
26
- f as FormSearch,
28
+ F as FormDateTimeRange,
29
+ a as FormMain,
30
+ t as FormRadio,
31
+ e as FormRadioGroup,
32
+ n as FormSearch,
27
33
  i as FormSelect,
28
- t as FormTree,
29
- s as FormVerifyCode,
30
- n as FormVerifyImage,
31
- S as formInstall
34
+ f as FormTree,
35
+ c as FormVerifyCode,
36
+ s as FormVerifyImage,
37
+ V as formInstall
32
38
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ListPage.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c9564dc7"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a578c778"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,20 +1,20 @@
1
- import { ElLoadingDirective as Z } from "element-plus/es";
1
+ import { ElLoadingDirective as te } 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 ee, useCssVars as te, unref as r, ref as u, shallowRef as R, inject as re, computed as o, watch as ae, withDirectives as ne, openBlock as j, createElementBlock as oe, createVNode as k, mergeProps as v, createSlots as F, renderList as y, withCtx as h, renderSlot as m, normalizeProps as T, guardReactiveProps as $, createBlock as se, createCommentVNode as ie } from "vue";
5
- import le from "../form/FormSearch.vue.mjs";
6
- import { generateFormData as ce, stringifyFormData as ue } from "../form/utils.mjs";
7
- import fe from "../display/WatchSize.vue.mjs";
8
- import ge from "../table/TableMain.vue.mjs";
9
- import he from "lodash/pick";
10
- import me from "lodash/cloneDeep";
11
- import { BODY_CONTENT_VIEWPORT_HEIGHT as de } from "../../inject/key.mjs";
12
- const pe = {
4
+ import { defineComponent as re, useCssVars as ae, unref as a, useModel as oe, ref as c, shallowRef as O, inject as ne, computed as s, watch as se, withDirectives as ie, openBlock as j, createElementBlock as le, createVNode as k, mergeProps as y, createSlots as F, renderList as b, withCtx as g, renderSlot as d, normalizeProps as T, guardReactiveProps as $, createBlock as ue, createCommentVNode as ce, mergeModels as A } from "vue";
5
+ import fe from "../form/FormSearch.vue.mjs";
6
+ import { generateFormData as he, stringifyFormData as ge } from "../form/utils.mjs";
7
+ import de from "../display/WatchSize.vue.mjs";
8
+ import me from "../table/TableMain.vue.mjs";
9
+ import pe from "lodash/pick";
10
+ import ve from "lodash/cloneDeep";
11
+ import { BODY_CONTENT_VIEWPORT_HEIGHT as ye } from "../../inject/key.mjs";
12
+ const be = {
13
13
  "element-loading-background": "rgba(122, 122, 122, 0.5)",
14
14
  class: "list-page"
15
- }, Re = /* @__PURE__ */ ee({
15
+ }, ke = /* @__PURE__ */ re({
16
16
  __name: "ListPage",
17
- props: {
17
+ props: /* @__PURE__ */ A({
18
18
  staticQuery: { default: () => ({}) },
19
19
  formSearchProps: {},
20
20
  columns: {},
@@ -29,56 +29,59 @@ const pe = {
29
29
  injectInfo: {},
30
30
  beforeSearch: {},
31
31
  clearTableFilterOnReset: { type: Boolean }
32
- },
33
- emits: ["dataChange", "pageInfoChange"],
34
- setup(s, { expose: M, emit: x }) {
35
- te((e) => ({
36
- f49642f0: r(N)
32
+ }, {
33
+ isAutoRefresh: { type: Boolean },
34
+ isAutoRefreshModifiers: {}
35
+ }),
36
+ emits: /* @__PURE__ */ A(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
37
+ setup(n, { expose: x, emit: B }) {
38
+ ae((e) => ({
39
+ bb4a2a8e: a(q)
37
40
  }));
38
- const a = s, S = x, d = u({}), p = u(
41
+ const o = n, S = B, m = oe(n, "isAutoRefresh"), p = c({}), v = c(
39
42
  {}
40
- ), b = u(!1), i = R(), c = R(), E = re(
41
- de,
43
+ ), C = c(!1), i = O(), u = O(), E = ne(
44
+ ye,
42
45
  500
43
- ), C = u(0), H = u(0), V = o(() => ({
44
- ...p.value,
45
- ...a.staticQuery
46
- })), w = u(!1), B = o(() => w.value ? C.value + 10 : 0), K = o(() => a.showOperation ? H.value + 10 : 0), I = o(() => E.value - a.refineReduceHeight), N = o(() => a.refine ? `${I.value}px` : "auto"), q = o(() => a.refine ? Math.max(
47
- I.value - B.value - K.value,
46
+ ), H = c(0), R = c(0), V = s(() => ({
47
+ ...v.value,
48
+ ...o.staticQuery
49
+ })), w = c(!1), K = s(() => w.value ? H.value + 10 : 0), N = s(() => o.showOperation ? R.value + 10 : 0), I = s(() => E.value - o.refineReduceHeight), q = s(() => o.refine ? `${I.value}px` : "auto"), L = s(() => o.refine ? Math.max(
50
+ I.value - K.value - N.value,
48
51
  200
49
- ) : void 0), P = (e, t = "search") => {
50
- var n, l, g;
52
+ ) : void 0), M = (e, t = "search") => {
53
+ var r, l, h;
51
54
  let f = e;
52
- if (a.beforeSearch && (f = a.beforeSearch(
53
- me(e),
55
+ if (o.beforeSearch && (f = o.beforeSearch(
56
+ ve(e),
54
57
  t
55
- )), t === "reset" && a.clearTableFilterOnReset && ((l = (n = c.value) == null ? void 0 : n.getTableInstance()) == null || l.clearFilter()), JSON.stringify(f) === JSON.stringify(p.value))
56
- return ["reset", "search"].includes(t) ? (g = c.value) == null ? void 0 : g.reload() : void 0;
57
- p.value = {
58
+ )), t === "reset" && o.clearTableFilterOnReset && ((l = (r = u.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(f) === JSON.stringify(v.value))
59
+ return ["reset", "search"].includes(t) ? (h = u.value) == null ? void 0 : h.reload() : void 0;
60
+ v.value = {
58
61
  ...f
59
62
  };
60
- }, L = (e) => {
63
+ }, J = (e) => {
61
64
  S("dataChange", e);
62
- }, A = (e) => {
65
+ }, Q = (e) => {
63
66
  S("pageInfoChange", e);
64
- }, _ = (e) => {
65
- b.value = e;
66
- }, J = (e) => {
67
+ }, z = (e) => {
67
68
  C.value = e;
68
- }, Q = (e) => {
69
+ }, G = (e) => {
69
70
  H.value = e;
70
- }, z = o(() => a.list), G = o(() => a.rowKey), D = o(() => d.value), O = {
71
- refresh: (e = !1) => {
71
+ }, U = (e) => {
72
+ R.value = e;
73
+ }, W = s(() => o.list), Y = s(() => o.rowKey), P = s(() => p.value), D = {
74
+ refresh: async (e = !1) => {
72
75
  var t;
73
- return (t = c.value) == null ? void 0 : t.refresh(e);
76
+ return (t = u.value) == null ? void 0 : t.refresh(e);
74
77
  },
75
- reload: (e = !1) => {
78
+ reload: async (e = !1) => {
76
79
  var t;
77
- return (t = c.value) == null ? void 0 : t.reload(e);
80
+ return (t = u.value) == null ? void 0 : t.reload(e);
78
81
  },
79
82
  getTableInstance: () => {
80
83
  var e;
81
- return (e = c.value) == null ? void 0 : e.getTableInstance();
84
+ return (e = u.value) == null ? void 0 : e.getTableInstance();
82
85
  },
83
86
  validate: () => {
84
87
  if (i.value)
@@ -102,100 +105,102 @@ const pe = {
102
105
  return (e = i.value) == null ? void 0 : e.triggerSearch();
103
106
  },
104
107
  update: (e, t) => {
105
- d.value[e] = t;
108
+ p.value[e] = t;
106
109
  }
107
- }, W = o(() => {
108
- const e = he(O, [
110
+ }, X = s(() => {
111
+ const e = pe(D, [
109
112
  "triggerReset",
110
113
  "triggerSearch",
111
114
  "update"
112
115
  ]);
113
116
  return {
114
- ...a.injectInfo || {},
117
+ ...o.injectInfo || {},
115
118
  ...e
116
119
  };
117
- }), Y = (e) => e, U = (e) => e, X = (e) => {
120
+ }), Z = (e) => e, _ = (e) => e, ee = (e) => {
118
121
  w.value = e;
119
122
  };
120
- return M(O), ae(
121
- () => a.list,
123
+ return x(D), se(
124
+ () => o.list,
122
125
  (e) => {
123
- const t = ce(e);
124
- d.value = t, P(ue(t, e));
126
+ const t = he(e);
127
+ p.value = t, M(ge(t, e));
125
128
  },
126
129
  {
127
130
  immediate: !0
128
131
  }
129
132
  ), (e, t) => {
130
- const f = Z;
131
- return ne((j(), oe("div", pe, [
132
- k(r(le), v({
133
+ const f = te;
134
+ return ie((j(), le("div", be, [
135
+ k(a(fe), y({
133
136
  ref_key: "formSearch",
134
137
  ref: i,
135
- list: r(z),
136
- data: r(D)
137
- }, s.formSearchProps, {
138
- onSearch: P,
139
- onHeightChange: J,
140
- onVisibleChange: X
138
+ list: a(W),
139
+ data: a(P)
140
+ }, n.formSearchProps, {
141
+ onSearch: M,
142
+ onHeightChange: G,
143
+ onVisibleChange: ee
141
144
  }), F({ _: 2 }, [
142
- y(s.list, (n) => ({
143
- name: n.key,
144
- fn: h((l) => [
145
- m(e.$slots, `form-${n.key}`, T($(l)), void 0, !0)
145
+ b(n.list, (r) => ({
146
+ name: r.key,
147
+ fn: g((l) => [
148
+ d(e.$slots, `form-${r.key}`, T($(l)), void 0, !0)
146
149
  ])
147
150
  }))
148
151
  ]), 1040, ["list", "data"]),
149
- s.showOperation ? (j(), se(r(fe), {
152
+ n.showOperation ? (j(), ue(a(de), {
150
153
  key: 0,
151
154
  class: "list-page-operation",
152
- onHeightChange: Q
155
+ onHeightChange: U
153
156
  }, {
154
- default: h(() => [
155
- m(e.$slots, "operation", {}, void 0, !0)
157
+ default: g(() => [
158
+ d(e.$slots, "operation", {}, void 0, !0)
156
159
  ]),
157
160
  _: 3
158
- })) : ie("", !0),
159
- k(r(ge), v({
161
+ })) : ce("", !0),
162
+ k(a(me), y({
160
163
  ref_key: "tableMain",
161
- ref: c,
162
- api: s.api,
163
- columns: s.columns,
164
- query: r(V),
165
- maxHeight: r(q),
166
- rowKey: r(G)
167
- }, s.tableMainProps, {
164
+ ref: u,
165
+ "is-auto-refresh": m.value,
166
+ "onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => m.value = r),
167
+ api: n.api,
168
+ columns: n.columns,
169
+ query: a(V),
170
+ maxHeight: a(L),
171
+ rowKey: a(Y)
172
+ }, n.tableMainProps, {
168
173
  refine: !1,
169
- injectInfo: r(W),
170
- onLoadingChange: _,
171
- onDataChange: L,
172
- onPageInfoChange: A
174
+ injectInfo: a(X),
175
+ onLoadingChange: z,
176
+ onDataChange: J,
177
+ onPageInfoChange: Q
173
178
  }), F({ _: 2 }, [
174
- y(s.columns, (n) => ({
175
- name: n.prop,
176
- fn: h((l) => [
177
- m(e.$slots, `table-${n.prop}`, T($(Y(l))), void 0, !0)
179
+ b(n.columns, (r) => ({
180
+ name: r.prop,
181
+ fn: g((l) => [
182
+ d(e.$slots, `table-${r.prop}`, T($(Z(l))), void 0, !0)
178
183
  ])
179
184
  })),
180
- y(s.columns, (n) => ({
181
- name: `header-${n.prop}`,
182
- fn: h((l) => {
183
- var g;
185
+ b(n.columns, (r) => ({
186
+ name: `header-${r.prop}`,
187
+ fn: g((l) => {
188
+ var h;
184
189
  return [
185
- m(e.$slots, `table-header-${n.columnKey || n.prop}`, v(U(l), {
186
- searchFormData: r(D),
187
- triggerSearch: (g = r(i)) == null ? void 0 : g.triggerSearch
190
+ d(e.$slots, `table-header-${r.columnKey || r.prop}`, y(_(l), {
191
+ searchFormData: a(P),
192
+ triggerSearch: (h = a(i)) == null ? void 0 : h.triggerSearch
188
193
  }), void 0, !0)
189
194
  ];
190
195
  })
191
196
  }))
192
- ]), 1040, ["api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
197
+ ]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
193
198
  ])), [
194
- [f, r(b)]
199
+ [f, !m.value && a(C)]
195
200
  ]);
196
201
  };
197
202
  }
198
203
  });
199
204
  export {
200
- Re as default
205
+ ke as default
201
206
  };
@@ -0,0 +1,7 @@
1
+ import o from "./AutoRefresh.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b734f05f"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,57 @@
1
+ import { ElInputNumber as x, ElSwitch as M } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/switch/style/css";
4
+ import "element-plus/es/components/input-number/style/css";
5
+ import { defineComponent as N, useModel as m, watch as n, openBlock as i, createElementBlock as d, Fragment as b, createElementVNode as f, createVNode as p, createCommentVNode as k, mergeModels as w } from "vue";
6
+ import { useTimeout as B } from "../../hooks/timeout.mjs";
7
+ import { useActivatedExec as T } from "../../hooks/activated.mjs";
8
+ const y = { class: "auto-refresh" }, F = /* @__PURE__ */ N({
9
+ __name: "AutoRefresh",
10
+ props: {
11
+ modelValue: { type: Boolean, default: !1 },
12
+ modelModifiers: {},
13
+ interval: { default: 30 },
14
+ intervalModifiers: {}
15
+ },
16
+ emits: /* @__PURE__ */ w(["refresh"], ["update:modelValue", "update:interval"]),
17
+ setup(s, { expose: v, emit: c }) {
18
+ const r = c, e = m(s, "modelValue"), o = m(s, "interval"), [V, h] = B(), l = () => {
19
+ V(() => {
20
+ r("refresh"), e.value && l();
21
+ }, o.value * 1e3);
22
+ };
23
+ return v({ trigger: () => {
24
+ r("refresh"), e.value && l();
25
+ } }), n(e, (u) => {
26
+ u ? l() : h();
27
+ }), n(o, () => {
28
+ e.value && l();
29
+ }), T(() => {
30
+ e.value && (r("refresh"), l());
31
+ }), (u, t) => {
32
+ const E = x, g = M;
33
+ return i(), d("div", y, [
34
+ e.value ? (i(), d(b, { key: 0 }, [
35
+ t[2] || (t[2] = f("span", { class: "auto-refresh-label" }, "刷新间隔", -1)),
36
+ p(E, {
37
+ modelValue: o.value,
38
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => o.value = a),
39
+ min: 1,
40
+ step: 5,
41
+ size: "small",
42
+ class: "auto-refresh-interval"
43
+ }, null, 8, ["modelValue"]),
44
+ t[3] || (t[3] = f("span", { class: "auto-refresh-label" }, "秒", -1))
45
+ ], 64)) : k("", !0),
46
+ p(g, {
47
+ modelValue: e.value,
48
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => e.value = a),
49
+ "active-text": "自动刷新"
50
+ }, null, 8, ["modelValue"])
51
+ ]);
52
+ };
53
+ }
54
+ });
55
+ export {
56
+ F as default
57
+ };
@@ -1,12 +1,14 @@
1
- import n from "./TriggerAutoImport.vue.mjs";
2
- const s = { TriggerAutoImport: n }, e = {
1
+ import e from "./TriggerAutoImport.vue.mjs";
2
+ import m from "./AutoRefresh.vue.mjs";
3
+ const n = { TriggerAutoImport: e, AutoRefresh: m }, i = {
3
4
  install(o) {
4
- Object.entries(s).forEach(([t, r]) => {
5
+ Object.entries(n).forEach(([t, r]) => {
5
6
  o.component(t, r);
6
7
  });
7
8
  }
8
9
  };
9
10
  export {
10
- n as TriggerAutoImport,
11
- e as miscInstall
11
+ m as AutoRefresh,
12
+ e as TriggerAutoImport,
13
+ i as miscInstall
12
14
  };