@done-coding/admin-core 0.8.3-alpha.0 → 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 (89) 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 +23 -28
  35. package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
  36. package/es/components/form/FormSubmitPanel.vue2.mjs +16 -16
  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/list-page/ListPage.vue.mjs +2 -2
  42. package/es/components/list-page/ListPage.vue2.mjs +134 -139
  43. package/es/components/menu/MenuItemSub.vue.mjs +41 -48
  44. package/es/components/menu/MenuTree.vue.mjs +58 -65
  45. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  46. package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
  47. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  48. package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
  49. package/es/components/modal/ConfirmModal.vue.mjs +3 -3
  50. package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
  51. package/es/components/modal/DetailModal.vue.mjs +38 -41
  52. package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
  53. package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
  54. package/es/components/panel/PanelMain.vue.mjs +2 -2
  55. package/es/components/panel/PanelMain.vue2.mjs +67 -74
  56. package/es/components/table/TableMain.vue.mjs +2 -2
  57. package/es/components/table/TableMain.vue2.mjs +221 -229
  58. package/es/components/table/TableToolbar.vue.mjs +2 -2
  59. package/es/components/table/TableToolbar.vue2.mjs +115 -126
  60. package/es/hooks/use-admin-theme-apply.mjs +84 -0
  61. package/es/hooks/use-admin-viewport-apply.mjs +27 -0
  62. package/es/index.mjs +125 -117
  63. package/es/inject/key.mjs +7 -4
  64. package/es/store/app.mjs +75 -84
  65. package/es/style.css +1 -1
  66. package/es/utils/theme-scale.mjs +37 -0
  67. package/package.json +2 -4
  68. package/types/bridge/config-hook.d.ts +91 -0
  69. package/types/bridge/index.d.ts +108 -8
  70. package/types/bridge/plugin.d.ts +39 -0
  71. package/types/bridge/theme.d.ts +66 -0
  72. package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
  73. package/types/components/app-layout/types.d.ts +1 -1
  74. package/types/components/form/FormItem.vue.d.ts +12 -12
  75. package/types/components/form/FormTree.vue.d.ts +50 -50
  76. package/types/components/menu/MenuTree.vue.d.ts +10 -10
  77. package/types/components/modal/ModalShelf.vue.d.ts +1 -1
  78. package/types/components/table/TableMain.vue.d.ts +1 -1
  79. package/types/hooks/activated.d.ts +2 -2
  80. package/types/hooks/feel-size.d.ts +1 -1
  81. package/types/hooks/index.d.ts +2 -0
  82. package/types/hooks/menus-dispatch.d.ts +5 -5
  83. package/types/hooks/use-admin-theme-apply.d.ts +17 -0
  84. package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
  85. package/types/hooks/use-breakpoint.d.ts +1 -1
  86. package/types/inject/key.d.ts +18 -0
  87. package/types/store/app.d.ts +138 -59
  88. package/types/utils/index.d.ts +1 -0
  89. package/types/utils/theme-scale.d.ts +35 -0
@@ -1,7 +1,7 @@
1
- import { defineComponent as w, ref as C, computed as n, provide as b, watch as y, openBlock as S, createBlock as V, unref as l, createSlots as $, withCtx as h, createElementVNode as x, normalizeStyle as _, renderSlot as d } from "vue";
2
- import k from "./HeightProvider.vue.mjs";
3
- import { useChannelViewportHeight as L } from "../../hooks/use-channel-viewport-height.mjs";
4
- const M = /* @__PURE__ */ w({
1
+ import { defineComponent as H, ref as w, computed as i, provide as C, watch as b, openBlock as y, createBlock as S, createSlots as V, withCtx as r, createElementVNode as $, normalizeStyle as x, renderSlot as h } from "vue";
2
+ import _ from "./HeightProvider.vue.mjs";
3
+ import { useChannelViewportHeight as k } from "../../hooks/use-channel-viewport-height.mjs";
4
+ const F = /* @__PURE__ */ H({
5
5
  __name: "TabsRefineFlow",
6
6
  props: {
7
7
  viewportHeight: {},
@@ -12,45 +12,47 @@ const M = /* @__PURE__ */ w({
12
12
  refineReduceHeight: { default: 0 }
13
13
  },
14
14
  emits: ["viewportHeightChange"],
15
- setup(i, { emit: p }) {
16
- const e = i, c = p, o = e.channel ? Symbol.for(e.channel) : void 0, { viewportHeightFinal: s, parentLevel: a } = L(e), r = C(0), g = n(() => e.padding[0] + e.padding[2]), m = n(() => ({
15
+ setup(n, { emit: d }) {
16
+ const e = n, p = d, a = e.channel ? Symbol.for(e.channel) : void 0, { viewportHeightFinal: c, parentLevel: o } = k(e), l = w(0), s = i(() => e.padding[0] + e.padding[2]), g = i(() => ({
17
17
  padding: e.padding.map((t) => `${t}px`).join(" "),
18
18
  boxSizing: "border-box"
19
- })), v = n(
19
+ })), v = i(
20
20
  () => Math.max(
21
- s.value - g.value - e.refineReduceHeight,
21
+ c.value - s.value - e.refineReduceHeight,
22
22
  0
23
23
  )
24
- ), u = n(
25
- () => a.value > 0 ? a.value : 1
26
- ), f = n(() => u.value + 1), H = (t) => {
27
- r.value = t, c("viewportHeightChange", t);
24
+ ), m = i(
25
+ () => o.value > 0 ? o.value : 1
26
+ ), u = i(() => m.value + 1), f = (t) => {
27
+ l.value = t, p("viewportHeightChange", t);
28
28
  };
29
- return o && b(o, {
30
- viewportHeight: n(() => r.value),
31
- level: f.value
32
- }), y(
29
+ return a && C(a, {
30
+ viewportHeight: i(() => l.value),
31
+ // level 有意取 setup 期一次性快照(channel 不响应式),非误丢响应性,定向 disable。
32
+ // eslint-disable-next-line vue/no-ref-object-destructure
33
+ level: u.value
34
+ }), b(
33
35
  // eslint-disable-next-line vue/no-setup-props-destructure
34
36
  () => e.channel,
35
37
  () => console.error("[TabsMain] channel 不支持响应式变更,当前值已忽略。")
36
- ), (t, R) => (S(), V(k, {
37
- viewportHeight: l(v),
38
- minHeight: i.minHeight,
39
- onChildViewportHeightChange: H
40
- }, $({
41
- default: h(() => [
42
- x("div", {
43
- style: _(l(m))
38
+ ), (t, L) => (y(), S(_, {
39
+ viewportHeight: v.value,
40
+ minHeight: n.minHeight,
41
+ onChildViewportHeightChange: f
42
+ }, V({
43
+ default: r(() => [
44
+ $("div", {
45
+ style: x(g.value)
44
46
  }, [
45
- d(t.$slots, "default")
47
+ h(t.$slots, "default")
46
48
  ], 4)
47
49
  ]),
48
50
  _: 2
49
51
  }, [
50
52
  t.$slots.header ? {
51
53
  name: "header",
52
- fn: h(() => [
53
- d(t.$slots, "header")
54
+ fn: r(() => [
55
+ h(t.$slots, "header")
54
56
  ]),
55
57
  key: "0"
56
58
  } : void 0
@@ -58,5 +60,5 @@ const M = /* @__PURE__ */ w({
58
60
  }
59
61
  });
60
62
  export {
61
- M as default
63
+ F as default
62
64
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormItem.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0dd66b41"]]);
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b508d64"]]);
5
5
  export {
6
6
  _ as default
7
7
  };
@@ -1,14 +1,11 @@
1
- import { ElFormItem as q, ElText as G } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/form-item/style/css";
4
- import "element-plus/es/components/text/style/css";
5
- import { defineComponent as J, shallowRef as Q, computed as n, watch as p, withDirectives as U, openBlock as a, createBlock as c, mergeProps as v, unref as r, withCtx as y, renderSlot as W, normalizeProps as F, createTextVNode as k, toDisplayString as h, resolveDynamicComponent as b, createSlots as X, createElementBlock as H, Fragment as Y, createCommentVNode as Z, vShow as _ } from "vue";
6
- import { getPlaceholder as ee, getChangeSubmit as te, getBlurSubmit as ne, getEnterSubmit as oe, getVModelSugar as re, generateFormData as ie } from "./utils.mjs";
7
- import ae from "lodash/omit";
1
+ import { defineComponent as q, shallowRef as G, computed as n, watch as f, withDirectives as J, openBlock as a, createBlock as i, unref as I, mergeProps as g, withCtx as d, renderSlot as Q, normalizeProps as L, createTextVNode as p, toDisplayString as v, resolveDynamicComponent as y, createSlots as U, createElementBlock as B, Fragment as W, createCommentVNode as X, vShow as Y } from "vue";
2
+ import { ElFormItem as Z, ElText as _ } from "element-plus";
3
+ import { getPlaceholder as ee, getChangeSubmit as te, getBlurSubmit as ne, getEnterSubmit as oe, getVModelSugar as re, generateFormData as ae } from "./utils.mjs";
4
+ import ie from "lodash/omit";
8
5
  const ce = {
9
6
  key: 2,
10
7
  class: "form-item-tip"
11
- }, pe = /* @__PURE__ */ J({
8
+ }, fe = /* @__PURE__ */ q({
12
9
  name: "FormItem",
13
10
  __name: "FormItem",
14
11
  props: {
@@ -16,133 +13,130 @@ const ce = {
16
13
  data: {}
17
14
  },
18
15
  emits: ["viewHideChange", "submit"],
19
- setup(i, { emit: L }) {
20
- const t = i, l = L, P = Q(), B = n(() => {
16
+ setup(r, { emit: E }) {
17
+ const t = r, c = E, k = G(), F = n(() => {
21
18
  const {
22
19
  config: { beLink: e }
23
20
  } = t;
24
21
  return e ? Array.isArray(e) ? e : [e] : [];
25
- }), w = n(() => B.value.filter((e) => e.key !== t.config.key)), V = n(() => w.value.length > 0), x = n(() => t.data[t.config.key]), g = n(() => ({
22
+ }), h = n(() => F.value.filter((e) => e.key !== t.config.key)), b = n(() => h.value.length > 0), x = n(() => t.data[t.config.key]), s = n(() => ({
26
23
  data: t.data,
27
24
  config: t.config
28
25
  })), D = n(() => {
29
26
  const { config: e } = t;
30
- return typeof e.wrapProps == "function" ? e.wrapProps(g.value) : e.wrapProps || {};
31
- }), C = n(() => {
27
+ return typeof e.wrapProps == "function" ? e.wrapProps(s.value) : e.wrapProps || {};
28
+ }), P = n(() => {
32
29
  const { config: e } = t;
33
- return typeof e.props == "function" ? e.props(g.value) : e.props || {};
30
+ return typeof e.props == "function" ? e.props(s.value) : e.props || {};
34
31
  }), T = () => {
35
- l("submit", "enter");
32
+ c("submit", "enter");
36
33
  }, A = () => {
37
- l("submit", "blur");
34
+ c("submit", "blur");
38
35
  }, M = () => {
39
- l("submit", "change");
40
- }, E = (e, o) => {
41
- w.value.forEach((u) => {
42
- const { key: f, getValue: S } = u, j = S(e, t.data[f], o);
43
- t.data[f] = S(e, j);
36
+ c("submit", "change");
37
+ }, w = (e, o) => {
38
+ h.value.forEach((C) => {
39
+ const { key: S, getValue: H } = C, j = H(e, t.data[S], o);
40
+ t.data[S] = H(e, j);
44
41
  });
45
42
  }, N = n(() => ee(t.config) || {}), $ = n(() => ({
46
43
  ...oe(t.config, T) || {},
47
44
  ...ne(t.config, A) || {},
48
45
  ...te(t.config, M) || {}
49
- })), z = n(() => ae(C.value, ["children"])), K = n(() => re({
46
+ })), z = n(() => ie(P.value, ["children"])), K = n(() => re({
50
47
  modelValueKey: "modelValue",
51
48
  data: t.data,
52
49
  config: t.config
53
- })), O = n(() => V.value ? {
54
- onTriggerChangeLink: E
55
- } : {}), d = n(() => ({
50
+ })), O = n(() => b.value ? {
51
+ onTriggerChangeLink: w
52
+ } : {}), m = n(() => ({
56
53
  ...N.value,
57
54
  ...$.value,
58
55
  ...z.value,
59
56
  ...K.value,
60
57
  ...O.value
61
- })), s = n(() => {
62
- const { children: e } = C.value;
58
+ })), l = n(() => {
59
+ const { children: e } = P.value;
63
60
  return e;
64
- }), I = n(() => {
61
+ }), V = n(() => {
65
62
  const { config: e } = t, { hide: o } = e;
66
63
  return typeof o == "boolean" ? o : (o == null ? void 0 : o({
67
- ...g.value,
68
- getInitValue: () => ie([e])[e.key]
64
+ ...s.value,
65
+ getInitValue: () => ae([e])[e.key]
69
66
  })) ?? !1;
70
67
  }), R = n(() => [
71
68
  `form-item-${t.config.key}`,
72
69
  { "form-item-label-hide": !!t.config.labelHide }
73
70
  ]);
74
- p(
75
- I,
71
+ f(
72
+ V,
76
73
  (e) => {
77
74
  var o;
78
- l("viewHideChange", {
75
+ c("viewHideChange", {
79
76
  config: t.config,
80
77
  status: e
81
- }), e && ((o = P.value) == null || o.clearValidate());
78
+ }), e && ((o = k.value) == null || o.clearValidate());
82
79
  },
83
80
  {
84
81
  immediate: !0
85
82
  }
86
83
  );
87
- let m;
88
- return p(
89
- V,
84
+ let u;
85
+ return f(
86
+ b,
90
87
  (e) => {
91
- e ? m = p(
88
+ e ? u = f(
92
89
  x,
93
90
  (o) => {
94
- E(o);
91
+ w(o);
95
92
  },
96
93
  {
97
94
  immediate: !0
98
95
  }
99
- ) : m == null || m();
96
+ ) : u == null || u();
100
97
  },
101
98
  {
102
99
  immediate: !0
103
100
  }
104
- ), (e, o) => {
105
- const u = G, f = q;
106
- return U((a(), c(f, v({
107
- ref_key: "formItem",
108
- ref: P,
109
- prop: i.config.key,
110
- label: i.config.label,
111
- class: r(R)
112
- }, r(D)), {
113
- default: y(() => [
114
- i.config.render === void 0 ? W(e.$slots, "default", F(v({ key: 0 }, r(d))), () => [
115
- k(h(r(d).modelValue), 1)
116
- ], !0) : (a(), c(b(i.config.render), F(v({ key: 1 }, r(d))), X({ _: 2 }, [
117
- r(s) !== void 0 ? {
118
- name: "default",
119
- fn: y(() => [
120
- typeof r(s) == "function" ? (a(), c(b(r(s)), { key: 0 })) : (a(), H(Y, { key: 1 }, [
121
- k(h(r(s)), 1)
122
- ], 64))
123
- ]),
124
- key: "0"
125
- } : void 0
126
- ]), 1040)),
127
- i.config.tip ? (a(), H("div", ce, [
128
- typeof i.config.tip == "function" ? (a(), c(b(i.config.tip), { key: 0 })) : (a(), c(u, {
129
- key: 1,
130
- type: "info"
131
- }, {
132
- default: y(() => [
133
- k(h(i.config.tip), 1)
134
- ]),
135
- _: 1
136
- }))
137
- ])) : Z("", !0)
138
- ]),
139
- _: 3
140
- }, 16, ["prop", "label", "class"])), [
141
- [_, !r(I)]
142
- ]);
143
- };
101
+ ), (e, o) => J((a(), i(I(Z), g({
102
+ ref_key: "formItem",
103
+ ref: k,
104
+ prop: r.config.key,
105
+ label: r.config.label,
106
+ class: R.value
107
+ }, D.value), {
108
+ default: d(() => [
109
+ r.config.render === void 0 ? Q(e.$slots, "default", L(g({ key: 0 }, m.value)), () => [
110
+ p(v(m.value.modelValue), 1)
111
+ ], !0) : (a(), i(y(r.config.render), L(g({ key: 1 }, m.value)), U({ _: 2 }, [
112
+ l.value !== void 0 ? {
113
+ name: "default",
114
+ fn: d(() => [
115
+ typeof l.value == "function" ? (a(), i(y(l.value), { key: 0 })) : (a(), B(W, { key: 1 }, [
116
+ p(v(l.value), 1)
117
+ ], 64))
118
+ ]),
119
+ key: "0"
120
+ } : void 0
121
+ ]), 1040)),
122
+ r.config.tip ? (a(), B("div", ce, [
123
+ typeof r.config.tip == "function" ? (a(), i(y(r.config.tip), { key: 0 })) : (a(), i(I(_), {
124
+ key: 1,
125
+ type: "info"
126
+ }, {
127
+ default: d(() => [
128
+ p(v(r.config.tip), 1)
129
+ ]),
130
+ _: 1
131
+ }))
132
+ ])) : X("", !0)
133
+ ]),
134
+ _: 3
135
+ }, 16, ["prop", "label", "class"])), [
136
+ [Y, !V.value]
137
+ ]);
144
138
  }
145
139
  });
146
140
  export {
147
- pe as default
141
+ fe as default
148
142
  };
@@ -1,12 +1,8 @@
1
- import { ElForm as M, ElRow as A, ElCol as B } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/form/style/css";
4
- import "element-plus/es/components/row/style/css";
5
- import "element-plus/es/components/col/style/css";
6
- import { defineComponent as H, shallowRef as N, ref as _, computed as u, provide as P, watch as y, openBlock as p, createBlock as L, unref as h, withCtx as m, createVNode as O, createElementBlock as T, Fragment as q, renderList as z, withDirectives as J, mergeProps as V, renderSlot as j, vShow as Q } from "vue";
1
+ import { defineComponent as M, shallowRef as A, ref as L, computed as n, provide as B, watch as y, openBlock as h, createBlock as O, unref as b, withCtx as m, createVNode as V, createElementBlock as H, Fragment as N, renderList as P, withDirectives as T, mergeProps as j, renderSlot as S, vShow as q } from "vue";
2
+ import { ElForm as z, ElRow as J, ElCol as Q } from "element-plus";
7
3
  import U from "./FormItem.vue.mjs";
8
- import { FORM_ITEM_CHANGE_LOADING as W, stringifyFormData as X, parseFormData as Y, generateFormData as Z, resolveFormLayout as S } from "./utils.mjs";
9
- const me = /* @__PURE__ */ H({
4
+ import { FORM_ITEM_CHANGE_LOADING as W, stringifyFormData as X, parseFormData as Y, generateFormData as Z, resolveFormLayout as x } from "./utils.mjs";
5
+ const ue = /* @__PURE__ */ M({
10
6
  name: "FormMain",
11
7
  inheritAttrs: !0,
12
8
  __name: "FormMain",
@@ -17,84 +13,84 @@ const me = /* @__PURE__ */ H({
17
13
  rowGutter: { default: 0 }
18
14
  },
19
15
  emits: ["loadingChange", "visibleChange", "submit"],
20
- setup(f, { expose: x, emit: R }) {
21
- const o = f, v = R, s = N(), c = _([]), d = _({}), b = u(() => !!c.value.length), F = u(() => Object.keys(d.value).filter(
22
- (e) => d.value[e]
23
- )), D = u(() => o.list.filter((e) => !F.value.includes(e.key))), $ = u(() => D.value.length > 0), G = (e) => e;
24
- x({
25
- validate: () => s.value ? new Promise((e, t) => {
16
+ setup(c, { expose: _, emit: D }) {
17
+ const a = c, v = D, o = A(), i = L([]), s = L({}), F = n(() => !!i.value.length), p = n(() => Object.keys(s.value).filter(
18
+ (e) => s.value[e]
19
+ )), R = n(() => a.list.filter((e) => !p.value.includes(e.key))), $ = n(() => R.value.length > 0), G = (e) => e;
20
+ _({
21
+ validate: () => o.value ? new Promise((e, t) => {
26
22
  var l;
27
- (l = s.value) == null || l.validate((r, i) => {
23
+ (l = o.value) == null || l.validate((r, u) => {
28
24
  if (r)
29
25
  e();
30
26
  else {
31
- const a = { ...i || {} };
32
- Object.keys(a).forEach((n) => {
33
- var C;
34
- F.value.includes(n) && (console.log(`当前${n}被隐藏,移除校验`, a[n]), delete a[n], (C = s.value) == null || C.clearValidate(n));
35
- }), Object.keys(a).length === 0 ? e() : t(i);
27
+ const f = { ...u || {} };
28
+ Object.keys(f).forEach((d) => {
29
+ var E;
30
+ p.value.includes(d) && (console.log(`当前${d}被隐藏,移除校验`, f[d]), delete f[d], (E = o.value) == null || E.clearValidate(d));
31
+ }), Object.keys(f).length === 0 ? e() : t(u);
36
32
  }
37
33
  });
38
34
  }) : Promise.reject(new Error("实例化未完成")),
39
- resetFields: () => s.value ? s.value.resetFields() : console.error("实例化未完成"),
40
- clearValidate: (e) => s.value ? s.value.clearValidate(e) : console.error("实例化未完成"),
41
- generate: () => Z(o.list),
42
- parse: (e) => Y(e, o.list),
43
- stringify: () => X(o.data, o.list)
35
+ resetFields: () => o.value ? o.value.resetFields() : console.error("实例化未完成"),
36
+ clearValidate: (e) => o.value ? o.value.clearValidate(e) : console.error("实例化未完成"),
37
+ generate: () => Z(a.list),
38
+ parse: (e) => Y(e, a.list),
39
+ stringify: () => X(a.data, a.list)
44
40
  });
45
- const g = u(() => o.list), w = u(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
46
- data: o.data,
41
+ const g = n(() => a.list), k = n(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
42
+ data: a.data,
47
43
  config: t
48
- }) : e[t.key] = t.rules), e), {})), k = u(() => c.value.reduce(
44
+ }) : e[t.key] = t.rules), e), {})), w = n(() => i.value.reduce(
49
45
  (e, t) => (e[t.key] = [
50
46
  {
51
47
  validator: () => [new Error(`${t.label}${t.message}`)]
52
48
  }
53
49
  ], e),
54
50
  {}
55
- )), I = u(() => {
56
- const e = Object.keys(w.value), t = Object.keys(k.value);
57
- return [...new Set(e.concat(t))].reduce((r, i) => (r[i] = [
58
- ...w.value[i] || [],
59
- ...k.value[i] || []
51
+ )), I = n(() => {
52
+ const e = Object.keys(k.value), t = Object.keys(w.value);
53
+ return [...new Set(e.concat(t))].reduce((r, u) => (r[u] = [
54
+ ...k.value[u] || [],
55
+ ...w.value[u] || []
60
56
  ], r), {});
61
57
  });
62
- P(W, ({ key: e, message: t }) => {
58
+ B(W, ({ key: e, message: t }) => {
63
59
  if (!e)
64
60
  return console.error("更新状态未传入key, 此处忽略");
65
- const l = c.value.findIndex((r) => r.key === e);
66
- l === -1 ? t && c.value.push({
61
+ const l = i.value.findIndex((r) => r.key === e);
62
+ l === -1 ? t && i.value.push({
67
63
  key: e,
68
64
  message: t,
69
- label: o.list.find((r) => r.key === e).label
70
- }) : t ? c.value.splice(l, 1, {
65
+ label: a.list.find((r) => r.key === e).label
66
+ }) : t ? i.value.splice(l, 1, {
71
67
  key: e,
72
68
  message: t,
73
- label: o.list.find((r) => r.key === e).label
74
- }) : c.value.splice(l, 1);
69
+ label: a.list.find((r) => r.key === e).label
70
+ }) : i.value.splice(l, 1);
75
71
  });
76
72
  const K = ({
77
73
  status: e,
78
74
  config: { key: t }
79
75
  }) => {
80
- (d.value[t] || !1) !== e && (d.value[t] = e);
81
- }, E = (e) => ({
82
- ...S(o.layout),
83
- ...S(e)
76
+ (s.value[t] || !1) !== e && (s.value[t] = e);
77
+ }, C = (e) => ({
78
+ ...x(a.layout),
79
+ ...x(e)
84
80
  });
85
81
  return y(
86
82
  g,
87
83
  (e) => {
88
84
  const t = e.map((l) => l.key);
89
- Object.keys(d.value).forEach((l) => {
90
- t.includes(l) || delete d.value[l];
85
+ Object.keys(s.value).forEach((l) => {
86
+ t.includes(l) || delete s.value[l];
91
87
  });
92
88
  },
93
89
  {
94
90
  immediate: !0
95
91
  }
96
- ), y(b, () => {
97
- v("loadingChange", b.value);
92
+ ), y(F, () => {
93
+ v("loadingChange", F.value);
98
94
  }), y(
99
95
  $,
100
96
  (e) => {
@@ -103,47 +99,44 @@ const me = /* @__PURE__ */ H({
103
99
  {
104
100
  immediate: !0
105
101
  }
106
- ), (e, t) => {
107
- const l = B, r = A, i = M;
108
- return p(), L(i, {
109
- ref_key: "elForm",
110
- ref: s,
111
- model: f.data,
112
- rules: h(I)
113
- }, {
114
- default: m(() => [
115
- O(r, { gutter: f.rowGutter }, {
116
- default: m(() => [
117
- (p(!0), T(q, null, z(h(g), (a) => J((p(), L(l, V({
118
- key: a.key
119
- }, { ref_for: !0 }, E(a.layout)), {
120
- default: m(() => [
121
- O(U, {
122
- data: f.data,
123
- config: G(a),
124
- onViewHideChange: K,
125
- onSubmit: t[0] || (t[0] = (n) => v("submit", n))
126
- }, {
127
- default: m((n) => [
128
- j(e.$slots, a.key, V({ ref_for: !0 }, n))
129
- ]),
130
- _: 2
131
- }, 1032, ["data", "config"])
132
- ]),
133
- _: 2
134
- }, 1040)), [
135
- [Q, !(h(d)[a.key] ?? !1)]
136
- ])), 128)),
137
- j(e.$slots, "default", { mergeLayout: E })
138
- ]),
139
- _: 3
140
- }, 8, ["gutter"])
141
- ]),
142
- _: 3
143
- }, 8, ["model", "rules"]);
144
- };
102
+ ), (e, t) => (h(), O(b(z), {
103
+ ref_key: "elForm",
104
+ ref: o,
105
+ model: c.data,
106
+ rules: I.value
107
+ }, {
108
+ default: m(() => [
109
+ V(b(J), { gutter: c.rowGutter }, {
110
+ default: m(() => [
111
+ (h(!0), H(N, null, P(g.value, (l) => T((h(), O(b(Q), j({
112
+ key: l.key
113
+ }, { ref_for: !0 }, C(l.layout)), {
114
+ default: m(() => [
115
+ V(U, {
116
+ data: c.data,
117
+ config: G(l),
118
+ onViewHideChange: K,
119
+ onSubmit: t[0] || (t[0] = (r) => v("submit", r))
120
+ }, {
121
+ default: m((r) => [
122
+ S(e.$slots, l.key, j({ ref_for: !0 }, r))
123
+ ]),
124
+ _: 2
125
+ }, 1032, ["data", "config"])
126
+ ]),
127
+ _: 2
128
+ }, 1040)), [
129
+ [q, !(s.value[l.key] ?? !1)]
130
+ ])), 128)),
131
+ S(e.$slots, "default", { mergeLayout: C })
132
+ ]),
133
+ _: 3
134
+ }, 8, ["gutter"])
135
+ ]),
136
+ _: 3
137
+ }, 8, ["model", "rules"]));
145
138
  }
146
139
  });
147
140
  export {
148
- me as default
141
+ ue as default
149
142
  };