@done-coding/admin-core 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/es/bridge/config-hook.mjs +37 -0
  2. package/es/bridge/index.mjs +157 -62
  3. package/es/bridge/plugin.mjs +29 -0
  4. package/es/bridge/theme.mjs +62 -0
  5. package/es/components/app-layout/AppBody.vue.mjs +1 -1
  6. package/es/components/app-layout/AppBody.vue2.mjs +47 -49
  7. package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
  8. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
  9. package/es/components/app-layout/AppFooter.vue.mjs +2 -2
  10. package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
  11. package/es/components/app-layout/AppHeader.vue.mjs +1 -1
  12. package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
  13. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  14. package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
  17. package/es/components/app-layout/AppTheme.vue.mjs +7 -0
  18. package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
  19. package/es/components/data-view/DataListView.vue.mjs +2 -2
  20. package/es/components/data-view/DataListView.vue2.mjs +36 -36
  21. package/es/components/display/ActionConfirm.vue2.mjs +16 -16
  22. package/es/components/display/HeightProvider.vue.mjs +10 -10
  23. package/es/components/display/TabsHeader.vue.mjs +4 -4
  24. package/es/components/display/TabsHeader.vue2.mjs +34 -34
  25. package/es/components/display/TabsMain.vue.mjs +40 -39
  26. package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
  27. package/es/components/form/FormItem.vue.mjs +1 -1
  28. package/es/components/form/FormItem.vue2.mjs +75 -81
  29. package/es/components/form/FormMain.vue.mjs +81 -88
  30. package/es/components/form/FormRadioGroup.vue.mjs +42 -49
  31. package/es/components/form/FormSearch.vue.mjs +1 -1
  32. package/es/components/form/FormSearch.vue2.mjs +116 -123
  33. package/es/components/form/FormSelect.vue.mjs +34 -40
  34. package/es/components/form/FormSubmitBtn.vue.mjs +24 -35
  35. package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
  36. package/es/components/form/FormSubmitPanel.vue2.mjs +75 -55
  37. package/es/components/form/FormTree.vue.mjs +16 -21
  38. package/es/components/form/FormVerifyCode.vue.mjs +37 -43
  39. package/es/components/form/FormVerifyImage.vue.mjs +2 -2
  40. package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
  41. package/es/components/form/use-form-submit.mjs +21 -0
  42. package/es/components/list-page/ListPage.vue.mjs +2 -2
  43. package/es/components/list-page/ListPage.vue2.mjs +134 -139
  44. package/es/components/menu/MenuItemSub.vue.mjs +41 -48
  45. package/es/components/menu/MenuTree.vue.mjs +58 -65
  46. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  47. package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
  48. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  49. package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
  50. package/es/components/modal/ConfirmModal.vue.mjs +3 -3
  51. package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
  52. package/es/components/modal/DetailModal.vue.mjs +38 -41
  53. package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
  54. package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
  55. package/es/components/panel/PanelMain.vue.mjs +2 -2
  56. package/es/components/panel/PanelMain.vue2.mjs +67 -74
  57. package/es/components/table/TableMain.vue.mjs +2 -2
  58. package/es/components/table/TableMain.vue2.mjs +221 -229
  59. package/es/components/table/TableToolbar.vue.mjs +2 -2
  60. package/es/components/table/TableToolbar.vue2.mjs +115 -126
  61. package/es/hooks/use-admin-theme-apply.mjs +84 -0
  62. package/es/hooks/use-admin-viewport-apply.mjs +27 -0
  63. package/es/index.mjs +125 -117
  64. package/es/inject/key.mjs +7 -4
  65. package/es/store/app.mjs +75 -84
  66. package/es/style.css +1 -1
  67. package/es/utils/theme-scale.mjs +37 -0
  68. package/package.json +2 -4
  69. package/types/bridge/config-hook.d.ts +91 -0
  70. package/types/bridge/index.d.ts +110 -10
  71. package/types/bridge/plugin.d.ts +39 -0
  72. package/types/bridge/theme.d.ts +66 -0
  73. package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
  74. package/types/components/app-layout/types.d.ts +1 -1
  75. package/types/components/form/FormItem.vue.d.ts +12 -12
  76. package/types/components/form/FormSubmitPanel.vue.d.ts +4 -0
  77. package/types/components/form/FormTree.vue.d.ts +50 -50
  78. package/types/components/form/types.d.ts +17 -0
  79. package/types/components/form/use-form-submit.d.ts +25 -0
  80. package/types/components/menu/MenuTree.vue.d.ts +10 -10
  81. package/types/components/modal/ModalShelf.vue.d.ts +1 -1
  82. package/types/components/table/TableMain.vue.d.ts +1 -1
  83. package/types/hooks/activated.d.ts +2 -2
  84. package/types/hooks/feel-size.d.ts +1 -1
  85. package/types/hooks/index.d.ts +2 -0
  86. package/types/hooks/menus-dispatch.d.ts +5 -5
  87. package/types/hooks/use-admin-theme-apply.d.ts +17 -0
  88. package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
  89. package/types/hooks/use-breakpoint.d.ts +1 -1
  90. package/types/inject/key.d.ts +18 -0
  91. package/types/store/app.d.ts +138 -59
  92. package/types/store/user.d.ts +3 -3
  93. package/types/utils/index.d.ts +1 -0
  94. package/types/utils/theme-scale.d.ts +35 -0
@@ -1,15 +1,11 @@
1
- import { ElPopover as M, ElInputNumber as R, ElSwitch as y } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/popover/style/css";
4
- import "element-plus/es/components/input-number/style/css";
5
- import "element-plus/es/components/switch/style/css";
6
- import { defineComponent as B, useModel as d, computed as N, watch as g, openBlock as x, createBlock as P, withCtx as f, createElementVNode as p, createVNode as v, unref as h, mergeModels as T } from "vue";
1
+ import { defineComponent as M, useModel as f, computed as R, watch as w, openBlock as y, createBlock as B, unref as t, withCtx as v, createElementVNode as p, createVNode as h, mergeModels as E } from "vue";
2
+ import { ElPopover as g, ElInputNumber as x, ElSwitch as N } from "element-plus";
7
3
  import { Refresh as V } from "@element-plus/icons-vue";
8
- import { useTimeout as k } from "../../hooks/timeout.mjs";
9
- import { useActivated as A } from "../../hooks/activated.mjs";
10
- const C = { class: "auto-refresh" }, H = /* @__PURE__ */ B({
4
+ import { useTimeout as T } from "../../hooks/timeout.mjs";
5
+ import { useActivated as k } from "../../hooks/activated.mjs";
6
+ const A = { class: "auto-refresh" }, I = /* @__PURE__ */ M({
11
7
  __name: "AutoRefresh",
12
- props: /* @__PURE__ */ T({
8
+ props: /* @__PURE__ */ E({
13
9
  refreshFn: {},
14
10
  disabled: { type: Boolean }
15
11
  }, {
@@ -20,52 +16,49 @@ const C = { class: "auto-refresh" }, H = /* @__PURE__ */ B({
20
16
  }),
21
17
  emits: ["update:modelValue", "update:interval"],
22
18
  setup(r) {
23
- const u = r, a = d(r, "modelValue"), t = d(r, "interval"), n = N(() => a.value && !u.disabled), [E, m] = k();
19
+ const d = r, i = f(r, "modelValue"), l = f(r, "interval"), n = R(() => i.value && !d.disabled), [b, m] = T();
24
20
  let o = null;
25
- const c = () => (o || (o = u.refreshFn().catch(() => {
21
+ const c = () => (o || (o = d.refreshFn().catch(() => {
26
22
  }).finally(() => {
27
23
  o = null;
28
- })), o), i = () => {
29
- E(async () => {
30
- await c(), n.value && i();
31
- }, t.value * 1e3);
32
- };
33
- return g([n, t], ([l]) => {
34
- l ? i() : m();
35
- }), A(({ isActivated: l, triggerType: e }) => {
36
- l && n.value && (e === "activated" && (m(), c()), i());
37
- }), (l, e) => {
38
- const b = y, _ = R, w = M;
39
- return x(), P(w, {
40
- trigger: "hover",
41
- placement: "bottom-start"
42
- }, {
43
- reference: f(() => [
44
- v(b, {
45
- modelValue: a.value,
46
- "onUpdate:modelValue": e[0] || (e[0] = (s) => a.value = s),
47
- "active-action-icon": h(V),
48
- "inactive-action-icon": h(V)
49
- }, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"])
50
- ]),
51
- default: f(() => [
52
- p("div", C, [
53
- e[2] || (e[2] = p("div", { class: "auto-refresh-label" }, "自动刷新间隔(秒)", -1)),
54
- v(_, {
55
- modelValue: t.value,
56
- "onUpdate:modelValue": e[1] || (e[1] = (s) => t.value = s),
57
- min: 1,
58
- step: 1,
59
- size: "small",
60
- class: "auto-refresh-interval"
61
- }, null, 8, ["modelValue"])
62
- ])
63
- ]),
64
- _: 1
65
- });
24
+ })), o), s = () => {
25
+ b(async () => {
26
+ await c(), n.value && s();
27
+ }, l.value * 1e3);
66
28
  };
29
+ return w([n, l], ([a]) => {
30
+ a ? s() : m();
31
+ }), k(({ isActivated: a, triggerType: e }) => {
32
+ a && n.value && (e === "activated" && (m(), c()), s());
33
+ }), (a, e) => (y(), B(t(g), {
34
+ trigger: "hover",
35
+ placement: "bottom-start"
36
+ }, {
37
+ reference: v(() => [
38
+ h(t(N), {
39
+ modelValue: i.value,
40
+ "onUpdate:modelValue": e[0] || (e[0] = (u) => i.value = u),
41
+ "active-action-icon": t(V),
42
+ "inactive-action-icon": t(V)
43
+ }, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"])
44
+ ]),
45
+ default: v(() => [
46
+ p("div", A, [
47
+ e[2] || (e[2] = p("div", { class: "auto-refresh-label" }, "自动刷新间隔(秒)", -1)),
48
+ h(t(x), {
49
+ modelValue: l.value,
50
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => l.value = u),
51
+ min: 1,
52
+ step: 1,
53
+ size: "small",
54
+ class: "auto-refresh-interval"
55
+ }, null, 8, ["modelValue"])
56
+ ])
57
+ ]),
58
+ _: 1
59
+ }));
67
60
  }
68
61
  });
69
62
  export {
70
- H as default
63
+ I as default
71
64
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AutoRefreshGroup.vue2.mjs";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9cac8b09"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e608ff06"]]);
5
5
  export {
6
- c as default
6
+ p as default
7
7
  };
@@ -1,13 +1,10 @@
1
- import { ElButton as h, ElIcon as c } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/button/style/css";
4
- import "element-plus/es/components/icon/style/css";
5
- import { defineComponent as v, useModel as s, openBlock as r, createElementBlock as R, Fragment as p, createBlock as a, createCommentVNode as u, withCtx as i, createVNode as f, normalizeClass as A, unref as B, mergeModels as g } from "vue";
6
- import k from "./AutoRefresh.vue.mjs";
7
- import { Refresh as y } from "@element-plus/icons-vue";
8
- const b = /* @__PURE__ */ v({
1
+ import { defineComponent as m, useModel as s, openBlock as o, createElementBlock as h, Fragment as v, createBlock as u, createCommentVNode as i, unref as l, withCtx as f, createVNode as d, normalizeClass as R, mergeModels as c } from "vue";
2
+ import A from "./AutoRefresh.vue.mjs";
3
+ import { ElButton as B, ElIcon as g } from "element-plus";
4
+ import { Refresh as k } from "@element-plus/icons-vue";
5
+ const V = /* @__PURE__ */ m({
9
6
  __name: "AutoRefreshGroup",
10
- props: /* @__PURE__ */ g({
7
+ props: /* @__PURE__ */ c({
11
8
  showAutoRefresh: { type: Boolean, default: !0 },
12
9
  showRefresh: { type: Boolean, default: !0 },
13
10
  loading: { type: Boolean },
@@ -20,41 +17,38 @@ const b = /* @__PURE__ */ v({
20
17
  }),
21
18
  emits: ["update:isAutoRefresh", "update:interval"],
22
19
  setup(e) {
23
- const l = s(e, "isAutoRefresh"), n = s(e, "interval");
24
- return (F, t) => {
25
- const d = c, m = h;
26
- return r(), R(p, null, [
27
- e.showAutoRefresh ? (r(), a(k, {
28
- key: 0,
29
- modelValue: l.value,
30
- "onUpdate:modelValue": t[0] || (t[0] = (o) => l.value = o),
31
- interval: n.value,
32
- "onUpdate:interval": t[1] || (t[1] = (o) => n.value = o),
33
- refreshFn: e.refreshFn,
34
- disabled: e.loading
35
- }, null, 8, ["modelValue", "interval", "refreshFn", "disabled"])) : u("", !0),
36
- e.showRefresh ? (r(), a(m, {
37
- key: 1,
38
- size: "small",
39
- circle: "",
40
- onClick: t[2] || (t[2] = (o) => e.refreshFn())
41
- }, {
42
- default: i(() => [
43
- f(d, {
44
- class: A({ "auto-refresh-group-icon--rotating": e.loading })
45
- }, {
46
- default: i(() => [
47
- f(B(y))
48
- ]),
49
- _: 1
50
- }, 8, ["class"])
51
- ]),
52
- _: 1
53
- })) : u("", !0)
54
- ], 64);
55
- };
20
+ const n = s(e, "isAutoRefresh"), a = s(e, "interval");
21
+ return (p, t) => (o(), h(v, null, [
22
+ e.showAutoRefresh ? (o(), u(A, {
23
+ key: 0,
24
+ modelValue: n.value,
25
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => n.value = r),
26
+ interval: a.value,
27
+ "onUpdate:interval": t[1] || (t[1] = (r) => a.value = r),
28
+ refreshFn: e.refreshFn,
29
+ disabled: e.loading
30
+ }, null, 8, ["modelValue", "interval", "refreshFn", "disabled"])) : i("", !0),
31
+ e.showRefresh ? (o(), u(l(B), {
32
+ key: 1,
33
+ size: "small",
34
+ circle: "",
35
+ onClick: t[2] || (t[2] = (r) => e.refreshFn())
36
+ }, {
37
+ default: f(() => [
38
+ d(l(g), {
39
+ class: R({ "auto-refresh-group-icon--rotating": e.loading })
40
+ }, {
41
+ default: f(() => [
42
+ d(l(k))
43
+ ]),
44
+ _: 1
45
+ }, 8, ["class"])
46
+ ]),
47
+ _: 1
48
+ })) : i("", !0)
49
+ ], 64));
56
50
  }
57
51
  });
58
52
  export {
59
- b as default
53
+ V as default
60
54
  };
@@ -1,8 +1,8 @@
1
1
  import o from "./ConfirmModal.vue2.mjs";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import t from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8a29e4c8"]]);
4
+ import r from "../../_virtual/_plugin-vue_export-helper.mjs";
5
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0e89245a"]]);
6
6
  export {
7
- a as default
7
+ f as default
8
8
  };
@@ -1,11 +1,7 @@
1
- import { ElDialog as N, ElButton as O, ElIcon as S } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/dialog/style/css";
4
- import "element-plus/es/components/icon/style/css";
5
- import "element-plus/es/components/button/style/css";
6
- import { defineComponent as V, ref as $, computed as F, openBlock as l, createBlock as i, withCtx as d, createElementVNode as c, renderSlot as u, resolveDynamicComponent as w, createElementBlock as m, Fragment as B, createTextVNode as r, toDisplayString as f, unref as y, createCommentVNode as x, createVNode as C } from "vue";
7
- import { Close as L } from "@element-plus/icons-vue";
8
- const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z = { class: "content" }, A = ["reverse"], W = /* @__PURE__ */ V({
1
+ import { defineComponent as H, ref as N, computed as O, openBlock as l, createBlock as d, unref as a, withCtx as r, createElementVNode as c, renderSlot as m, resolveDynamicComponent as k, createElementBlock as y, Fragment as w, createTextVNode as f, toDisplayString as u, createCommentVNode as B, createVNode as C } from "vue";
2
+ import { ElDialog as S, ElButton as x, ElIcon as V } from "element-plus";
3
+ import { Close as $ } from "@element-plus/icons-vue";
4
+ const D = { class: "main" }, F = { class: "shim" }, L = { class: "title" }, M = { class: "content" }, P = ["reverse"], q = /* @__PURE__ */ H({
9
5
  inheritAttrs: !1,
10
6
  __name: "ConfirmModal",
11
7
  props: {
@@ -27,116 +23,113 @@ const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z =
27
23
  type: { default: "primary" }
28
24
  },
29
25
  emits: ["update:show"],
30
- setup(e, { emit: E }) {
31
- const o = e, T = E, a = $(!1), h = F(() => o.useLoading && a.value), s = (n) => {
26
+ setup(e, { emit: T }) {
27
+ const o = e, b = T, s = N(!1), h = O(() => o.useLoading && s.value), i = (n) => {
32
28
  var t;
33
- console.log("close", n), T("update:show", !1), (t = o.onClose) == null || t.call(o, n);
34
- }, g = async () => {
29
+ console.log("close", n), b("update:show", !1), (t = o.onClose) == null || t.call(o, n);
30
+ }, v = async () => {
35
31
  var t;
36
32
  if (await ((t = o.onCancel) == null ? void 0 : t.call(o)) === !1) {
37
33
  console.log("确认弹窗 onCancel 返回false,不关闭弹窗");
38
34
  return;
39
35
  }
40
- s(!1);
41
- }, v = async () => {
36
+ i(!1);
37
+ }, g = async () => {
42
38
  var n;
43
- a.value = !0;
39
+ s.value = !0;
44
40
  try {
45
41
  const t = await ((n = o.onConfirm) == null ? void 0 : n.call(o));
46
- if (a.value = !1, t === !1) {
42
+ if (s.value = !1, t === !1) {
47
43
  console.log("确认弹窗 onConfirm 返回false,不关闭弹窗");
48
44
  return;
49
45
  }
50
- s(!0);
46
+ i(!0);
51
47
  } catch {
52
- a.value = !1;
48
+ s.value = !1;
53
49
  }
54
- }, b = () => {
55
- console.log("closeHandler"), s(!1);
50
+ }, E = () => {
51
+ console.log("closeHandler"), i(!1);
56
52
  };
57
- return (n, t) => {
58
- const k = O, H = S, D = N;
59
- return l(), i(D, {
60
- "model-value": e.show,
61
- class: "confirm-dialog",
62
- width: e.width,
63
- "show-close": !1,
64
- "append-to-body": "",
65
- "align-center": "",
66
- "close-on-click-modal": e.closeOnClickModal,
67
- "close-on-press-escape": e.closeOnPressEscape,
68
- onClose: b
69
- }, {
70
- default: d(() => [
71
- c("div", M, [
72
- c("div", I, [
73
- c("div", P, [
74
- u(n.$slots, "title", {}, () => [
75
- typeof e.title == "function" ? (l(), i(w(e.title), { key: 0 })) : (l(), m(B, { key: 1 }, [
76
- r(f(e.title), 1)
77
- ], 64))
78
- ], !0)
79
- ]),
80
- c("div", z, [
81
- u(n.$slots, "default", {}, () => [
82
- typeof e.content == "function" ? (l(), i(w(e.content), { key: 0 })) : (l(), m(B, { key: 1 }, [
83
- r(f(e.content), 1)
84
- ], 64))
85
- ], !0)
86
- ]),
87
- c("div", {
88
- class: "footer",
89
- reverse: e.reverse
90
- }, [
91
- u(n.$slots, "footer", {
92
- cancelHandler: g,
93
- confirmHandler: v,
94
- loading: y(h)
95
- }, () => [
96
- e.hiddenCancel ? x("", !0) : (l(), i(k, {
97
- key: 0,
98
- class: "btn cancel-btn",
99
- btnHover: "",
100
- onClick: g
101
- }, {
102
- default: d(() => [
103
- r(f(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
104
- ]),
105
- _: 1
106
- })),
107
- C(k, {
108
- type: e.type,
109
- class: "btn confirm-btn",
110
- loading: y(h),
111
- onClick: v
112
- }, {
113
- default: d(() => [
114
- r(f(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
115
- ]),
116
- _: 1
117
- }, 8, ["type", "loading"])
118
- ], !0)
119
- ], 8, A)
53
+ return (n, t) => (l(), d(a(S), {
54
+ "model-value": e.show,
55
+ class: "confirm-dialog",
56
+ width: e.width,
57
+ "show-close": !1,
58
+ "append-to-body": "",
59
+ "align-center": "",
60
+ "close-on-click-modal": e.closeOnClickModal,
61
+ "close-on-press-escape": e.closeOnPressEscape,
62
+ onClose: E
63
+ }, {
64
+ default: r(() => [
65
+ c("div", D, [
66
+ c("div", F, [
67
+ c("div", L, [
68
+ m(n.$slots, "title", {}, () => [
69
+ typeof e.title == "function" ? (l(), d(k(e.title), { key: 0 })) : (l(), y(w, { key: 1 }, [
70
+ f(u(e.title), 1)
71
+ ], 64))
72
+ ], !0)
73
+ ]),
74
+ c("div", M, [
75
+ m(n.$slots, "default", {}, () => [
76
+ typeof e.content == "function" ? (l(), d(k(e.content), { key: 0 })) : (l(), y(w, { key: 1 }, [
77
+ f(u(e.content), 1)
78
+ ], 64))
79
+ ], !0)
120
80
  ]),
121
- e.showClose ? (l(), m("div", {
122
- key: 0,
123
- class: "close-box",
124
- onClick: t[0] || (t[0] = (j) => s())
81
+ c("div", {
82
+ class: "footer",
83
+ reverse: e.reverse
125
84
  }, [
126
- C(H, { size: 22 }, {
127
- default: d(() => [
128
- C(y(L))
129
- ]),
130
- _: 1
131
- })
132
- ])) : x("", !0)
133
- ])
134
- ]),
135
- _: 3
136
- }, 8, ["model-value", "width", "close-on-click-modal", "close-on-press-escape"]);
137
- };
85
+ m(n.$slots, "footer", {
86
+ cancelHandler: v,
87
+ confirmHandler: g,
88
+ loading: h.value
89
+ }, () => [
90
+ e.hiddenCancel ? B("", !0) : (l(), d(a(x), {
91
+ key: 0,
92
+ class: "btn cancel-btn",
93
+ btnHover: "",
94
+ onClick: v
95
+ }, {
96
+ default: r(() => [
97
+ f(u(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
98
+ ]),
99
+ _: 1
100
+ })),
101
+ C(a(x), {
102
+ type: e.type,
103
+ class: "btn confirm-btn",
104
+ loading: h.value,
105
+ onClick: g
106
+ }, {
107
+ default: r(() => [
108
+ f(u(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
109
+ ]),
110
+ _: 1
111
+ }, 8, ["type", "loading"])
112
+ ], !0)
113
+ ], 8, P)
114
+ ]),
115
+ e.showClose ? (l(), y("div", {
116
+ key: 0,
117
+ class: "close-box",
118
+ onClick: t[0] || (t[0] = (z) => i())
119
+ }, [
120
+ C(a(V), { size: 22 }, {
121
+ default: r(() => [
122
+ C(a($))
123
+ ]),
124
+ _: 1
125
+ })
126
+ ])) : B("", !0)
127
+ ])
128
+ ]),
129
+ _: 3
130
+ }, 8, ["model-value", "width", "close-on-click-modal", "close-on-press-escape"]));
138
131
  }
139
132
  });
140
133
  export {
141
- W as default
134
+ q as default
142
135
  };
@@ -1,8 +1,8 @@
1
- import y from "./ConfirmModal.vue.mjs";
2
- import p from "../form/FormMain.vue.mjs";
3
- import { defineComponent as g, ref as b, computed as r, watch as A, openBlock as W, createBlock as C, unref as s, withCtx as M, createVNode as D, mergeProps as _ } from "vue";
4
- import { stringifyFormData as k } from "../form/utils.mjs";
5
- const L = /* @__PURE__ */ g({
1
+ import { defineComponent as w, ref as y, computed as n, watch as g, openBlock as b, createBlock as p, withCtx as A, createVNode as W, unref as v, mergeProps as C } from "vue";
2
+ import D from "../form/FormMain.vue.mjs";
3
+ import { stringifyFormData as M } from "../form/utils.mjs";
4
+ import k from "./ConfirmModal.vue.mjs";
5
+ const $ = /* @__PURE__ */ w({
6
6
  __name: "DetailModal",
7
7
  props: {
8
8
  data: {},
@@ -20,51 +20,48 @@ const L = /* @__PURE__ */ g({
20
20
  },
21
21
  emits: ["update:show", "afterAdd", "afterEdit"],
22
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 = () => {
23
+ const t = a, i = f, l = y(), s = n(() => t.data), u = n(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), m = (o) => {
24
+ i("update:show", o);
25
+ }, c = () => {
26
26
  var o;
27
- return (o = d.value) == null ? void 0 : o.validate().then(async () => {
28
- var i, n;
29
- const e = k(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));
27
+ return (o = l.value) == null ? void 0 : o.validate().then(async () => {
28
+ var d, r;
29
+ const e = M(t.data, t.list);
30
+ console.log("confirm", e), t.type === "add" ? (await ((d = t.addApi) == null ? void 0 : d.call(t, e)), i("afterAdd", e)) : (await ((r = t.editApi) == null ? void 0 : r.call(t, e)), i("afterEdit", e));
31
31
  });
32
- }, w = () => {
32
+ }, h = () => {
33
33
  console.log("cancel");
34
34
  };
35
- return A(
35
+ return g(
36
36
  () => t.show,
37
37
  (o) => {
38
38
  var e;
39
- o || (e = d.value) == null || e.clearValidate();
39
+ o || (e = l.value) == null || e.clearValidate();
40
40
  }
41
- ), (o, e) => {
42
- const i = p, n = y;
43
- return W(), C(n, {
44
- title: s(c),
45
- show: a.show,
46
- onConfirm: h,
47
- onCancel: w,
48
- useLoading: "",
49
- width: a.modalWidth,
50
- "onUpdate:show": u
51
- }, {
52
- default: M(() => [
53
- D(i, _({
54
- ref_key: "formMain",
55
- ref: d,
56
- list: a.list,
57
- data: s(m),
58
- layout: a.formLayout,
59
- labelWidth: a.labelWidth,
60
- "row-gutter": a.formRowGutter
61
- }, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
62
- ]),
63
- _: 1
64
- }, 8, ["title", "show", "width"]);
65
- };
41
+ ), (o, e) => (b(), p(k, {
42
+ title: u.value,
43
+ show: a.show,
44
+ onConfirm: c,
45
+ onCancel: h,
46
+ useLoading: "",
47
+ width: a.modalWidth,
48
+ "onUpdate:show": m
49
+ }, {
50
+ default: A(() => [
51
+ W(v(D), C({
52
+ ref_key: "formMain",
53
+ ref: l,
54
+ list: a.list,
55
+ data: s.value,
56
+ layout: a.formLayout,
57
+ labelWidth: a.labelWidth,
58
+ "row-gutter": a.formRowGutter
59
+ }, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
60
+ ]),
61
+ _: 1
62
+ }, 8, ["title", "show", "width"]));
66
63
  }
67
64
  });
68
65
  export {
69
- L as default
66
+ $ as default
70
67
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./PanelEditSwitch.vue2.mjs";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-7bb14fd1"]]);
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-65f056ab"]]);
5
5
  export {
6
6
  i as default
7
7
  };