@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,14 +1,10 @@
1
- import { ElRadioGroup as E, ElRadioButton as h, ElRadio as y } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/radio-group/style/css";
4
- import "element-plus/es/components/radio/style/css";
5
- import "element-plus/es/components/radio-button/style/css";
6
- import { defineComponent as B, useModel as V, computed as G, watch as _, openBlock as a, createBlock as d, unref as g, withCtx as n, createElementBlock as m, Fragment as s, renderList as c, createTextVNode as p, toDisplayString as v, createCommentVNode as x, mergeModels as M } from "vue";
7
- const D = /* @__PURE__ */ B({
1
+ import { defineComponent as k, useModel as h, computed as y, watch as V, openBlock as t, createBlock as d, unref as r, withCtx as n, createElementBlock as m, Fragment as v, renderList as c, createTextVNode as p, toDisplayString as f, createCommentVNode as B, mergeModels as R } from "vue";
2
+ import { ElRadioGroup as g, ElRadioButton as x, ElRadio as E } from "element-plus";
3
+ const N = /* @__PURE__ */ k({
8
4
  name: "FormRadioGroup",
9
5
  inheritAttrs: !0,
10
6
  __name: "FormRadioGroup",
11
- props: /* @__PURE__ */ M({
7
+ props: /* @__PURE__ */ R({
12
8
  options: {},
13
9
  mode: { default: "radio" },
14
10
  notNull: { type: Boolean, default: !0 }
@@ -17,57 +13,54 @@ const D = /* @__PURE__ */ B({
17
13
  modelModifiers: {}
18
14
  }),
19
15
  emits: ["update:modelValue"],
20
- setup(t) {
21
- const u = t, l = V(t, "modelValue"), r = G(() => {
16
+ setup(l) {
17
+ const u = l, a = h(l, "modelValue"), i = y(() => {
22
18
  if (u.notNull && u.options.length > 0) {
23
19
  const o = u.options.some(
24
- (i) => i.value === l.value
20
+ (s) => s.value === a.value
25
21
  );
26
- if (l.value === void 0 || !o)
22
+ if (a.value === void 0 || !o)
27
23
  return u.options[0].value;
28
24
  }
29
- return l.value;
30
- }), f = (o) => {
31
- l.value = o;
25
+ return a.value;
26
+ }), b = (o) => {
27
+ a.value = o;
32
28
  };
33
- return _(
34
- r,
29
+ return V(
30
+ i,
35
31
  (o) => {
36
- o !== void 0 && o !== l.value && (l.value = o);
32
+ o !== void 0 && o !== a.value && (a.value = o);
37
33
  },
38
34
  { immediate: !0 }
39
- ), (o, i) => {
40
- const b = h, R = y, k = E;
41
- return a(), d(k, {
42
- "model-value": g(r),
43
- "onUpdate:modelValue": f
44
- }, {
45
- default: n(() => [
46
- t.mode === "buttonGroup" ? (a(!0), m(s, { key: 0 }, c(t.options, (e) => (a(), d(b, {
47
- key: e.value,
48
- value: e.value,
49
- disabled: e.disabled
50
- }, {
51
- default: n(() => [
52
- p(v(e.label), 1)
53
- ]),
54
- _: 2
55
- }, 1032, ["value", "disabled"]))), 128)) : t.mode === "radio" ? (a(!0), m(s, { key: 1 }, c(t.options, (e) => (a(), d(R, {
56
- key: e.value,
57
- value: e.value,
58
- disabled: e.disabled
59
- }, {
60
- default: n(() => [
61
- p(v(e.label), 1)
62
- ]),
63
- _: 2
64
- }, 1032, ["value", "disabled"]))), 128)) : x("", !0)
65
- ]),
66
- _: 1
67
- }, 8, ["model-value"]);
68
- };
35
+ ), (o, s) => (t(), d(r(g), {
36
+ "model-value": i.value,
37
+ "onUpdate:modelValue": b
38
+ }, {
39
+ default: n(() => [
40
+ l.mode === "buttonGroup" ? (t(!0), m(v, { key: 0 }, c(l.options, (e) => (t(), d(r(x), {
41
+ key: e.value,
42
+ value: e.value,
43
+ disabled: e.disabled
44
+ }, {
45
+ default: n(() => [
46
+ p(f(e.label), 1)
47
+ ]),
48
+ _: 2
49
+ }, 1032, ["value", "disabled"]))), 128)) : l.mode === "radio" ? (t(!0), m(v, { key: 1 }, c(l.options, (e) => (t(), d(r(E), {
50
+ key: e.value,
51
+ value: e.value,
52
+ disabled: e.disabled
53
+ }, {
54
+ default: n(() => [
55
+ p(f(e.label), 1)
56
+ ]),
57
+ _: 2
58
+ }, 1032, ["value", "disabled"]))), 128)) : B("", !0)
59
+ ]),
60
+ _: 1
61
+ }, 8, ["model-value"]));
69
62
  }
70
63
  });
71
64
  export {
72
- D as default
65
+ N as default
73
66
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormSearch.vue2.mjs";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d240f220"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-72f1475d"]]);
5
5
  export {
6
6
  f as default
7
7
  };
@@ -1,16 +1,12 @@
1
- import L from "./FormMain.vue.mjs";
2
- import { ElCol as T, ElButton as H, ElIcon as U } from "element-plus/es";
3
- import "element-plus/es/components/base/style/css";
4
- import "element-plus/es/components/col/style/css";
5
- import "element-plus/es/components/button/style/css";
6
- import "element-plus/es/components/icon/style/css";
7
- import { defineComponent as j, useAttrs as q, ref as k, computed as l, shallowRef as J, openBlock as f, createBlock as p, normalizeClass as K, unref as r, withCtx as a, withDirectives as O, createVNode as m, mergeProps as X, createSlots as Y, normalizeProps as R, guardReactiveProps as S, createElementVNode as Z, createTextVNode as y, toDisplayString as ee, createCommentVNode as te, renderList as oe, renderSlot as re, vShow as ae } from "vue";
8
- import { stringifyFormData as ne } from "./utils.mjs";
9
- import { getCurrentSpan as se, computeButtonColProps as le, computeItemsPerRow as ie } from "./form-search-utils.mjs";
10
- import { ArrowDown as ue, ArrowUp as me } from "@element-plus/icons-vue";
11
- import ce from "../display/WatchSize.vue.mjs";
12
- import { useBreakpoint as de } from "../../hooks/use-breakpoint.mjs";
13
- const fe = { class: "btn-box" }, Pe = /* @__PURE__ */ j({
1
+ import { defineComponent as z, useAttrs as G, ref as x, computed as i, shallowRef as L, openBlock as d, createBlock as f, normalizeClass as T, withCtx as a, withDirectives as _, createVNode as m, mergeProps as H, unref as s, createSlots as U, normalizeProps as k, guardReactiveProps as R, createElementVNode as j, createTextVNode as w, toDisplayString as q, createCommentVNode as J, renderList as K, renderSlot as O, vShow as X } from "vue";
2
+ import { stringifyFormData as Y } from "./utils.mjs";
3
+ import { getCurrentSpan as Z, computeButtonColProps as ee, computeItemsPerRow as te } from "./form-search-utils.mjs";
4
+ import { ElCol as oe, ElButton as g, ElIcon as re } from "element-plus";
5
+ import { ArrowDown as ae, ArrowUp as se } from "@element-plus/icons-vue";
6
+ import le from "./FormMain.vue.mjs";
7
+ import ne from "../display/WatchSize.vue.mjs";
8
+ import { useBreakpoint as ie } from "../../hooks/use-breakpoint.mjs";
9
+ const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
14
10
  name: "FormSearch",
15
11
  inheritAttrs: !1,
16
12
  __name: "FormSearch",
@@ -31,148 +27,145 @@ const fe = { class: "btn-box" }, Pe = /* @__PURE__ */ j({
31
27
  rowGutter: {}
32
28
  },
33
29
  emits: ["search", "heightChange", "visibleChange"],
34
- setup(i, { expose: P, emit: _ }) {
35
- const o = i, c = _, E = q(), h = k(!1), { activeBreakpoint: F } = de(), n = k(!0), B = l(() => o.data), v = l(() => {
30
+ setup(u, { expose: S, emit: P }) {
31
+ const o = u, c = P, F = G(), h = x(!1), { activeBreakpoint: B } = ie(), l = x(!0), V = i(() => o.data), v = i(() => {
36
32
  if (o.maxRows <= 0) return 1 / 0;
37
- const e = se(o.layout, F.value), t = ie(e), u = t > 1 ? 1 : 0;
38
- return Math.max(0, o.maxRows * t - u);
39
- }), M = l(() => o.maxRows <= 0 ? !1 : o.list.filter(
33
+ const e = Z(o.layout, B.value), t = te(e), r = t > 1 ? 1 : 0;
34
+ return Math.max(0, o.maxRows * t - r);
35
+ }), E = i(() => o.maxRows <= 0 ? !1 : o.list.filter(
40
36
  (t) => t.hide !== !0
41
- ).length > v.value), V = l(() => {
37
+ ).length > v.value), M = i(() => {
42
38
  let e = 0;
43
39
  for (let t = 0; t < o.list.length; t++)
44
- o.list[t].hide !== !0 && (n.value && o.maxRows > 0 && t >= v.value || e++);
40
+ o.list[t].hide !== !0 && (l.value && o.maxRows > 0 && t >= v.value || e++);
45
41
  return e;
46
- }), I = l(() => le(o.layout, V.value)), D = l(() => {
47
- if (!n.value || o.maxRows <= 0)
42
+ }), D = i(() => ee(o.layout, M.value)), I = i(() => {
43
+ if (!l.value || o.maxRows <= 0)
48
44
  return o.list;
49
45
  const e = v.value;
50
46
  return o.list.map(
51
- (t, u) => u >= e ? { ...t, hide: !0 } : t
47
+ (t, r) => r >= e ? { ...t, hide: !0 } : t
52
48
  );
53
- }), C = (e = !n.value) => {
54
- n.value = e;
49
+ }), y = (e = !l.value) => {
50
+ l.value = e;
55
51
  }, $ = (e) => {
56
52
  c("heightChange", e);
57
- }, s = J(), b = (e) => ({
53
+ }, n = L(), b = (e) => ({
58
54
  ...o.staticQuery || {},
59
- ...ne(e, o.list)
60
- }), x = () => {
55
+ ...Y(e, o.list)
56
+ }), C = () => {
61
57
  var e;
62
- (e = s.value) == null || e.resetFields(), c("search", b(o.data), "reset");
63
- }, w = (e = "search") => {
58
+ (e = n.value) == null || e.resetFields(), c("search", b(o.data), "reset");
59
+ }, p = (e = "search") => {
64
60
  var t;
65
- (t = s.value) == null || t.validate().then(() => {
61
+ (t = n.value) == null || t.validate().then(() => {
66
62
  c("search", b(o.data), e);
67
63
  });
68
64
  }, A = (e) => {
69
- w(e);
65
+ p(e);
70
66
  }, N = {
71
67
  validate: () => {
72
- if (s.value)
73
- return s.value.validate();
68
+ if (n.value)
69
+ return n.value.validate();
74
70
  throw new Error("实例化未完成");
75
71
  },
76
72
  resetFields: () => {
77
73
  var e;
78
- return (e = s.value) == null ? void 0 : e.resetFields();
74
+ return (e = n.value) == null ? void 0 : e.resetFields();
79
75
  },
80
76
  clearValidate: (e) => {
81
77
  var t;
82
- return (t = s.value) == null ? void 0 : t.clearValidate(e);
78
+ return (t = n.value) == null ? void 0 : t.clearValidate(e);
83
79
  },
84
- triggerReset: x,
85
- triggerSearch: () => w(),
86
- toggleCollapse: C,
87
- isCollapsed: l(() => n.value)
80
+ triggerReset: C,
81
+ triggerSearch: () => p(),
82
+ toggleCollapse: y,
83
+ isCollapsed: i(() => l.value)
88
84
  };
89
- P(N);
85
+ S(N);
90
86
  const W = (e) => {
91
87
  h.value = e, c("visibleChange", e);
92
88
  };
93
- return (e, t) => {
94
- const u = U, g = H, Q = T, z = L;
95
- return f(), p(ce, {
96
- class: K(["form-search", {
97
- "form-search_show": r(h)
98
- }]),
99
- onHeightChange: $
100
- }, {
101
- default: a(() => [
102
- O(m(z, X({
103
- ref_key: "formMain",
104
- ref: s,
105
- list: r(D),
106
- data: r(B),
107
- "row-gutter": i.rowGutter
108
- }, r(E), {
109
- layout: i.layout,
110
- labelPosition: i.labelPosition,
111
- labelWidth: i.labelWidth,
112
- onSubmit: A,
113
- onVisibleChange: W
114
- }), Y({
115
- default: a(() => [
116
- m(Q, R(S(r(I))), {
117
- default: a(() => [
118
- Z("div", fe, [
119
- r(M) ? (f(), p(g, {
120
- key: 0,
121
- type: "primary",
122
- link: "",
123
- onMousedown: t[0] || (t[0] = (d) => C())
124
- }, {
125
- default: a(() => [
126
- m(u, { class: "btn-box-expand-icon" }, {
127
- default: a(() => [
128
- r(n) ? (f(), p(r(ue), { key: 0 })) : (f(), p(r(me), { key: 1 }))
129
- ]),
130
- _: 1
131
- }),
132
- y(" " + ee(r(n) ? "展开更多" : "收起更多"), 1)
133
- ]),
134
- _: 1
135
- })) : te("", !0),
136
- m(g, {
137
- type: "warning",
138
- onMousedown: x
139
- }, {
140
- default: a(() => [...t[2] || (t[2] = [
141
- y("重置", -1)
142
- ])]),
143
- _: 1
144
- }),
145
- m(g, {
146
- type: "primary",
147
- onMousedown: t[1] || (t[1] = (d) => w())
148
- }, {
149
- default: a(() => [...t[3] || (t[3] = [
150
- y("查询", -1)
151
- ])]),
152
- _: 1
153
- })
154
- ])
155
- ]),
156
- _: 1
157
- }, 16)
158
- ]),
159
- _: 2
160
- }, [
161
- oe(i.list, (d) => ({
162
- name: d.key,
163
- fn: a((G) => [
164
- re(e.$slots, d.key, R(S(G)), void 0, !0)
165
- ])
166
- }))
167
- ]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]), [
168
- [ae, r(h)]
169
- ])
170
- ]),
171
- _: 3
172
- }, 8, ["class"]);
173
- };
89
+ return (e, t) => (d(), f(ne, {
90
+ class: T(["form-search", {
91
+ "form-search_show": h.value
92
+ }]),
93
+ onHeightChange: $
94
+ }, {
95
+ default: a(() => [
96
+ _(m(le, H({
97
+ ref_key: "formMain",
98
+ ref: n,
99
+ list: I.value,
100
+ data: V.value,
101
+ "row-gutter": u.rowGutter
102
+ }, s(F), {
103
+ layout: u.layout,
104
+ labelPosition: u.labelPosition,
105
+ labelWidth: u.labelWidth,
106
+ onSubmit: A,
107
+ onVisibleChange: W
108
+ }), U({
109
+ default: a(() => [
110
+ m(s(oe), k(R(D.value)), {
111
+ default: a(() => [
112
+ j("div", ue, [
113
+ E.value ? (d(), f(s(g), {
114
+ key: 0,
115
+ type: "primary",
116
+ link: "",
117
+ onMousedown: t[0] || (t[0] = (r) => y())
118
+ }, {
119
+ default: a(() => [
120
+ m(s(re), { class: "btn-box-expand-icon" }, {
121
+ default: a(() => [
122
+ l.value ? (d(), f(s(ae), { key: 0 })) : (d(), f(s(se), { key: 1 }))
123
+ ]),
124
+ _: 1
125
+ }),
126
+ w(" " + q(l.value ? "展开更多" : "收起更多"), 1)
127
+ ]),
128
+ _: 1
129
+ })) : J("", !0),
130
+ m(s(g), {
131
+ type: "warning",
132
+ onMousedown: C
133
+ }, {
134
+ default: a(() => [...t[2] || (t[2] = [
135
+ w("重置", -1)
136
+ ])]),
137
+ _: 1
138
+ }),
139
+ m(s(g), {
140
+ type: "primary",
141
+ onMousedown: t[1] || (t[1] = (r) => p())
142
+ }, {
143
+ default: a(() => [...t[3] || (t[3] = [
144
+ w("查询", -1)
145
+ ])]),
146
+ _: 1
147
+ })
148
+ ])
149
+ ]),
150
+ _: 1
151
+ }, 16)
152
+ ]),
153
+ _: 2
154
+ }, [
155
+ K(u.list, (r) => ({
156
+ name: r.key,
157
+ fn: a((Q) => [
158
+ O(e.$slots, r.key, k(R(Q)), void 0, !0)
159
+ ])
160
+ }))
161
+ ]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]), [
162
+ [X, h.value]
163
+ ])
164
+ ]),
165
+ _: 3
166
+ }, 8, ["class"]));
174
167
  }
175
168
  });
176
169
  export {
177
- Pe as default
170
+ ge as default
178
171
  };
@@ -1,9 +1,6 @@
1
- import { ElSelect as E, ElOption as S } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/select/style/css";
4
- import "element-plus/es/components/option/style/css";
5
- import { defineComponent as k, useAttrs as w, ref as f, computed as n, onMounted as B, watch as F, openBlock as m, createBlock as h, mergeProps as _, unref as r, withCtx as v, createElementBlock as x, Fragment as y, renderList as D, normalizeClass as z, renderSlot as A } from "vue";
6
- const j = /* @__PURE__ */ k({
1
+ import { defineComponent as C, useAttrs as O, ref as v, computed as n, onMounted as k, watch as S, openBlock as s, createBlock as f, unref as u, mergeProps as w, withCtx as h, createElementBlock as B, Fragment as E, renderList as F, normalizeClass as x, renderSlot as y } from "vue";
2
+ import { ElSelect as D, ElOption as z } from "element-plus";
3
+ const P = /* @__PURE__ */ C({
7
4
  name: "FormSelect",
8
5
  __name: "FormSelect",
9
6
  props: {
@@ -14,52 +11,49 @@ const j = /* @__PURE__ */ k({
14
11
  getOptions: {}
15
12
  },
16
13
  emits: ["update:modelValue", "detailChange"],
17
- setup(l, { emit: b }) {
18
- const t = l, d = b, M = w(), u = f([]), i = f([]), s = n(() => !!t.remoteMethod), O = n(() => t.getOptions ? u.value : t.options), c = n(() => s.value ? i.value : O.value), V = n(() => c.value.find((e) => e.value === t.modelValue)), p = async (e) => {
14
+ setup(o, { emit: b }) {
15
+ const t = o, d = b, M = O(), m = v([]), i = v([]), r = n(() => !!t.remoteMethod), V = n(() => t.getOptions ? m.value : t.options), c = n(() => r.value ? i.value : V.value), g = n(() => c.value.find((e) => e.value === t.modelValue)), p = async (e) => {
19
16
  i.value = await t.remoteMethod(e);
20
17
  };
21
- return B(() => {
18
+ return k(() => {
22
19
  var e;
23
20
  t.remoteMethod ? p() : (e = t.getOptions) == null || e.call(t).then((a) => {
24
- u.value = a;
21
+ m.value = a;
25
22
  });
26
- }), F(
27
- V,
23
+ }), S(
24
+ g,
28
25
  (e) => {
29
26
  d("detailChange", e);
30
27
  },
31
28
  {
32
29
  immediate: !0
33
30
  }
34
- ), (e, a) => {
35
- const g = S, C = E;
36
- return m(), h(C, _({
37
- modelValue: l.modelValue,
38
- remote: r(s),
39
- filterable: r(s),
40
- remoteMethod: l.remoteMethod && p
41
- }, r(M), {
42
- "onUpdate:modelValue": a[0] || (a[0] = (o) => d("update:modelValue", o))
43
- }), {
44
- default: v(() => [
45
- (m(!0), x(y, null, D(r(c), (o) => (m(), h(g, {
46
- key: o.value,
47
- class: z(l.itemCls),
48
- label: o.label,
49
- value: o.value,
50
- disabled: o.disabled
51
- }, {
52
- default: v(() => [
53
- A(e.$slots, "option", { data: o })
54
- ]),
55
- _: 2
56
- }, 1032, ["class", "label", "value", "disabled"]))), 128))
57
- ]),
58
- _: 3
59
- }, 16, ["modelValue", "remote", "filterable", "remoteMethod"]);
60
- };
31
+ ), (e, a) => (s(), f(u(D), w({
32
+ modelValue: o.modelValue,
33
+ remote: r.value,
34
+ filterable: r.value,
35
+ remoteMethod: o.remoteMethod && p
36
+ }, u(M), {
37
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => d("update:modelValue", l))
38
+ }), {
39
+ default: h(() => [
40
+ (s(!0), B(E, null, F(c.value, (l) => (s(), f(u(z), {
41
+ key: l.value,
42
+ class: x(o.itemCls),
43
+ label: l.label,
44
+ value: l.value,
45
+ disabled: l.disabled
46
+ }, {
47
+ default: h(() => [
48
+ y(e.$slots, "option", { data: l })
49
+ ]),
50
+ _: 2
51
+ }, 1032, ["class", "label", "value", "disabled"]))), 128))
52
+ ]),
53
+ _: 3
54
+ }, 16, ["modelValue", "remote", "filterable", "remoteMethod"]));
61
55
  }
62
56
  });
63
57
  export {
64
- j as default
58
+ P as default
65
59
  };
@@ -1,9 +1,8 @@
1
- import { ElButton as m } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/button/style/css";
4
- import { defineComponent as p, ref as u, computed as f, openBlock as y, createBlock as d, mergeProps as B, unref as b, withCtx as g, createTextVNode as x, toDisplayString as _ } from "vue";
5
- import k from "lodash/omit";
6
- const w = /* @__PURE__ */ p({
1
+ import { defineComponent as c, computed as l, openBlock as p, createBlock as u, unref as o, mergeProps as f, withCtx as d, createTextVNode as y, toDisplayString as B } from "vue";
2
+ import { ElButton as b } from "element-plus";
3
+ import { useFormSubmit as g } from "./use-form-submit.mjs";
4
+ import x from "lodash/omit";
5
+ const T = /* @__PURE__ */ c({
7
6
  __name: "FormSubmitBtn",
8
7
  props: {
9
8
  size: {},
@@ -29,36 +28,26 @@ const w = /* @__PURE__ */ p({
29
28
  submitFn: {}
30
29
  },
31
30
  emits: ["success", "fail"],
32
- setup(a, { emit: s }) {
33
- const e = a, i = s, o = u(!1), r = f(
34
- () => k(e, ["formMainInstance", "submitText", "submitFn"])
35
- ), l = async () => {
36
- o.value = !0;
37
- const { formMainInstance: n } = e;
38
- try {
39
- await n.validate();
40
- const t = n.stringify();
41
- await e.submitFn(t), i("success", t);
42
- } catch (t) {
43
- i("fail", t);
44
- } finally {
45
- o.value = !1;
46
- }
47
- };
48
- return (n, t) => {
49
- const c = m;
50
- return y(), d(c, B(b(r), {
51
- loading: o.value,
52
- onClick: l
53
- }), {
54
- default: g(() => [
55
- x(_(a.submitText), 1)
56
- ]),
57
- _: 1
58
- }, 16, ["loading"]);
59
- };
31
+ setup(n, { emit: i }) {
32
+ const e = n, a = i, s = l(
33
+ () => x(e, ["formMainInstance", "submitText", "submitFn"])
34
+ ), { submitting: m, submit: r } = g({
35
+ getFormMainInstance: () => e.formMainInstance,
36
+ submitFn: (t) => e.submitFn(t),
37
+ onSuccess: (t) => a("success", t),
38
+ onFail: (t) => a("fail", t)
39
+ });
40
+ return (t, F) => (p(), u(o(b), f(s.value, {
41
+ loading: o(m),
42
+ onClick: o(r)
43
+ }), {
44
+ default: d(() => [
45
+ y(B(n.submitText), 1)
46
+ ]),
47
+ _: 1
48
+ }, 16, ["loading", "onClick"]));
60
49
  }
61
50
  });
62
51
  export {
63
- w as default
52
+ T as default
64
53
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormSubmitPanel.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d71ece49"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-93bc9096"]]);
5
5
  export {
6
- a as default
6
+ p as default
7
7
  };