@done-coding/admin-core 0.1.1-alpha.5 → 0.1.1-alpha.7

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,20 +1,20 @@
1
- import { ElLoadingDirective as ie } from "element-plus/es";
1
+ import { ElLoadingDirective as ce } 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 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
- const be = {
4
+ import { defineComponent as he, useCssVars as fe, unref as r, useSlots as ge, computed as o, useModel as de, ref as u, shallowRef as T, inject as me, watch as ve, withDirectives as pe, openBlock as y, createElementBlock as ye, createBlock as O, withCtx as g, renderSlot as d, createCommentVNode as E, createVNode as V, mergeProps as H, createSlots as x, renderList as S, normalizeProps as B, guardReactiveProps as K, mergeModels as N } from "vue";
5
+ import He from "../form/FormSearch.vue.mjs";
6
+ import { generateFormData as Se, stringifyFormData as Ce } from "../form/utils.mjs";
7
+ import q from "../display/WatchSize.vue.mjs";
8
+ import be from "../table/TableMain.vue.mjs";
9
+ import Re from "lodash/pick";
10
+ import we from "lodash/cloneDeep";
11
+ import { BODY_CONTENT_VIEWPORT_HEIGHT as Ie } from "../../inject/key.mjs";
12
+ const Me = {
13
13
  "element-loading-background": "rgba(122, 122, 122, 0.5)",
14
14
  class: "list-page"
15
- }, Fe = /* @__PURE__ */ le({
15
+ }, xe = /* @__PURE__ */ he({
16
16
  __name: "ListPage",
17
- props: /* @__PURE__ */ V({
17
+ props: /* @__PURE__ */ N({
18
18
  staticQuery: { default: () => ({}) },
19
19
  formSearchProps: {},
20
20
  columns: {},
@@ -22,8 +22,6 @@ const be = {
22
22
  refine: { type: Boolean, default: !0 },
23
23
  refineReduceHeight: { default: 0 },
24
24
  tableMainProps: {},
25
- showOperation: { type: Boolean, default: !1 },
26
- showHeader: { type: Boolean, default: !1 },
27
25
  list: { default: () => [] },
28
26
  api: {},
29
27
  query: {},
@@ -34,46 +32,46 @@ const be = {
34
32
  isAutoRefresh: { type: Boolean },
35
33
  isAutoRefreshModifiers: {}
36
34
  }),
37
- emits: /* @__PURE__ */ V(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
38
- setup(n, { expose: K, emit: N }) {
39
- ue((e) => ({
40
- ad28a056: a(G)
35
+ emits: /* @__PURE__ */ N(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
36
+ setup(s, { expose: L, emit: J }) {
37
+ fe((e) => ({
38
+ d5119b7c: r(Y)
41
39
  }));
42
- const o = n, S = N, m = ce(n, "isAutoRefresh"), v = u({}), p = u(
40
+ const n = s, C = J, b = ge(), R = o(() => !!b.header), w = o(() => !!b.operation), m = de(s, "isAutoRefresh"), v = u({}), p = u(
43
41
  {}
44
- ), b = u(!1), i = O(), c = O(), q = he(
45
- Se,
42
+ ), I = u(!1), i = T(), c = T(), Q = me(
43
+ Ie,
46
44
  500
47
- ), w = u(0), R = u(0), I = u(0), L = s(() => ({
45
+ ), M = u(0), P = u(0), j = u(0), z = o(() => ({
48
46
  ...p.value,
49
- ...o.staticQuery
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,
47
+ ...n.staticQuery
48
+ })), k = u(!1), G = o(() => k.value ? M.value + 10 : 0), U = o(() => w.value ? P.value + 10 : 0), W = o(() => R.value ? j.value + 10 : 0), D = o(() => Q.value - n.refineReduceHeight), Y = o(() => n.refine ? `${D.value}px` : "auto"), _ = o(() => n.refine ? Math.max(
49
+ D.value - G.value - U.value - W.value,
52
50
  200
53
- ) : void 0), j = (e, t = "search") => {
54
- var r, l, f;
51
+ ) : void 0), $ = (e, t = "search") => {
52
+ var a, l, f;
55
53
  let h = e;
56
- if (o.beforeSearch && (h = o.beforeSearch(
57
- Ce(e),
54
+ if (n.beforeSearch && (h = n.beforeSearch(
55
+ we(e),
58
56
  t
59
- )), t === "reset" && o.clearTableFilterOnReset && ((l = (r = c.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(h) === JSON.stringify(p.value))
57
+ )), t === "reset" && n.clearTableFilterOnReset && ((l = (a = c.value) == null ? void 0 : a.getTableInstance()) == null || l.clearFilter()), JSON.stringify(h) === JSON.stringify(p.value))
60
58
  return ["reset", "search"].includes(t) ? (f = c.value) == null ? void 0 : f.reload() : void 0;
61
59
  p.value = {
62
60
  ...h
63
61
  };
64
- }, W = (e) => {
65
- S("dataChange", e);
66
- }, Y = (e) => {
67
- S("pageInfoChange", e);
68
62
  }, X = (e) => {
69
- b.value = e;
63
+ C("dataChange", e);
70
64
  }, Z = (e) => {
71
- w.value = e;
72
- }, _ = (e) => {
73
- R.value = e;
65
+ C("pageInfoChange", e);
74
66
  }, ee = (e) => {
75
67
  I.value = e;
76
- }, te = s(() => o.list), re = s(() => o.rowKey), k = s(() => v.value), D = {
68
+ }, te = (e) => {
69
+ M.value = e;
70
+ }, re = (e) => {
71
+ P.value = e;
72
+ }, ae = (e) => {
73
+ j.value = e;
74
+ }, oe = o(() => n.list), ne = o(() => n.rowKey), A = o(() => v.value), F = {
77
75
  refresh: async (e = !1) => {
78
76
  var t;
79
77
  return (t = c.value) == null ? void 0 : t.refresh(e);
@@ -110,110 +108,110 @@ const be = {
110
108
  update: (e, t) => {
111
109
  v.value[e] = t;
112
110
  }
113
- }, ae = s(() => {
114
- const e = He(D, [
111
+ }, se = o(() => {
112
+ const e = Re(F, [
115
113
  "triggerReset",
116
114
  "triggerSearch",
117
115
  "update"
118
116
  ]);
119
117
  return {
120
- ...o.injectInfo || {},
118
+ ...n.injectInfo || {},
121
119
  ...e
122
120
  };
123
- }), oe = (e) => e, ne = (e) => e, se = (e) => {
124
- M.value = e;
121
+ }), ie = (e) => e, le = (e) => e, ue = (e) => {
122
+ k.value = e;
125
123
  };
126
- return K(D), fe(
127
- () => o.list,
124
+ return L(F), ve(
125
+ () => n.list,
128
126
  (e) => {
129
- const t = ve(e);
130
- v.value = t, j(pe(t, e));
127
+ const t = Se(e);
128
+ v.value = t, $(Ce(t, e));
131
129
  },
132
130
  {
133
131
  immediate: !0
134
132
  }
135
133
  ), (e, t) => {
136
- const h = ie;
137
- return ge((y(), de("div", be, [
138
- n.showHeader ? (y(), $(a(x), {
134
+ const h = ce;
135
+ return pe((y(), ye("div", Me, [
136
+ r(R) ? (y(), O(r(q), {
139
137
  key: 0,
140
138
  class: "list-page-header",
141
- onHeightChange: ee
139
+ onHeightChange: ae
142
140
  }, {
143
141
  default: g(() => [
144
142
  d(e.$slots, "header", {}, void 0, !0)
145
143
  ]),
146
144
  _: 3
147
- })) : A("", !0),
148
- F(a(me), H({
145
+ })) : E("", !0),
146
+ V(r(He), H({
149
147
  ref_key: "formSearch",
150
148
  ref: i,
151
- list: a(te),
152
- data: a(k)
153
- }, n.formSearchProps, {
154
- onSearch: j,
155
- onHeightChange: Z,
156
- onVisibleChange: se
157
- }), T({ _: 2 }, [
158
- C(n.list, (r) => ({
159
- name: r.key,
149
+ list: r(oe),
150
+ data: r(A)
151
+ }, s.formSearchProps, {
152
+ onSearch: $,
153
+ onHeightChange: te,
154
+ onVisibleChange: ue
155
+ }), x({ _: 2 }, [
156
+ S(s.list, (a) => ({
157
+ name: a.key,
160
158
  fn: g((l) => [
161
- d(e.$slots, `form-${r.key}`, B(E(l)), void 0, !0)
159
+ d(e.$slots, `form-${a.key}`, B(K(l)), void 0, !0)
162
160
  ])
163
161
  }))
164
162
  ]), 1040, ["list", "data"]),
165
- n.showOperation ? (y(), $(a(x), {
163
+ r(w) ? (y(), O(r(q), {
166
164
  key: 1,
167
165
  class: "list-page-operation",
168
- onHeightChange: _
166
+ onHeightChange: re
169
167
  }, {
170
168
  default: g(() => [
171
169
  d(e.$slots, "operation", {}, void 0, !0)
172
170
  ]),
173
171
  _: 3
174
- })) : A("", !0),
175
- F(a(ye), H({
172
+ })) : E("", !0),
173
+ V(r(be), H({
176
174
  ref_key: "tableMain",
177
175
  ref: c,
178
176
  "is-auto-refresh": m.value,
179
- "onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => m.value = r),
180
- api: n.api,
181
- columns: n.columns,
182
- query: a(L),
183
- maxHeight: a(U),
184
- rowKey: a(re)
185
- }, n.tableMainProps, {
177
+ "onUpdate:isAutoRefresh": t[0] || (t[0] = (a) => m.value = a),
178
+ api: s.api,
179
+ columns: s.columns,
180
+ query: r(z),
181
+ maxHeight: r(_),
182
+ rowKey: r(ne)
183
+ }, s.tableMainProps, {
186
184
  refine: !1,
187
- injectInfo: a(ae),
188
- onLoadingChange: X,
189
- onDataChange: W,
190
- onPageInfoChange: Y
191
- }), T({ _: 2 }, [
192
- C(n.columns, (r) => ({
193
- name: r.prop,
185
+ injectInfo: r(se),
186
+ onLoadingChange: ee,
187
+ onDataChange: X,
188
+ onPageInfoChange: Z
189
+ }), x({ _: 2 }, [
190
+ S(s.columns, (a) => ({
191
+ name: a.prop,
194
192
  fn: g((l) => [
195
- d(e.$slots, `table-${r.prop}`, B(E(oe(l))), void 0, !0)
193
+ d(e.$slots, `table-${a.prop}`, B(K(ie(l))), void 0, !0)
196
194
  ])
197
195
  })),
198
- C(n.columns, (r) => ({
199
- name: `header-${r.prop}`,
196
+ S(s.columns, (a) => ({
197
+ name: `header-${a.prop}`,
200
198
  fn: g((l) => {
201
199
  var f;
202
200
  return [
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
201
+ d(e.$slots, `table-header-${a.columnKey || a.prop}`, H(le(l), {
202
+ searchFormData: r(A),
203
+ triggerSearch: (f = r(i)) == null ? void 0 : f.triggerSearch
206
204
  }), void 0, !0)
207
205
  ];
208
206
  })
209
207
  }))
210
208
  ]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
211
209
  ])), [
212
- [h, !m.value && a(b)]
210
+ [h, !m.value && r(I)]
213
211
  ]);
214
212
  };
215
213
  }
216
214
  });
217
215
  export {
218
- Fe as default
216
+ xe as default
219
217
  };
@@ -1,8 +1,8 @@
1
1
  import y from "./ConfirmModal.vue.mjs";
2
- import p from "../form/FormMain.vue.mjs";
3
- import { defineComponent as g, ref as A, computed as l, watch as C, openBlock as M, createBlock as x, unref as s, withCtx as D, createVNode as b, mergeProps as k } from "vue";
2
+ import g from "../form/FormMain.vue.mjs";
3
+ import { defineComponent as p, ref as b, computed as r, watch as A, openBlock as C, createBlock as M, unref as s, withCtx as W, createVNode as D, mergeProps as k } from "vue";
4
4
  import { stringifyFormData as v } from "../form/utils.mjs";
5
- const B = "80px", $ = /* @__PURE__ */ g({
5
+ const P = /* @__PURE__ */ p({
6
6
  __name: "DetailModal",
7
7
  props: {
8
8
  data: {},
@@ -15,49 +15,50 @@ const B = "80px", $ = /* @__PURE__ */ g({
15
15
  modalWidth: { default: 600 },
16
16
  formLayout: { default: () => ({ span: 24 }) },
17
17
  formProps: {},
18
- formRowGutter: {}
18
+ formRowGutter: {},
19
+ labelWidth: { default: "auto" }
19
20
  },
20
21
  emits: ["update:show", "afterAdd", "afterEdit"],
21
- setup(e, { emit: f }) {
22
- const t = e, r = f, d = A(), m = l(() => t.data), c = l(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (a) => {
23
- r("update:show", a);
24
- }, w = () => {
25
- var a;
26
- return (a = d.value) == null ? void 0 : a.validate().then(async () => {
22
+ setup(a, { emit: f }) {
23
+ const t = a, l = f, d = b(), m = r(() => t.data), c = r(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (o) => {
24
+ l("update:show", o);
25
+ }, h = () => {
26
+ var o;
27
+ return (o = d.value) == null ? void 0 : o.validate().then(async () => {
27
28
  var i, n;
28
- const o = v(t.data, t.list);
29
- console.log("confirm", o), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, o)), r("afterAdd", o)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, o)), r("afterEdit", o));
29
+ const e = v(t.data, t.list);
30
+ console.log("confirm", e), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, e)), l("afterAdd", e)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, e)), l("afterEdit", e));
30
31
  });
31
- }, h = () => {
32
+ }, w = () => {
32
33
  console.log("cancel");
33
34
  };
34
- return C(
35
+ return A(
35
36
  () => t.show,
36
- (a) => {
37
- var o;
38
- a || (o = d.value) == null || o.clearValidate();
37
+ (o) => {
38
+ var e;
39
+ o || (e = d.value) == null || e.clearValidate();
39
40
  }
40
- ), (a, o) => {
41
- const i = p, n = y;
42
- return M(), x(n, {
41
+ ), (o, e) => {
42
+ const i = g, n = y;
43
+ return C(), M(n, {
43
44
  title: s(c),
44
- show: e.show,
45
- onConfirm: w,
46
- onCancel: h,
45
+ show: a.show,
46
+ onConfirm: h,
47
+ onCancel: w,
47
48
  useLoading: "",
48
- width: e.modalWidth,
49
+ width: a.modalWidth,
49
50
  "onUpdate:show": u
50
51
  }, {
51
- default: D(() => [
52
- b(i, k({
52
+ default: W(() => [
53
+ D(i, k({
53
54
  ref_key: "formMain",
54
55
  ref: d,
55
- list: e.list,
56
+ list: a.list,
56
57
  data: s(m),
57
- layout: e.formLayout,
58
- labelWidth: B,
59
- "row-gutter": e.formRowGutter
60
- }, e.formProps), null, 16, ["list", "data", "layout", "row-gutter"])
58
+ layout: a.formLayout,
59
+ labelWidth: a.labelWidth,
60
+ "row-gutter": a.formRowGutter
61
+ }, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
61
62
  ]),
62
63
  _: 1
63
64
  }, 8, ["title", "show", "width"]);
@@ -65,5 +66,5 @@ const B = "80px", $ = /* @__PURE__ */ g({
65
66
  }
66
67
  });
67
68
  export {
68
- $ as default
69
+ P as default
69
70
  };
@@ -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-3d9833b8"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-135cf353"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };