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

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,94 +1,98 @@
1
- import { ElForm as B, ElRow as H, ElCol as K } from "element-plus/es";
1
+ import { ElForm as M, ElRow as A, ElCol as B } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/form/style/css";
4
4
  import "element-plus/es/components/row/style/css";
5
5
  import "element-plus/es/components/col/style/css";
6
- import { defineComponent as N, shallowRef as P, ref as E, computed as i, provide as D, watch as p, openBlock as h, createBlock as L, unref as y, withCtx as f, createVNode as V, createElementBlock as G, Fragment as T, renderList as q, withDirectives as z, mergeProps as O, renderSlot as S, vShow as J } from "vue";
6
+ import { defineComponent as H, shallowRef as N, ref as _, computed as i, provide as P, watch as h, openBlock as p, createBlock as L, unref as y, withCtx as m, createVNode as O, createElementBlock as D, Fragment as T, renderList as q, withDirectives as z, mergeProps as V, renderSlot as j, vShow as J } from "vue";
7
7
  import Q from "./FormItem.vue.mjs";
8
8
  import { FORM_ITEM_CHANGE_LOADING as U } from "./utils.mjs";
9
- const ue = /* @__PURE__ */ N({
9
+ const ue = /* @__PURE__ */ H({
10
10
  name: "FormMain",
11
11
  inheritAttrs: !0,
12
12
  __name: "FormMain",
13
13
  props: {
14
14
  list: {},
15
15
  data: {},
16
- layout: {}
16
+ layout: {},
17
+ rowGutter: { default: 0 }
17
18
  },
18
19
  emits: ["loadingChange", "visibleChange", "submit"],
19
- setup(m, { expose: j, emit: x }) {
20
- const u = m, v = x, a = P(), d = E([]), c = E({}), b = i(() => !!d.value.length), F = i(() => Object.keys(c.value).filter(
21
- (e) => c.value[e]
22
- )), R = i(() => u.list.filter((e) => !F.value.includes(e.key))), $ = i(() => R.value.length > 0), I = (e) => e;
23
- j({
20
+ setup(f, { expose: S, emit: x }) {
21
+ const d = f, v = x, a = N(), c = _([]), u = _({}), b = i(() => !!c.value.length), w = i(() => Object.keys(u.value).filter(
22
+ (e) => u.value[e]
23
+ )), R = i(() => d.list.filter((e) => !w.value.includes(e.key))), $ = i(() => R.value.length > 0), G = (e) => e;
24
+ S({
24
25
  validate: () => a.value ? new Promise((e, t) => {
25
- var o;
26
- (o = a.value) == null || o.validate((l, s) => {
27
- if (l)
26
+ var l;
27
+ (l = a.value) == null || l.validate((r, s) => {
28
+ if (r)
28
29
  e();
29
30
  else {
30
- const r = { ...s || {} };
31
- Object.keys(r).forEach((n) => {
31
+ const o = { ...s || {} };
32
+ Object.keys(o).forEach((n) => {
32
33
  var C;
33
- F.value.includes(n) && (console.log(`当前${n}被隐藏,移除校验`, r[n]), delete r[n], (C = a.value) == null || C.clearValidate(n));
34
- }), Object.keys(r).length === 0 ? e() : t(s);
34
+ w.value.includes(n) && (console.log(`当前${n}被隐藏,移除校验`, o[n]), delete o[n], (C = a.value) == null || C.clearValidate(n));
35
+ }), Object.keys(o).length === 0 ? e() : t(s);
35
36
  }
36
37
  });
37
38
  }) : Promise.reject(new Error("实例化未完成")),
38
39
  resetFields: () => a.value ? a.value.resetFields() : console.error("实例化未完成"),
39
40
  clearValidate: (e) => a.value ? a.value.clearValidate(e) : console.error("实例化未完成")
40
41
  });
41
- const g = i(() => u.list), _ = i(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
42
- data: u.data,
42
+ const g = i(() => d.list), k = i(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
43
+ data: d.data,
43
44
  config: t
44
- }) : e[t.key] = t.rules), e), {})), k = i(() => d.value.reduce(
45
+ }) : e[t.key] = t.rules), e), {})), F = i(() => c.value.reduce(
45
46
  (e, t) => (e[t.key] = [
46
47
  {
47
48
  validator: () => [new Error(`${t.label}${t.message}`)]
48
49
  }
49
50
  ], e),
50
51
  {}
51
- )), M = i(() => {
52
- const e = Object.keys(_.value), t = Object.keys(k.value);
53
- return [...new Set(e.concat(t))].reduce((l, s) => (l[s] = [
54
- ..._.value[s] || [],
55
- ...k.value[s] || []
56
- ], l), {});
52
+ )), I = i(() => {
53
+ const e = Object.keys(k.value), t = Object.keys(F.value);
54
+ return [...new Set(e.concat(t))].reduce((r, s) => (r[s] = [
55
+ ...k.value[s] || [],
56
+ ...F.value[s] || []
57
+ ], r), {});
57
58
  });
58
- D(U, ({ key: e, message: t }) => {
59
+ P(U, ({ key: e, message: t }) => {
59
60
  if (!e)
60
61
  return console.error("更新状态未传入key, 此处忽略");
61
- const o = d.value.findIndex((l) => l.key === e);
62
- o === -1 ? t && d.value.push({
62
+ const l = c.value.findIndex((r) => r.key === e);
63
+ l === -1 ? t && c.value.push({
63
64
  key: e,
64
65
  message: t,
65
- label: u.list.find((l) => l.key === e).label
66
- }) : t ? d.value.splice(o, 1, {
66
+ label: d.list.find((r) => r.key === e).label
67
+ }) : t ? c.value.splice(l, 1, {
67
68
  key: e,
68
69
  message: t,
69
- label: u.list.find((l) => l.key === e).label
70
- }) : d.value.splice(o, 1);
70
+ label: d.list.find((r) => r.key === e).label
71
+ }) : c.value.splice(l, 1);
71
72
  });
72
- const A = ({
73
+ const K = ({
73
74
  status: e,
74
75
  config: { key: t }
75
76
  }) => {
76
- (c.value[t] || !1) !== e && (c.value[t] = e);
77
- }, w = (e) => ({
78
- ...u.layout || {},
77
+ (u.value[t] || !1) !== e && (u.value[t] = e);
78
+ }, E = (e) => ({
79
+ ...d.layout || {},
79
80
  ...e || {}
80
81
  });
81
- return p(
82
+ return h(
82
83
  g,
83
- () => {
84
- c.value = {};
84
+ (e) => {
85
+ const t = e.map((l) => l.key);
86
+ Object.keys(u.value).forEach((l) => {
87
+ t.includes(l) || delete u.value[l];
88
+ });
85
89
  },
86
90
  {
87
91
  immediate: !0
88
92
  }
89
- ), p(b, () => {
93
+ ), h(b, () => {
90
94
  v("loadingChange", b.value);
91
- }), p(
95
+ }), h(
92
96
  $,
93
97
  (e) => {
94
98
  v("visibleChange", e);
@@ -97,40 +101,40 @@ const ue = /* @__PURE__ */ N({
97
101
  immediate: !0
98
102
  }
99
103
  ), (e, t) => {
100
- const o = K, l = H, s = B;
101
- return h(), L(s, {
104
+ const l = B, r = A, s = M;
105
+ return p(), L(s, {
102
106
  ref_key: "elForm",
103
107
  ref: a,
104
- model: m.data,
105
- rules: y(M)
108
+ model: f.data,
109
+ rules: y(I)
106
110
  }, {
107
- default: f(() => [
108
- V(l, null, {
109
- default: f(() => [
110
- (h(!0), G(T, null, q(y(g), (r) => z((h(), L(o, O({
111
- key: r.key
112
- }, { ref_for: !0 }, w(r.layout)), {
113
- default: f(() => [
114
- V(Q, {
115
- data: m.data,
116
- config: I(r),
117
- onViewHideChange: A,
111
+ default: m(() => [
112
+ O(r, { gutter: f.rowGutter }, {
113
+ default: m(() => [
114
+ (p(!0), D(T, null, q(y(g), (o) => z((p(), L(l, V({
115
+ key: o.key
116
+ }, { ref_for: !0 }, E(o.layout)), {
117
+ default: m(() => [
118
+ O(Q, {
119
+ data: f.data,
120
+ config: G(o),
121
+ onViewHideChange: K,
118
122
  onSubmit: t[0] || (t[0] = (n) => v("submit", n))
119
123
  }, {
120
- default: f((n) => [
121
- S(e.$slots, r.key, O({ ref_for: !0 }, n))
124
+ default: m((n) => [
125
+ j(e.$slots, o.key, V({ ref_for: !0 }, n))
122
126
  ]),
123
127
  _: 2
124
128
  }, 1032, ["data", "config"])
125
129
  ]),
126
130
  _: 2
127
131
  }, 1040)), [
128
- [J, !(y(c)[r.key] ?? !1)]
132
+ [J, !(y(u)[o.key] ?? !1)]
129
133
  ])), 128)),
130
- S(e.$slots, "default", { mergeLayout: w })
134
+ j(e.$slots, "default", { mergeLayout: E })
131
135
  ]),
132
136
  _: 3
133
- })
137
+ }, 8, ["gutter"])
134
138
  ]),
135
139
  _: 3
136
140
  }, 8, ["model", "rules"]);
@@ -3,7 +3,7 @@ import { ElCol as k, ElButton as M } from "element-plus/es";
3
3
  import "element-plus/es/components/base/style/css";
4
4
  import "element-plus/es/components/col/style/css";
5
5
  import "element-plus/es/components/button/style/css";
6
- import { defineComponent as B, useAttrs as R, ref as W, computed as $, shallowRef as D, openBlock as N, createBlock as Q, normalizeClass as z, unref as i, withCtx as r, withDirectives as A, createVNode as m, mergeProps as H, createSlots as L, normalizeProps as g, guardReactiveProps as v, createElementVNode as T, createTextVNode as y, renderList as j, renderSlot as q, vShow as G } from "vue";
6
+ import { defineComponent as B, useAttrs as R, ref as W, computed as $, shallowRef as D, openBlock as N, createBlock as Q, normalizeClass as z, unref as i, withCtx as r, withDirectives as A, createVNode as m, mergeProps as G, createSlots as H, normalizeProps as g, guardReactiveProps as v, createElementVNode as L, createTextVNode as y, renderList as T, renderSlot as j, vShow as q } from "vue";
7
7
  import { stringifyFormData as I } from "./utils.mjs";
8
8
  import J from "../display/WatchSize.vue.mjs";
9
9
  const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
@@ -22,21 +22,22 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
22
22
  md: 12,
23
23
  lg: 8,
24
24
  xl: 6
25
- }) }
25
+ }) },
26
+ rowGutter: {}
26
27
  },
27
28
  emits: ["search", "heightChange", "visibleChange"],
28
- setup(o, { expose: b, emit: C }) {
29
- const s = o, l = C, w = R(), u = W(!1), x = $(() => s.data), S = (e) => {
29
+ setup(a, { expose: b, emit: w }) {
30
+ const s = a, l = w, C = R(), u = W(!1), x = $(() => s.data), S = (e) => {
30
31
  l("heightChange", e);
31
- }, a = D(), d = (e) => ({
32
+ }, o = D(), d = (e) => ({
32
33
  ...s.staticQuery || {},
33
34
  ...I(e, s.list)
34
35
  }), h = () => {
35
36
  var e;
36
- (e = a.value) == null || e.resetFields(), l("search", d(s.data), "reset");
37
+ (e = o.value) == null || e.resetFields(), l("search", d(s.data), "reset");
37
38
  }, c = (e = "search") => {
38
39
  var t;
39
- (t = a.value) == null || t.validate().then(() => {
40
+ (t = o.value) == null || t.validate().then(() => {
40
41
  l("search", d(s.data), e);
41
42
  });
42
43
  }, F = (e) => {
@@ -44,17 +45,17 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
44
45
  };
45
46
  b({
46
47
  validate: () => {
47
- if (a.value)
48
- return a.value.validate();
48
+ if (o.value)
49
+ return o.value.validate();
49
50
  throw new Error("实例化未完成");
50
51
  },
51
52
  resetFields: () => {
52
53
  var e;
53
- return (e = a.value) == null ? void 0 : e.resetFields();
54
+ return (e = o.value) == null ? void 0 : e.resetFields();
54
55
  },
55
56
  clearValidate: (e) => {
56
57
  var t;
57
- return (t = a.value) == null ? void 0 : t.clearValidate(e);
58
+ return (t = o.value) == null ? void 0 : t.clearValidate(e);
58
59
  },
59
60
  triggerReset: h,
60
61
  triggerSearch: () => c()
@@ -71,22 +72,22 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
71
72
  onHeightChange: S
72
73
  }, {
73
74
  default: r(() => [
74
- A(m(E, H({
75
+ A(m(E, G({
75
76
  ref_key: "formMain",
76
- ref: a,
77
- list: o.list,
77
+ ref: o,
78
+ list: a.list,
78
79
  data: i(x)
79
- }, i(w), {
80
- layout: o.layout,
81
- labelPosition: o.labelPosition,
82
- labelWidth: o.labelWidth,
80
+ }, i(C), {
81
+ layout: a.layout,
82
+ labelPosition: a.labelPosition,
83
+ labelWidth: a.labelWidth,
83
84
  onSubmit: F,
84
85
  onVisibleChange: _
85
- }), L({
86
+ }), H({
86
87
  default: r(({ mergeLayout: n }) => [
87
88
  m(P, g(v(n())), {
88
89
  default: r(() => [
89
- T("div", K, [
90
+ L("div", K, [
90
91
  m(f, {
91
92
  type: "primary",
92
93
  onMousedown: h
@@ -112,14 +113,14 @@ const K = { class: "btn-box" }, re = /* @__PURE__ */ B({
112
113
  ]),
113
114
  _: 2
114
115
  }, [
115
- j(o.list, (n) => ({
116
+ T(a.list, (n) => ({
116
117
  name: n.key,
117
118
  fn: r((p) => [
118
- q(e.$slots, n.key, g(v(p)), void 0, !0)
119
+ j(e.$slots, n.key, g(v(p)), void 0, !0)
119
120
  ])
120
121
  }))
121
122
  ]), 1040, ["list", "data", "layout", "labelPosition", "labelWidth"]), [
122
- [G, i(u)]
123
+ [q, i(u)]
123
124
  ])
124
125
  ]),
125
126
  _: 3
@@ -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-167d5788"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c9564dc7"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,18 +1,18 @@
1
- import { ElLoadingDirective as W } from "element-plus/es";
1
+ import { ElLoadingDirective as Z } 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 Y, useCssVars as U, unref as t, ref as c, shallowRef as k, inject as X, computed as n, watch as Z, withDirectives as ee, openBlock as D, createElementBlock as re, createVNode as F, mergeProps as v, createSlots as P, renderList as y, withCtx as g, renderSlot as m, normalizeProps as T, guardReactiveProps as $, createBlock as te, createCommentVNode as ae } from "vue";
5
- import oe from "../form/FormSearch.vue.mjs";
6
- import { generateFormData as ne, stringifyFormData as se } from "../form/utils.mjs";
7
- import ie from "../display/WatchSize.vue.mjs";
8
- import le from "../table/TableMain.vue.mjs";
9
- import ue from "lodash/pick";
10
- import ce from "lodash/cloneDeep";
11
- import { BODY_CONTENT_VIEWPORT_HEIGHT as fe } from "../../inject/key.mjs";
12
- const he = {
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 = {
13
13
  "element-loading-background": "rgba(122, 122, 122, 0.5)",
14
14
  class: "list-page"
15
- }, Oe = /* @__PURE__ */ Y({
15
+ }, Re = /* @__PURE__ */ ee({
16
16
  __name: "ListPage",
17
17
  props: {
18
18
  staticQuery: { default: () => ({}) },
@@ -30,50 +30,55 @@ const he = {
30
30
  beforeSearch: {},
31
31
  clearTableFilterOnReset: { type: Boolean }
32
32
  },
33
- setup(s, { expose: I }) {
34
- U((e) => ({
35
- v20e95162: t(E)
33
+ emits: ["dataChange", "pageInfoChange"],
34
+ setup(s, { expose: M, emit: x }) {
35
+ te((e) => ({
36
+ f49642f0: r(N)
36
37
  }));
37
- const a = s, d = c({}), p = c(
38
+ const a = s, S = x, d = u({}), p = u(
38
39
  {}
39
- ), S = c(!1), i = k(), u = k(), M = X(
40
- fe,
40
+ ), b = u(!1), i = R(), c = R(), E = re(
41
+ de,
41
42
  500
42
- ), b = c(0), H = c(0), x = n(() => ({
43
+ ), C = u(0), H = u(0), V = o(() => ({
43
44
  ...p.value,
44
45
  ...a.staticQuery
45
- })), w = c(!1), V = n(() => w.value ? b.value + 10 : 0), B = n(() => a.showOperation ? H.value + 10 : 0), C = n(() => M.value - a.refineReduceHeight), E = n(() => a.refine ? `${C.value}px` : "auto"), K = n(() => a.refine ? Math.max(
46
- C.value - V.value - B.value,
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,
47
48
  200
48
- ) : void 0), O = (e, r = "search") => {
49
- var o, l, h;
49
+ ) : void 0), P = (e, t = "search") => {
50
+ var n, l, g;
50
51
  let f = e;
51
52
  if (a.beforeSearch && (f = a.beforeSearch(
52
- ce(e),
53
- r
54
- )), r === "reset" && a.clearTableFilterOnReset && ((l = (o = u.value) == null ? void 0 : o.getTableInstance()) == null || l.clearFilter()), JSON.stringify(f) === JSON.stringify(p.value))
55
- return ["reset", "search"].includes(r) ? (h = u.value) == null ? void 0 : h.reload() : void 0;
53
+ me(e),
54
+ 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;
56
57
  p.value = {
57
58
  ...f
58
59
  };
59
- }, N = (e) => {
60
- S.value = e;
61
- }, q = (e) => {
62
- b.value = e;
63
60
  }, L = (e) => {
61
+ S("dataChange", e);
62
+ }, A = (e) => {
63
+ S("pageInfoChange", e);
64
+ }, _ = (e) => {
65
+ b.value = e;
66
+ }, J = (e) => {
67
+ C.value = e;
68
+ }, Q = (e) => {
64
69
  H.value = e;
65
- }, A = n(() => a.list), _ = n(() => a.rowKey), R = n(() => d.value), j = {
70
+ }, z = o(() => a.list), G = o(() => a.rowKey), D = o(() => d.value), O = {
66
71
  refresh: (e = !1) => {
67
- var r;
68
- return (r = u.value) == null ? void 0 : r.refresh(e);
72
+ var t;
73
+ return (t = c.value) == null ? void 0 : t.refresh(e);
69
74
  },
70
75
  reload: (e = !1) => {
71
- var r;
72
- return (r = u.value) == null ? void 0 : r.reload(e);
76
+ var t;
77
+ return (t = c.value) == null ? void 0 : t.reload(e);
73
78
  },
74
79
  getTableInstance: () => {
75
80
  var e;
76
- return (e = u.value) == null ? void 0 : e.getTableInstance();
81
+ return (e = c.value) == null ? void 0 : e.getTableInstance();
77
82
  },
78
83
  validate: () => {
79
84
  if (i.value)
@@ -85,8 +90,8 @@ const he = {
85
90
  return (e = i.value) == null ? void 0 : e.resetFields();
86
91
  },
87
92
  clearValidate: (e) => {
88
- var r;
89
- return (r = i.value) == null ? void 0 : r.clearValidate(e);
93
+ var t;
94
+ return (t = i.value) == null ? void 0 : t.clearValidate(e);
90
95
  },
91
96
  triggerReset: () => {
92
97
  var e;
@@ -96,11 +101,11 @@ const he = {
96
101
  var e;
97
102
  return (e = i.value) == null ? void 0 : e.triggerSearch();
98
103
  },
99
- update: (e, r) => {
100
- d.value[e] = r;
104
+ update: (e, t) => {
105
+ d.value[e] = t;
101
106
  }
102
- }, J = n(() => {
103
- const e = ue(j, [
107
+ }, W = o(() => {
108
+ const e = he(O, [
104
109
  "triggerReset",
105
110
  "triggerSearch",
106
111
  "update"
@@ -109,86 +114,88 @@ const he = {
109
114
  ...a.injectInfo || {},
110
115
  ...e
111
116
  };
112
- }), Q = (e) => e, z = (e) => e, G = (e) => {
117
+ }), Y = (e) => e, U = (e) => e, X = (e) => {
113
118
  w.value = e;
114
119
  };
115
- return I(j), Z(
120
+ return M(O), ae(
116
121
  () => a.list,
117
122
  (e) => {
118
- const r = ne(e);
119
- d.value = r, O(se(r, e));
123
+ const t = ce(e);
124
+ d.value = t, P(ue(t, e));
120
125
  },
121
126
  {
122
127
  immediate: !0
123
128
  }
124
- ), (e, r) => {
125
- const f = W;
126
- return ee((D(), re("div", he, [
127
- F(t(oe), v({
129
+ ), (e, t) => {
130
+ const f = Z;
131
+ return ne((j(), oe("div", pe, [
132
+ k(r(le), v({
128
133
  ref_key: "formSearch",
129
134
  ref: i,
130
- list: t(A),
131
- data: t(R)
135
+ list: r(z),
136
+ data: r(D)
132
137
  }, s.formSearchProps, {
133
- onSearch: O,
134
- onHeightChange: q,
135
- onVisibleChange: G
136
- }), P({ _: 2 }, [
137
- y(s.list, (o) => ({
138
- name: o.key,
139
- fn: g((l) => [
140
- m(e.$slots, `form-${o.key}`, T($(l)), void 0, !0)
138
+ onSearch: P,
139
+ onHeightChange: J,
140
+ onVisibleChange: X
141
+ }), 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)
141
146
  ])
142
147
  }))
143
148
  ]), 1040, ["list", "data"]),
144
- s.showOperation ? (D(), te(t(ie), {
149
+ s.showOperation ? (j(), se(r(fe), {
145
150
  key: 0,
146
151
  class: "list-page-operation",
147
- onHeightChange: L
152
+ onHeightChange: Q
148
153
  }, {
149
- default: g(() => [
154
+ default: h(() => [
150
155
  m(e.$slots, "operation", {}, void 0, !0)
151
156
  ]),
152
157
  _: 3
153
- })) : ae("", !0),
154
- F(t(le), v({
158
+ })) : ie("", !0),
159
+ k(r(ge), v({
155
160
  ref_key: "tableMain",
156
- ref: u,
161
+ ref: c,
157
162
  api: s.api,
158
163
  columns: s.columns,
159
- query: t(x),
160
- maxHeight: t(K),
161
- rowKey: t(_)
164
+ query: r(V),
165
+ maxHeight: r(q),
166
+ rowKey: r(G)
162
167
  }, s.tableMainProps, {
163
168
  refine: !1,
164
- injectInfo: t(J),
165
- onLoadingChange: N
166
- }), P({ _: 2 }, [
167
- y(s.columns, (o) => ({
168
- name: o.prop,
169
- fn: g((l) => [
170
- m(e.$slots, `table-${o.prop}`, T($(Q(l))), void 0, !0)
169
+ injectInfo: r(W),
170
+ onLoadingChange: _,
171
+ onDataChange: L,
172
+ onPageInfoChange: A
173
+ }), 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)
171
178
  ])
172
179
  })),
173
- y(s.columns, (o) => ({
174
- name: `header-${o.prop}`,
175
- fn: g((l) => {
176
- var h;
180
+ y(s.columns, (n) => ({
181
+ name: `header-${n.prop}`,
182
+ fn: h((l) => {
183
+ var g;
177
184
  return [
178
- m(e.$slots, `table-header-${o.columnKey || o.prop}`, v(z(l), {
179
- searchFormData: t(R),
180
- triggerSearch: (h = t(i)) == null ? void 0 : h.triggerSearch
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
181
188
  }), void 0, !0)
182
189
  ];
183
190
  })
184
191
  }))
185
192
  ]), 1040, ["api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
186
193
  ])), [
187
- [f, t(S)]
194
+ [f, r(b)]
188
195
  ]);
189
196
  };
190
197
  }
191
198
  });
192
199
  export {
193
- Oe as default
200
+ Re as default
194
201
  };
@@ -1,8 +1,8 @@
1
- import p from "./ConfirmModal.vue.mjs";
2
- import y from "../form/FormMain.vue.mjs";
3
- import { defineComponent as g, ref as A, computed as r, watch as C, openBlock as M, createBlock as x, unref as s, withCtx as D, createVNode as _, mergeProps as b } from "vue";
4
- import { stringifyFormData as k } from "../form/utils.mjs";
5
- const v = "80px", W = /* @__PURE__ */ g({
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";
4
+ import { stringifyFormData as v } from "../form/utils.mjs";
5
+ const B = "80px", $ = /* @__PURE__ */ g({
6
6
  __name: "DetailModal",
7
7
  props: {
8
8
  data: {},
@@ -14,48 +14,50 @@ const v = "80px", W = /* @__PURE__ */ g({
14
14
  editApi: {},
15
15
  modalWidth: { default: 600 },
16
16
  formLayout: { default: () => ({ span: 24 }) },
17
- formProps: {}
17
+ formProps: {},
18
+ formRowGutter: {}
18
19
  },
19
20
  emits: ["update:show", "afterAdd", "afterEdit"],
20
- setup(e, { emit: c }) {
21
- const t = e, d = c, l = A(), f = r(() => t.data), m = r(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (o) => {
22
- d("update:show", o);
23
- }, h = () => {
24
- var o;
25
- return (o = l.value) == null ? void 0 : o.validate().then(async () => {
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 () => {
26
27
  var i, n;
27
- const a = k(t.data, t.list);
28
- console.log("confirm", a), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, a)), d("afterAdd", a)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, a)), d("afterEdit", a));
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
30
  });
30
- }, w = () => {
31
+ }, h = () => {
31
32
  console.log("cancel");
32
33
  };
33
34
  return C(
34
35
  () => t.show,
35
- (o) => {
36
- var a;
37
- o || (a = l.value) == null || a.clearValidate();
36
+ (a) => {
37
+ var o;
38
+ a || (o = d.value) == null || o.clearValidate();
38
39
  }
39
- ), (o, a) => {
40
- const i = y, n = p;
40
+ ), (a, o) => {
41
+ const i = p, n = y;
41
42
  return M(), x(n, {
42
- title: s(m),
43
+ title: s(c),
43
44
  show: e.show,
44
- onConfirm: h,
45
- onCancel: w,
45
+ onConfirm: w,
46
+ onCancel: h,
46
47
  useLoading: "",
47
48
  width: e.modalWidth,
48
49
  "onUpdate:show": u
49
50
  }, {
50
51
  default: D(() => [
51
- _(i, b({
52
+ b(i, k({
52
53
  ref_key: "formMain",
53
- ref: l,
54
+ ref: d,
54
55
  list: e.list,
55
- data: s(f),
56
+ data: s(m),
56
57
  layout: e.formLayout,
57
- labelWidth: v
58
- }, e.formProps), null, 16, ["list", "data", "layout"])
58
+ labelWidth: B,
59
+ "row-gutter": e.formRowGutter
60
+ }, e.formProps), null, 16, ["list", "data", "layout", "row-gutter"])
59
61
  ]),
60
62
  _: 1
61
63
  }, 8, ["title", "show", "width"]);
@@ -63,5 +65,5 @@ const v = "80px", W = /* @__PURE__ */ g({
63
65
  }
64
66
  });
65
67
  export {
66
- W as default
68
+ $ as default
67
69
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableMain.vue2.mjs";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-173e1cb3"]]);
3
+ import f from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const m = /* @__PURE__ */ f(o, [["__scopeId", "data-v-c7f10ff2"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,17 +1,17 @@
1
- import { ElTable as ne, ElTableColumn as ae, ElEmpty as oe, ElPagination as ie } from "element-plus/es";
1
+ import { ElTable as ae, ElTableColumn as ne, ElEmpty as oe, ElPagination as ie } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/pagination/style/css";
4
4
  import "element-plus/es/components/table/style/css";
5
5
  import "element-plus/es/components/empty/style/css";
6
6
  import "element-plus/es/components/table-column/style/css";
7
- import { defineComponent as le, useCssVars as se, useAttrs as ue, ref as p, shallowRef as fe, inject as pe, computed as _, onMounted as ge, onActivated as de, watch as g, openBlock as o, createElementBlock as c, createVNode as L, mergeProps as d, unref as u, withCtx as S, Fragment as E, renderList as ce, createBlock as C, createSlots as me, renderSlot as j, resolveDynamicComponent as A, createTextVNode as T, toDisplayString as J, withDirectives as he, createElementVNode as ye, isRef as B, vShow as ve } from "vue";
7
+ import { defineComponent as le, useCssVars as se, useAttrs as ue, ref as p, shallowRef as fe, inject as pe, computed as _, onMounted as ge, onActivated as de, watch as g, openBlock as i, createElementBlock as m, createVNode as L, mergeProps as d, unref as u, withCtx as S, Fragment as C, renderList as ce, createBlock as E, createSlots as me, renderSlot as j, resolveDynamicComponent as A, createTextVNode as P, toDisplayString as J, withDirectives as he, createElementVNode as ye, isRef as B, vShow as ve } from "vue";
8
8
  import $ from "lodash/cloneDeep";
9
9
  import M from "lodash/omit";
10
10
  import V from "lodash/set";
11
11
  import Y from "lodash/get";
12
12
  import { BODY_CONTENT_VIEWPORT_HEIGHT as _e } from "../../inject/key.mjs";
13
13
  import { APP_API_LIST_MODEL_KEY_CONFIG as b } from "../../config/list-model.mjs";
14
- const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke = /* @__PURE__ */ le({
14
+ const Se = { class: "table-main" }, Ce = { class: "table-main-pagination" }, Ke = /* @__PURE__ */ le({
15
15
  __name: "TableMain",
16
16
  props: {
17
17
  showPager: { type: Boolean, default: !0 },
@@ -29,104 +29,108 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
29
29
  refineReduceHeight: { default: 0 },
30
30
  injectInfo: {}
31
31
  },
32
- emits: ["pageChange", "pageSizeChange", "dataChange", "loadingChange"],
32
+ emits: ["pageChange", "pageSizeChange", "dataChange", "loadingChange", "pageInfoChange"],
33
33
  setup(f, { expose: G, emit: q }) {
34
34
  se((e) => ({
35
- v2c344d25: e.headerColor
35
+ d46c1602: e.headerColor
36
36
  }));
37
- const n = f, m = q, D = ue(), w = p([]), I = p(0), i = p(0), a = p(1), h = p(!1), x = p(!1), O = fe(), F = pe(
37
+ const a = f, c = q, D = ue(), w = p([]), x = p(0), o = p(0), n = p(1), h = p(!1), I = p(!1), T = fe(), F = pe(
38
38
  _e,
39
39
  500
40
- ), P = _(() => n.showPager ? 35 : 0), U = _(() => {
41
- const { maxHeight: e, refine: t } = n;
42
- return e ? Math.max(e - P.value, 200) : t ? Math.max(
43
- F.value - P.value - n.refineReduceHeight,
40
+ ), O = _(() => a.showPager ? 35 : 0), U = _(() => {
41
+ const { maxHeight: e, refine: t } = a;
42
+ return e ? Math.max(e - O.value, 200) : t ? Math.max(
43
+ F.value - O.value - a.refineReduceHeight,
44
44
  200
45
45
  ) : void 0;
46
46
  }), y = _(() => {
47
- const e = $(n.query || {});
48
- return V(e, b.PAGE_SIZE_KEY, i.value), V(
47
+ const e = $(a.query || {});
48
+ return V(e, b.PAGE_SIZE_KEY, o.value), V(
49
49
  e,
50
50
  b.CURRENT_PAGE_KEY,
51
- a.value
51
+ n.value
52
52
  ), e;
53
53
  }), W = _(() => ({
54
- ...n.tableProps,
54
+ ...a.tableProps,
55
55
  ...D
56
- })), N = (e, t = !0) => {
56
+ })), z = (e, t = !0) => {
57
57
  const l = JSON.stringify(e) === JSON.stringify(y.value);
58
58
  return !l && t && console.warn(
59
59
  `同一地方 并发请求 参数冰花 当前不是最新的参数 丢弃结果 ${JSON.stringify(
60
60
  e
61
61
  )} => ${JSON.stringify(y.value)}`
62
62
  ), l;
63
- }, k = (e = !1) => {
64
- if (!i.value) return;
65
- h.value ? console.warn("请求并发") : h.value = !0, e || (x.value = !0);
63
+ }, N = (e = !1) => {
64
+ if (!o.value) return;
65
+ h.value ? console.warn("请求并发") : h.value = !0, e || (I.value = !0);
66
66
  const t = $(y.value);
67
- n.api(t).then((l) => {
68
- N(t, !1) && (w.value = Y(
67
+ a.api(t).then((l) => {
68
+ z(t, !1) && (w.value = Y(
69
69
  l,
70
70
  b.LIST_KEY
71
- ), I.value = Y(
71
+ ), x.value = Y(
72
72
  l,
73
73
  b.TOTAL_KEY
74
- ));
74
+ ), c("pageInfoChange", {
75
+ pageSize: o.value,
76
+ currentPage: n.value,
77
+ total: x.value
78
+ }));
75
79
  }).finally(() => {
76
- N(t) && (h.value = !1, x.value = !1);
80
+ z(t) && (h.value = !1, I.value = !1);
77
81
  });
78
- }, z = (e = !1) => {
79
- k(e);
82
+ }, k = (e = !1) => {
83
+ N(e);
80
84
  }, Z = (e = !1) => {
81
- a.value === 1 ? z(e) : a.value = 1;
85
+ n.value === 1 ? k(e) : n.value = 1;
82
86
  }, Q = (e) => e, v = {
83
- refresh: z,
87
+ refresh: k,
84
88
  reload: Z,
85
- getTableInstance: () => O.value
89
+ getTableInstance: () => T.value
86
90
  }, R = (e, t = []) => ({
87
91
  ...M(e, ["render", "headerRender"].concat(t)),
88
- injectInfo: n.injectInfo || {},
92
+ injectInfo: a.injectInfo || {},
89
93
  exposeInfo: v
90
94
  }), H = (e) => ({
91
95
  ...M(e, ["render", "headerRender"]),
92
- injectInfo: n.injectInfo || {},
96
+ injectInfo: a.injectInfo || {},
93
97
  exposeInfo: v
94
98
  });
95
99
  G(v);
96
100
  const X = (e) => {
97
- i.value = e, a.value = 1;
101
+ o.value = e, n.value = 1;
98
102
  }, K = (e) => !e || e === "expand";
99
103
  return ge(() => {
100
- i.value = n.pageSizeInit, de(() => {
104
+ o.value = a.pageSizeInit, de(() => {
101
105
  v.refresh();
102
106
  });
103
107
  }), g(w, (e) => {
104
- m("dataChange", e);
108
+ c("dataChange", e);
105
109
  }), g(
106
- () => n.query,
110
+ () => a.query,
107
111
  (e, t) => {
108
- JSON.stringify(e) !== JSON.stringify(t) && (a.value = 1);
112
+ JSON.stringify(e) !== JSON.stringify(t) && (n.value = 1);
109
113
  }
110
114
  ), g(
111
115
  y,
112
116
  (e, t) => {
113
- JSON.stringify(e) !== JSON.stringify(t) && k();
117
+ JSON.stringify(e) !== JSON.stringify(t) && N();
114
118
  },
115
119
  {
116
120
  immediate: !0
117
121
  }
118
- ), g(x, (e) => {
119
- m("loadingChange", e);
120
- }), g(i, (e) => {
121
- m("pageSizeChange", e);
122
- }), g(a, (e) => {
123
- m("pageChange", e);
122
+ ), g(I, (e) => {
123
+ c("loadingChange", e);
124
+ }), g(o, (e) => {
125
+ c("pageSizeChange", e);
126
+ }), g(n, (e) => {
127
+ c("pageChange", e);
124
128
  }), (e, t) => {
125
- const l = ae, ee = oe, te = ne, re = ie;
126
- return o(), c("div", Se, [
129
+ const l = ne, ee = oe, te = ae, re = ie;
130
+ return i(), m("div", Se, [
127
131
  L(te, d({
128
132
  ref_key: "elTable",
129
- ref: O,
133
+ ref: T,
130
134
  class: "table-main-table",
131
135
  stripe: "",
132
136
  border: "",
@@ -137,25 +141,25 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
137
141
  rowKey: Q(f.rowKey)
138
142
  }), {
139
143
  empty: S(() => [
140
- u(h) ? (o(), c(E, { key: 0 }, [
141
- T("加载中...")
142
- ], 64)) : (o(), C(ee, { key: 1 }))
144
+ u(h) ? (i(), m(C, { key: 0 }, [
145
+ P("加载中...")
146
+ ], 64)) : (i(), E(ee, { key: 1 }))
143
147
  ]),
144
148
  default: S(() => [
145
- (o(!0), c(E, null, ce(f.columns, (r) => (o(), C(l, d({
149
+ (i(!0), m(C, null, ce(f.columns, (r) => (i(), E(l, d({
146
150
  key: r.columnKey || r.prop
147
151
  }, { ref_for: !0 }, r), me({ _: 2 }, [
148
152
  K(r.type) ? {
149
153
  name: "default",
150
154
  fn: S((s) => [
151
155
  j(e.$slots, r.prop, d({ ref_for: !0 }, R(s)), () => [
152
- r.render ? (o(), C(A(r.render), d({
156
+ r.render ? (i(), E(A(r.render), d({
153
157
  key: 0,
154
158
  ref_for: !0
155
159
  }, R(s, ["$index"]), {
156
160
  _index: s.$index
157
- }), null, 16, ["_index"])) : (o(), c(E, { key: 1 }, [
158
- T(J(s.row[r.prop]), 1)
161
+ }), null, 16, ["_index"])) : (i(), m(C, { key: 1 }, [
162
+ P(J(s.row[r.prop]), 1)
159
163
  ], 64))
160
164
  ], !0)
161
165
  ]),
@@ -165,11 +169,11 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
165
169
  name: "header",
166
170
  fn: S((s) => [
167
171
  j(e.$slots, `header-${r.prop}`, d({ ref_for: !0 }, H(s)), () => [
168
- r.headerRender ? (o(), C(A(r.headerRender), d({
172
+ r.headerRender ? (i(), E(A(r.headerRender), d({
169
173
  key: 0,
170
174
  ref_for: !0
171
- }, H(s)), null, 16)) : (o(), c(E, { key: 1 }, [
172
- T(J(r.label), 1)
175
+ }, H(s)), null, 16)) : (i(), m(C, { key: 1 }, [
176
+ P(J(r.label), 1)
173
177
  ], 64))
174
178
  ], !0)
175
179
  ]),
@@ -179,17 +183,17 @@ const Se = { class: "table-main" }, Ee = { class: "table-main-pagination" }, Ke
179
183
  ]),
180
184
  _: 3
181
185
  }, 16, ["maxHeight", "data", "rowKey"]),
182
- he(ye("div", Ee, [
186
+ he(ye("div", Ce, [
183
187
  L(re, {
184
- "current-page": u(a),
185
- "onUpdate:currentPage": t[0] || (t[0] = (r) => B(a) ? a.value = r : null),
186
- "page-size": u(i),
187
- "onUpdate:pageSize": t[1] || (t[1] = (r) => B(i) ? i.value = r : null),
188
+ "current-page": u(n),
189
+ "onUpdate:currentPage": t[0] || (t[0] = (r) => B(n) ? n.value = r : null),
190
+ "page-size": u(o),
191
+ "onUpdate:pageSize": t[1] || (t[1] = (r) => B(o) ? o.value = r : null),
188
192
  "page-sizes": f.pageSizeOptions,
189
193
  small: "",
190
194
  background: "",
191
195
  layout: f.pageLayout,
192
- total: u(I),
196
+ total: u(x),
193
197
  onSizeChange: X
194
198
  }, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total"])
195
199
  ], 512), [
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-main-table[data-v-173e1cb3]{--el-table-header-bg-color: var(--v2c344d25)}.table-main-pagination[data-v-173e1cb3]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-167d5788]{min-height:var(--v20e95162)}.list-page-operation[data-v-167d5788]{margin-bottom:10px}.list-page[data-v-167d5788] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
1
+ .form-item-tip[data-v-e889a0ed]{text-align:left;line-height:1.5;font-size:12px}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-main-table[data-v-c7f10ff2]{--el-table-header-bg-color: var(--d46c1602)}.table-main-pagination[data-v-c7f10ff2]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-c9564dc7]{min-height:var(--f49642f0)}.list-page-operation[data-v-c9564dc7]{margin-bottom:10px}.list-page[data-v-c9564dc7] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/admin-core",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.1-alpha.1",
4
4
  "description": "后台管理核心",
5
5
  "private": false,
6
6
  "main": "lib/index.cjs",
@@ -26,7 +26,7 @@
26
26
  "predev": "dc-inject",
27
27
  "dev": "vite build -w -m hotBuild",
28
28
  "prebuild": "dc-inject",
29
- "build": "vite build && vue-tsc && vite build",
29
+ "build": "vue-tsc && vite build",
30
30
  "prepack": "pnpm build",
31
31
  "test": "vitest",
32
32
  "coverage": "vitest run --coverage"
@@ -77,5 +77,5 @@
77
77
  "node": ">=18.0.0",
78
78
  "pnpm": ">=9.0.0"
79
79
  },
80
- "gitHead": "b8b80e9c323b5b8e73ac989d41c59e71a09e9779"
80
+ "gitHead": "66c74dcd8e8bb283b06a1a2515f98406fe9b0f13"
81
81
  }
@@ -49,3 +49,6 @@ declare const _default: <PO extends Record<string, any>, SO extends Record<strin
49
49
  __ctx?: Awaited<typeof __VLS_setup>;
50
50
  };
51
51
  export default _default;
52
+ type __VLS_Prettify<T> = {
53
+ [K in keyof T]: T[K];
54
+ } & {};
@@ -149,6 +149,7 @@ export interface FormMainProps<PO extends Record<string, any>, SO extends Record
149
149
  list: FormItemConfigList<PO, SO>;
150
150
  data: PO;
151
151
  layout?: Partial<ColProps>;
152
+ rowGutter?: number;
152
153
  }
153
154
  /** FormSearch props */
154
155
  export interface FormSearchProps<PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>> extends FormMainProps<PO, SO> {
@@ -3,7 +3,14 @@ import { TableMainInstance } from '../table';
3
3
  import { ListPageInnerInjectInfo, ListPageInstance } from './types';
4
4
 
5
5
  declare const _default: <T extends Record<string, any>, PO extends Record<string, any>, SO extends Record<string, any>, SQ extends Record<string, any>, F extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
- props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (Partial<Pick<import('../form').FormSearchProps<PO, SO, {}>, "staticQuery">> & {
6
+ props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
7
+ readonly onDataChange?: ((data: T[]) => any) | undefined;
8
+ readonly onPageInfoChange?: ((info: {
9
+ pageSize: number;
10
+ currentPage: number;
11
+ total: number;
12
+ }) => any) | undefined;
13
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & (Partial<Pick<import('../form').FormSearchProps<PO, SO, {}>, "staticQuery">> & {
7
14
  formSearchProps?: Partial<Omit<import('../form').FormSearchProps<PO, SO, {}>, "list" | "staticQuery">> | undefined;
8
15
  } & Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainRequiredKey> & Partial<Pick<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey>> & {
9
16
  tableMainProps?: Partial<Omit<import('../table').TableMainProps<T, import('../form').ExcludeNeverProperties<import('../form').ExtractFormStringifyRawFromObject<PO, SO>> & SQ, ListPageInnerInjectInfo<PO, F>>, import('./types').TableMainOptionsKey | import('./types').TableMainRewriteKey>> | undefined;
@@ -34,7 +41,14 @@ declare const _default: <T extends Record<string, any>, PO extends Record<string
34
41
  }) => any>> & {
35
42
  operation?(_: {}): any;
36
43
  }>;
37
- emit: typeof __VLS_emit;
44
+ emit: {
45
+ (e: "dataChange", data: T[]): void;
46
+ (e: "pageInfoChange", info: {
47
+ pageSize: number;
48
+ currentPage: number;
49
+ total: number;
50
+ }): void;
51
+ };
38
52
  }>) => import('vue').VNode & {
39
53
  __ctx?: Awaited<typeof __VLS_setup>;
40
54
  };
@@ -30,4 +30,6 @@ SO extends Record<string, any>> {
30
30
  formLayout?: FormMainProps<PO, SO>["layout"];
31
31
  /** elForm其他属性 */
32
32
  formProps?: Partial<FormProps>;
33
+ /** 表单行 gutter,透传给 FormMain */
34
+ formRowGutter?: number;
33
35
  }
@@ -6,6 +6,11 @@ declare const _default: <T extends Record<string, any>, SQ extends Record<string
6
6
  readonly onPageChange?: ((value: number) => any) | undefined;
7
7
  readonly onPageSizeChange?: ((value: number) => any) | undefined;
8
8
  readonly onDataChange?: ((data: T[]) => any) | undefined;
9
+ readonly onPageInfoChange?: ((info: {
10
+ pageSize: number;
11
+ currentPage: number;
12
+ total: number;
13
+ }) => any) | undefined;
9
14
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & TableMainProps<T, SQ, F>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
10
15
  expose(exposed: import('vue').ShallowUnwrapRef<TableMainInstance>): void;
11
16
  attrs: any;
@@ -25,6 +30,11 @@ declare const _default: <T extends Record<string, any>, SQ extends Record<string
25
30
  (e: "pageChange" | "pageSizeChange", value: number): void;
26
31
  (e: "dataChange", data: T[]): void;
27
32
  (e: "loadingChange", value: boolean): void;
33
+ (e: "pageInfoChange", info: {
34
+ pageSize: number;
35
+ currentPage: number;
36
+ total: number;
37
+ }): void;
28
38
  };
29
39
  }>) => import('vue').VNode & {
30
40
  __ctx?: Awaited<typeof __VLS_setup>;