@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.
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a578c778"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-182577bf"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,20 +1,20 @@
1
- import { ElLoadingDirective as te } from "element-plus/es";
1
+ import { ElLoadingDirective as ie } 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 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";
4
+ import { defineComponent as le, useCssVars as ue, unref as a, useModel as ce, ref as u, shallowRef as O, inject as he, computed as s, watch as fe, withDirectives as ge, openBlock as y, createElementBlock as de, createBlock as $, withCtx as g, renderSlot as d, createCommentVNode as A, createVNode as F, mergeProps as H, createSlots as T, renderList as C, normalizeProps as B, guardReactiveProps as E, mergeModels as V } from "vue";
5
+ import me from "../form/FormSearch.vue.mjs";
6
+ import { generateFormData as ve, stringifyFormData as pe } from "../form/utils.mjs";
7
+ import x from "../display/WatchSize.vue.mjs";
8
+ import ye from "../table/TableMain.vue.mjs";
9
+ import He from "lodash/pick";
10
+ import Ce from "lodash/cloneDeep";
11
+ import { BODY_CONTENT_VIEWPORT_HEIGHT as Se } from "../../inject/key.mjs";
12
12
  const be = {
13
13
  "element-loading-background": "rgba(122, 122, 122, 0.5)",
14
14
  class: "list-page"
15
- }, ke = /* @__PURE__ */ re({
15
+ }, Fe = /* @__PURE__ */ le({
16
16
  __name: "ListPage",
17
- props: /* @__PURE__ */ A({
17
+ props: /* @__PURE__ */ V({
18
18
  staticQuery: { default: () => ({}) },
19
19
  formSearchProps: {},
20
20
  columns: {},
@@ -23,6 +23,7 @@ const be = {
23
23
  refineReduceHeight: { default: 0 },
24
24
  tableMainProps: {},
25
25
  showOperation: { type: Boolean, default: !1 },
26
+ showHeader: { type: Boolean, default: !1 },
26
27
  list: { default: () => [] },
27
28
  api: {},
28
29
  query: {},
@@ -33,55 +34,57 @@ const be = {
33
34
  isAutoRefresh: { type: Boolean },
34
35
  isAutoRefreshModifiers: {}
35
36
  }),
36
- emits: /* @__PURE__ */ A(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
37
- setup(n, { expose: x, emit: B }) {
38
- ae((e) => ({
39
- bb4a2a8e: a(q)
37
+ emits: /* @__PURE__ */ V(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
38
+ setup(n, { expose: K, emit: N }) {
39
+ ue((e) => ({
40
+ ad28a056: a(G)
40
41
  }));
41
- const o = n, S = B, m = oe(n, "isAutoRefresh"), p = c({}), v = c(
42
+ const o = n, S = N, m = ce(n, "isAutoRefresh"), v = u({}), p = u(
42
43
  {}
43
- ), C = c(!1), i = O(), u = O(), E = ne(
44
- ye,
44
+ ), b = u(!1), i = O(), c = O(), q = he(
45
+ Se,
45
46
  500
46
- ), H = c(0), R = c(0), V = s(() => ({
47
- ...v.value,
47
+ ), w = u(0), R = u(0), I = u(0), L = s(() => ({
48
+ ...p.value,
48
49
  ...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,
50
+ })), M = u(!1), J = s(() => M.value ? w.value + 10 : 0), Q = s(() => o.showOperation ? R.value + 10 : 0), z = s(() => o.showHeader ? I.value + 10 : 0), P = s(() => q.value - o.refineReduceHeight), G = s(() => o.refine ? `${P.value}px` : "auto"), U = s(() => o.refine ? Math.max(
51
+ P.value - J.value - Q.value - z.value,
51
52
  200
52
- ) : void 0), M = (e, t = "search") => {
53
- var r, l, h;
54
- let f = e;
55
- if (o.beforeSearch && (f = o.beforeSearch(
56
- ve(e),
53
+ ) : void 0), j = (e, t = "search") => {
54
+ var r, l, f;
55
+ let h = e;
56
+ if (o.beforeSearch && (h = o.beforeSearch(
57
+ Ce(e),
57
58
  t
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 = {
61
- ...f
59
+ )), t === "reset" && o.clearTableFilterOnReset && ((l = (r = c.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(h) === JSON.stringify(p.value))
60
+ return ["reset", "search"].includes(t) ? (f = c.value) == null ? void 0 : f.reload() : void 0;
61
+ p.value = {
62
+ ...h
62
63
  };
63
- }, J = (e) => {
64
+ }, W = (e) => {
64
65
  S("dataChange", e);
65
- }, Q = (e) => {
66
+ }, Y = (e) => {
66
67
  S("pageInfoChange", e);
67
- }, z = (e) => {
68
- C.value = e;
69
- }, G = (e) => {
70
- H.value = e;
71
- }, U = (e) => {
68
+ }, X = (e) => {
69
+ b.value = e;
70
+ }, Z = (e) => {
71
+ w.value = e;
72
+ }, _ = (e) => {
72
73
  R.value = e;
73
- }, W = s(() => o.list), Y = s(() => o.rowKey), P = s(() => p.value), D = {
74
+ }, ee = (e) => {
75
+ I.value = e;
76
+ }, te = s(() => o.list), re = s(() => o.rowKey), k = s(() => v.value), D = {
74
77
  refresh: async (e = !1) => {
75
78
  var t;
76
- return (t = u.value) == null ? void 0 : t.refresh(e);
79
+ return (t = c.value) == null ? void 0 : t.refresh(e);
77
80
  },
78
81
  reload: async (e = !1) => {
79
82
  var t;
80
- return (t = u.value) == null ? void 0 : t.reload(e);
83
+ return (t = c.value) == null ? void 0 : t.reload(e);
81
84
  },
82
85
  getTableInstance: () => {
83
86
  var e;
84
- return (e = u.value) == null ? void 0 : e.getTableInstance();
87
+ return (e = c.value) == null ? void 0 : e.getTableInstance();
85
88
  },
86
89
  validate: () => {
87
90
  if (i.value)
@@ -105,10 +108,10 @@ const be = {
105
108
  return (e = i.value) == null ? void 0 : e.triggerSearch();
106
109
  },
107
110
  update: (e, t) => {
108
- p.value[e] = t;
111
+ v.value[e] = t;
109
112
  }
110
- }, X = s(() => {
111
- const e = pe(D, [
113
+ }, ae = s(() => {
114
+ const e = He(D, [
112
115
  "triggerReset",
113
116
  "triggerSearch",
114
117
  "update"
@@ -117,90 +120,100 @@ const be = {
117
120
  ...o.injectInfo || {},
118
121
  ...e
119
122
  };
120
- }), Z = (e) => e, _ = (e) => e, ee = (e) => {
121
- w.value = e;
123
+ }), oe = (e) => e, ne = (e) => e, se = (e) => {
124
+ M.value = e;
122
125
  };
123
- return x(D), se(
126
+ return K(D), fe(
124
127
  () => o.list,
125
128
  (e) => {
126
- const t = he(e);
127
- p.value = t, M(ge(t, e));
129
+ const t = ve(e);
130
+ v.value = t, j(pe(t, e));
128
131
  },
129
132
  {
130
133
  immediate: !0
131
134
  }
132
135
  ), (e, t) => {
133
- const f = te;
134
- return ie((j(), le("div", be, [
135
- k(a(fe), y({
136
+ const h = ie;
137
+ return ge((y(), de("div", be, [
138
+ n.showHeader ? (y(), $(a(x), {
139
+ key: 0,
140
+ class: "list-page-header",
141
+ onHeightChange: ee
142
+ }, {
143
+ default: g(() => [
144
+ d(e.$slots, "header", {}, void 0, !0)
145
+ ]),
146
+ _: 3
147
+ })) : A("", !0),
148
+ F(a(me), H({
136
149
  ref_key: "formSearch",
137
150
  ref: i,
138
- list: a(W),
139
- data: a(P)
151
+ list: a(te),
152
+ data: a(k)
140
153
  }, n.formSearchProps, {
141
- onSearch: M,
142
- onHeightChange: G,
143
- onVisibleChange: ee
144
- }), F({ _: 2 }, [
145
- b(n.list, (r) => ({
154
+ onSearch: j,
155
+ onHeightChange: Z,
156
+ onVisibleChange: se
157
+ }), T({ _: 2 }, [
158
+ C(n.list, (r) => ({
146
159
  name: r.key,
147
160
  fn: g((l) => [
148
- d(e.$slots, `form-${r.key}`, T($(l)), void 0, !0)
161
+ d(e.$slots, `form-${r.key}`, B(E(l)), void 0, !0)
149
162
  ])
150
163
  }))
151
164
  ]), 1040, ["list", "data"]),
152
- n.showOperation ? (j(), ue(a(de), {
153
- key: 0,
165
+ n.showOperation ? (y(), $(a(x), {
166
+ key: 1,
154
167
  class: "list-page-operation",
155
- onHeightChange: U
168
+ onHeightChange: _
156
169
  }, {
157
170
  default: g(() => [
158
171
  d(e.$slots, "operation", {}, void 0, !0)
159
172
  ]),
160
173
  _: 3
161
- })) : ce("", !0),
162
- k(a(me), y({
174
+ })) : A("", !0),
175
+ F(a(ye), H({
163
176
  ref_key: "tableMain",
164
- ref: u,
177
+ ref: c,
165
178
  "is-auto-refresh": m.value,
166
179
  "onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => m.value = r),
167
180
  api: n.api,
168
181
  columns: n.columns,
169
- query: a(V),
170
- maxHeight: a(L),
171
- rowKey: a(Y)
182
+ query: a(L),
183
+ maxHeight: a(U),
184
+ rowKey: a(re)
172
185
  }, n.tableMainProps, {
173
186
  refine: !1,
174
- injectInfo: a(X),
175
- onLoadingChange: z,
176
- onDataChange: J,
177
- onPageInfoChange: Q
178
- }), F({ _: 2 }, [
179
- b(n.columns, (r) => ({
187
+ injectInfo: a(ae),
188
+ onLoadingChange: X,
189
+ onDataChange: W,
190
+ onPageInfoChange: Y
191
+ }), T({ _: 2 }, [
192
+ C(n.columns, (r) => ({
180
193
  name: r.prop,
181
194
  fn: g((l) => [
182
- d(e.$slots, `table-${r.prop}`, T($(Z(l))), void 0, !0)
195
+ d(e.$slots, `table-${r.prop}`, B(E(oe(l))), void 0, !0)
183
196
  ])
184
197
  })),
185
- b(n.columns, (r) => ({
198
+ C(n.columns, (r) => ({
186
199
  name: `header-${r.prop}`,
187
200
  fn: g((l) => {
188
- var h;
201
+ var f;
189
202
  return [
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
203
+ d(e.$slots, `table-header-${r.columnKey || r.prop}`, H(ne(l), {
204
+ searchFormData: a(k),
205
+ triggerSearch: (f = a(i)) == null ? void 0 : f.triggerSearch
193
206
  }), void 0, !0)
194
207
  ];
195
208
  })
196
209
  }))
197
210
  ]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
198
211
  ])), [
199
- [f, !m.value && a(C)]
212
+ [h, !m.value && a(b)]
200
213
  ]);
201
214
  };
202
215
  }
203
216
  });
204
217
  export {
205
- ke as default
218
+ Fe as default
206
219
  };
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4446ddf0"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9d78ca06"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,13 +1,14 @@
1
- import { ElInputNumber as y, ElSwitch as M } from "element-plus/es";
1
+ import { ElInputNumber as N, ElSwitch as R } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/switch/style/css";
4
4
  import "element-plus/es/components/input-number/style/css";
5
- import { defineComponent as N, useModel as f, computed as w, watch as x, openBlock as p, createElementBlock as c, Fragment as B, createElementVNode as v, createVNode as V, createCommentVNode as R, mergeModels as k } from "vue";
6
- import { useTimeout as F } from "../../hooks/timeout.mjs";
7
- import { useActivatedExec as T } from "../../hooks/activated.mjs";
8
- const g = { class: "auto-refresh" }, _ = /* @__PURE__ */ N({
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({
9
10
  __name: "AutoRefresh",
10
- props: /* @__PURE__ */ k({
11
+ props: /* @__PURE__ */ T({
11
12
  refreshFn: {},
12
13
  enabled: { type: Boolean, default: !0 }
13
14
  }, {
@@ -17,45 +18,46 @@ const g = { class: "auto-refresh" }, _ = /* @__PURE__ */ N({
17
18
  intervalModifiers: {}
18
19
  }),
19
20
  emits: ["update:modelValue", "update:interval"],
20
- setup(r) {
21
- const m = r, l = f(r, "modelValue"), t = f(r, "interval"), n = w(() => l.value && m.enabled), [h, i] = F();
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
23
  let o = null;
23
- const d = () => (o || (o = m.refreshFn().catch(() => {
24
+ const d = () => (o || (o = u.refreshFn().catch(() => {
24
25
  }).finally(() => {
25
26
  o = null;
26
- })), o), s = () => {
27
- h(async () => {
28
- await d(), n.value && s();
29
- }, t.value * 1e3);
27
+ })), o), i = () => {
28
+ b(async () => {
29
+ await d(), r.value && i();
30
+ }, l.value * 1e3);
30
31
  };
31
- return x([n, t], ([a]) => {
32
- a ? s() : i();
33
- }), T(({ triggerType: a }) => {
34
- n.value && (a === "activated" && (i(), d()), s());
32
+ return k([r, l], ([a]) => {
33
+ a ? i() : m();
34
+ }), A(({ triggerType: a }) => {
35
+ r.value && (a === "activated" && (m(), d()), i());
35
36
  }), (a, e) => {
36
- const E = y, b = M;
37
- return p(), c("div", g, [
38
- l.value ? (p(), c(B, { key: 0 }, [
37
+ const y = N, M = R;
38
+ return f(), p("div", C, [
39
+ t.value ? (f(), p(x, { key: 0 }, [
39
40
  e[2] || (e[2] = v("span", { class: "auto-refresh-label" }, "刷新间隔", -1)),
40
- V(E, {
41
- modelValue: t.value,
42
- "onUpdate:modelValue": e[0] || (e[0] = (u) => t.value = u),
41
+ V(y, {
42
+ modelValue: l.value,
43
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => l.value = s),
43
44
  min: 1,
44
45
  step: 1,
45
46
  size: "small",
46
47
  class: "auto-refresh-interval"
47
48
  }, null, 8, ["modelValue"]),
48
49
  e[3] || (e[3] = v("span", { class: "auto-refresh-label" }, "秒", -1))
49
- ], 64)) : R("", !0),
50
- V(b, {
51
- modelValue: l.value,
52
- "onUpdate:modelValue": e[1] || (e[1] = (u) => l.value = u),
53
- "active-text": "自动刷新"
54
- }, null, 8, ["modelValue"])
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"])
55
57
  ]);
56
58
  };
57
59
  }
58
60
  });
59
61
  export {
60
- _ as default
62
+ D as default
61
63
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableMain.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5944984b"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f0f7753c"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };