@kp-ui/lowcode 2.15.0-alpha.16 → 2.15.0-alpha.18

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 (26) hide show
  1. package/package.json +1 -1
  2. package/src/components/FormRender/index.vue.js +2 -2
  3. package/src/components/FormRender/index.vue2.js +30 -34
  4. package/src/components/FormRender/useFormContext.js +109 -97
  5. package/src/components/form-designer/form-widget/container-widget/useTableWidget.js +38 -37
  6. package/src/components/form-designer/form-widget/field-widget/button-list-widget.vue.js +2 -2
  7. package/src/components/form-designer/form-widget/field-widget/button-list-widget.vue2.js +21 -20
  8. package/src/components/form-designer/form-widget/field-widget/button-widget.vue.js +2 -2
  9. package/src/components/form-designer/form-widget/field-widget/button-widget.vue2.js +11 -11
  10. package/src/components/form-designer/form-widget/field-widget/hooks/useSelect.js +72 -71
  11. package/src/components/form-designer/form-widget/field-widget/useField.js +12 -11
  12. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
  13. package/src/components/form-designer/useAppRef.js +29 -27
  14. package/src/components/form-render/SubmitButtonRender.vue.js +15 -17
  15. package/src/components/form-render/container-items/data-table-widget.vue.js +1 -1
  16. package/src/components/form-render/container-items/data-table-widget.vue2.js +56 -53
  17. package/src/components/form-render/container-items/grid-col-widget.vue.js +1 -1
  18. package/src/components/form-render/container-items/grid-col-widget.vue2.js +19 -17
  19. package/src/components/form-render/container-items/grid-sub-form-widget.vue.js +2 -2
  20. package/src/components/form-render/container-items/grid-sub-form-widget.vue2.js +103 -92
  21. package/src/components/form-render/container-items/grid-widget.vue.js +1 -1
  22. package/src/components/form-render/container-items/grid-widget.vue2.js +18 -16
  23. package/src/components/form-render/dynamic-dialog.vue.js +56 -52
  24. package/src/components/public/CustomerModal/CustomerModal.vue2.js +29 -26
  25. package/stats.html +1 -1
  26. package/styles/style.css +1 -1
@@ -1,11 +1,12 @@
1
- import { defineComponent as u, computed as a, createBlock as c, createCommentVNode as l, unref as t, openBlock as f, normalizeProps as x, mergeProps as b, withCtx as g, createVNode as C } from "vue";
2
- import { ComponentNameEnum as L, WidgetTypeEnum as _ } from "../../../../constants/WidgetTypeEnum.js";
3
- import w from "./static-content-wrapper.vue.js";
4
- import E from "../../../public/ActionButtonListRender.vue.js";
5
- import { useField as F } from "./useField.js";
6
- const I = /* @__PURE__ */ u({
7
- name: _.buttonList,
8
- componentName: L.FieldWidget,
1
+ import { defineComponent as c, computed as a, createBlock as f, createCommentVNode as l, unref as t, openBlock as x, normalizeProps as b, mergeProps as g, withCtx as C, createVNode as L } from "vue";
2
+ import { ComponentNameEnum as _, WidgetTypeEnum as E } from "../../../../constants/WidgetTypeEnum.js";
3
+ import F from "./static-content-wrapper.vue.js";
4
+ import w from "../../../public/ActionButtonListRender.vue.js";
5
+ import { useField as k } from "./useField.js";
6
+ import { useExecFunction as N } from "tmgc2-share";
7
+ const V = /* @__PURE__ */ c({
8
+ name: E.buttonList,
9
+ componentName: _.FieldWidget,
9
10
  __name: "button-list-widget",
10
11
  props: {
11
12
  widget: {},
@@ -18,22 +19,22 @@ const I = /* @__PURE__ */ u({
18
19
  subFormRowId: {},
19
20
  subFormColIndex: {}
20
21
  },
21
- setup(i, { expose: s }) {
22
- const o = i, r = a(() => e.options.buttonList || []), { fieldEditor: d, field: e, designState: p, handleHidden: m, defineExposed: n } = F(o);
23
- return s({
24
- buttonList: r,
25
- ...n
26
- }), (k, N) => t(m) ? l("", !0) : (f(), c(w, x(b({ key: 0 }, o)), {
27
- default: g(() => [
28
- C(E, {
22
+ setup(n, { expose: i }) {
23
+ const o = n, s = a(() => e.options.buttonList || []), { fieldEditor: r, field: e, designState: d, handleHidden: m, defineExposed: p } = k(o), { context: u } = N();
24
+ return i({
25
+ buttonList: s,
26
+ ...p
27
+ }), (S, W) => t(m) ? l("", !0) : (x(), f(F, b(g({ key: 0 }, o)), {
28
+ default: C(() => [
29
+ L(w, {
29
30
  ref_key: "fieldEditor",
30
- ref: d,
31
+ ref: r,
31
32
  options: t(e).options,
32
- designState: t(p),
33
+ designState: t(d),
33
34
  buttonList: t(e).options.buttonList || [],
34
35
  customClass: t(e).options.customClass || [],
35
36
  flex: t(e).options.flex,
36
- ctx: t(n)
37
+ ctx: t(u)
37
38
  }, null, 8, ["options", "designState", "buttonList", "customClass", "flex", "ctx"])
38
39
  ]),
39
40
  _: 1
@@ -41,5 +42,5 @@ const I = /* @__PURE__ */ u({
41
42
  }
42
43
  });
43
44
  export {
44
- I as default
45
+ V as default
45
46
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./button-widget.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-a67ba8ea"]]);
4
+ const _ = /* @__PURE__ */ o(t, [["__scopeId", "data-v-06b0b085"]]);
5
5
  export {
6
- m as default
6
+ _ as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as _, resolveComponent as x, createBlock as i, createCommentVNode as s, unref as e, openBlock as r, normalizeProps as k, mergeProps as y, withCtx as a, createVNode as F, normalizeClass as w, createTextVNode as z, toDisplayString as E } from "vue";
1
+ import { defineComponent as _, resolveComponent as x, createBlock as i, createCommentVNode as s, unref as e, openBlock as a, normalizeProps as y, mergeProps as k, withCtx as r, createVNode as w, normalizeClass as E, createTextVNode as F, toDisplayString as z } from "vue";
2
2
  import N from "./static-content-wrapper.vue.js";
3
3
  import { SvgIcon as W } from "tmgc2-share";
4
4
  import { ComponentNameEnum as B, WidgetTypeEnum as I } from "../../../../constants/WidgetTypeEnum.js";
@@ -21,7 +21,7 @@ const H = /* @__PURE__ */ _({
21
21
  setup(d, { expose: p }) {
22
22
  const t = d, {
23
23
  loading: l,
24
- executeFunction: c,
24
+ asyncExecuteFunction: c,
25
25
  fieldEditor: m,
26
26
  field: o,
27
27
  size: u,
@@ -29,8 +29,8 @@ const H = /* @__PURE__ */ _({
29
29
  handleHidden: g,
30
30
  handleDisabled: b,
31
31
  defineExposed: h
32
- } = S(t), n = () => {
33
- f || o.options.onClick && c({
32
+ } = S(t), n = async () => {
33
+ f || o.options.onClick && await c({
34
34
  functionBody: o.options.onClick || ""
35
35
  });
36
36
  };
@@ -39,14 +39,14 @@ const H = /* @__PURE__ */ _({
39
39
  handleButtonWidgetClick: n
40
40
  }), (P, V) => {
41
41
  const C = x("a-button");
42
- return e(g) ? s("", !0) : (r(), i(N, k(y({ key: 0 }, t)), {
43
- default: a(() => [
44
- F(C, {
42
+ return e(g) ? s("", !0) : (a(), i(N, y(k({ key: 0 }, t)), {
43
+ default: r(() => [
44
+ w(C, {
45
45
  ref_key: "fieldEditor",
46
46
  ref: m,
47
47
  type: e(o).options.type,
48
48
  size: e(u),
49
- class: w([e(o).options.label === "" ? "hide-text-span" : "", "tpf-button"]),
49
+ class: E([e(o).options.label === "" ? "hide-text-span" : "", "tpf-button"]),
50
50
  shape: e(o).options.shape,
51
51
  danger: e(o).options.danger,
52
52
  ghost: e(o).options.ghost,
@@ -54,12 +54,12 @@ const H = /* @__PURE__ */ _({
54
54
  loading: e(l),
55
55
  onClick: n
56
56
  }, {
57
- default: a(() => [
58
- e(o).options.icon ? (r(), i(e(W), {
57
+ default: r(() => [
58
+ e(o).options.icon ? (a(), i(e(W), {
59
59
  key: 0,
60
60
  "icon-class": e(o).options.icon
61
61
  }, null, 8, ["icon-class"])) : s("", !0),
62
- z(" " + E(e(o).options.label), 1)
62
+ F(" " + z(e(o).options.label), 1)
63
63
  ]),
64
64
  _: 1
65
65
  }, 8, ["type", "size", "class", "shape", "danger", "ghost", "disabled", "loading"])
@@ -1,8 +1,8 @@
1
- import { ref as m, computed as p, unref as F } from "vue";
2
- import { debounce as N, isArray as O } from "lodash-es";
3
- import { translateOptionItems as R } from "../../../../../utils/util.js";
4
- import { useExecFunction as q } from "tmgc2-share";
5
- function D(t, g) {
1
+ import { ref as b, computed as c, unref as N } from "vue";
2
+ import { debounce as R, isArray as w } from "lodash-es";
3
+ import { translateOptionItems as q } from "../../../../../utils/util.js";
4
+ import { useExecFunction as D } from "tmgc2-share";
5
+ function Q(t, g) {
6
6
  if (!Array.isArray(t))
7
7
  return -1;
8
8
  let l = -1;
@@ -10,122 +10,123 @@ function D(t, g) {
10
10
  i === g && (l = s);
11
11
  }), l;
12
12
  }
13
- function U({ field: t, designState: g, fieldModel: l }) {
14
- const i = m({
13
+ function V({ field: t, designState: g, fieldModel: l }) {
14
+ const i = b({
15
15
  val: ""
16
- }), s = m(!1), r = m({
16
+ }), s = b(!1), a = b({
17
17
  page: 1,
18
18
  pageSize: 20,
19
19
  totalPage: 0,
20
20
  total: 0
21
- }), { execHttpFunction: P } = q(), h = async () => {
22
- var e;
21
+ }), { execHttpFunction: E } = D(), h = async () => {
22
+ var o;
23
23
  if (!s.value) {
24
- if (s.value = !0, t.options.dsEnabled && ((e = t.options.http) != null && e.url))
24
+ if (s.value = !0, t.options.dsEnabled && ((o = t.options.http) != null && o.url)) {
25
+ a.value.page === 1 && P();
25
26
  try {
26
- const { http: o, dataHandlerCode: n, dataReqHandlerCode: u } = t.options, a = await P(
27
+ const { http: e, dataHandlerCode: n, dataReqHandlerCode: r } = t.options, m = t.options.loadingPage ? { page: a.value.page, pageSize: a.value.pageSize } : {}, u = await E(
27
28
  {
28
- http: o,
29
+ http: e,
29
30
  dataHandlerCode: n,
30
- dataReqHandlerCode: u
31
+ dataReqHandlerCode: r
31
32
  },
32
- {}
33
+ { data: m }
33
34
  );
34
- if (!a) {
35
+ if (!u) {
35
36
  s.value = !1;
36
37
  return;
37
38
  }
38
- if (O(a)) {
39
- c(a), s.value = !1;
39
+ if (w(u)) {
40
+ p(u), s.value = !1;
40
41
  return;
41
42
  }
42
- O(a.list) && (t.options.loadingPage ? (r.value.total = a.total || 0, r.value.totalPage = a.totalPage || 0, c([...v(), ...a.list])) : c(a.list));
43
- } catch (o) {
44
- console.error("err: ", o);
43
+ w(u.list) && (t.options.loadingPage ? (a.value.total = u.total || 0, a.value.totalPage = u.totalPage || 0, p([...v(), ...u.list])) : p(u.list));
44
+ } catch (e) {
45
+ console.error("err: ", e);
45
46
  }
46
- else
47
- c([...v()]);
47
+ } else
48
+ p([...v()]);
48
49
  s.value = !1;
49
50
  }
50
- }, w = N(function() {
51
- r.value.page += 1, h();
52
- }, 500), E = (e) => {
51
+ }, x = R(function() {
52
+ a.value.page += 1, h();
53
+ }, 500), H = (o) => {
53
54
  if (!t.options.loadingPage) return;
54
- const { target: o } = e, { scrollTop: n, scrollHeight: u, clientHeight: a } = o;
55
- if (u - (n + a) <= 30 && r.value.totalPage > r.value.page) {
56
- if (r.value.totalPage === r.value.page)
55
+ const { target: e } = o, { scrollTop: n, scrollHeight: r, clientHeight: m } = e;
56
+ if (r - (n + m) <= 30 && a.value.totalPage > a.value.page) {
57
+ if (a.value.totalPage === a.value.page)
57
58
  return;
58
- w();
59
+ x();
59
60
  }
60
- }, x = p(() => (t == null ? void 0 : t.options.labelKey) || "label"), b = p(() => (t == null ? void 0 : t.options.valueKey) || "value"), H = p(() => (t == null ? void 0 : t.options.childrenKey) || "children"), y = p(() => ({
61
+ }, C = c(() => (t == null ? void 0 : t.options.labelKey) || "label"), K = c(() => (t == null ? void 0 : t.options.valueKey) || "value"), L = c(() => (t == null ? void 0 : t.options.childrenKey) || "children"), y = c(() => ({
61
62
  label: (t == null ? void 0 : t.options.labelKey) || "label",
62
63
  value: (t == null ? void 0 : t.options.valueKey) || "value",
63
64
  options: "options"
64
- })), K = (e, o) => o[y.value.label].toLowerCase().indexOf(e.toLowerCase()) >= 0, C = () => {
65
- r.value = { page: 1, pageSize: 20, total: 0, totalPage: 0 }, c([]);
66
- }, L = (e) => {
67
- t.options.showSearch && (g || (C(), i.value.val = e, h()));
68
- }, A = p(() => {
65
+ })), S = (o, e) => e[y.value.label].toLowerCase().indexOf(o.toLowerCase()) >= 0, P = () => {
66
+ a.value = { page: 1, pageSize: 20, total: 0, totalPage: 0 }, p([]);
67
+ }, z = (o) => {
68
+ t.options.showSearch && (g || (P(), i.value.val = o, h()));
69
+ }, A = c(() => {
69
70
  var n;
70
- const o = (n = t == null ? void 0 : t.options) == null ? void 0 : n.showSearch;
71
+ const e = (n = t == null ? void 0 : t.options) == null ? void 0 : n.showSearch;
71
72
  return {
72
73
  loading: s.value,
73
74
  fieldNames: y.value,
74
75
  showSearch: !0,
75
- onPopupScroll: E,
76
- onSearch: L,
77
- filterOption: !o && K,
76
+ onPopupScroll: H,
77
+ onSearch: z,
78
+ filterOption: !e && S,
78
79
  listHeight: 240
79
80
  };
80
- }), c = async (e) => {
81
- t.options.optionItems = R(
82
- e,
81
+ }), p = async (o) => {
82
+ t.options.optionItems = q(
83
+ o,
83
84
  t.type,
84
85
  t.options.labelKey || "label",
85
86
  t.options.valueKey || "value"
86
87
  );
87
- }, v = () => t.options.optionItems, k = () => v().find((o) => o[b.value] === l.value), z = p(() => {
88
+ }, v = () => t.options.optionItems, k = () => v().find((e) => e[K.value] === l.value), F = c(() => {
88
89
  if (l.value === null)
89
90
  return "";
90
91
  {
91
- let e = "";
92
- const { valueKey: o, labelKey: n } = t.options;
93
- return t.options.optionItems.forEach((u) => {
94
- (u[o] === l.value || D(l.value, u[o]) !== -1) && (e = e === "" ? u[n] : e + " " + u[n]);
95
- }), e;
92
+ let o = "";
93
+ const { valueKey: e, labelKey: n } = t.options;
94
+ return t.options.optionItems.forEach((r) => {
95
+ (r[e] === l.value || Q(l.value, r[e]) !== -1) && (o = o === "" ? r[n] : o + " " + r[n]);
96
+ }), o;
96
97
  }
97
- }), S = () => {
98
+ }), I = () => {
98
99
  t.options.dsEnabled && t.options.optionItems.splice(0, t.options.optionItems.length);
99
- }, I = (e) => {
100
- const o = t.options.optionItems;
101
- o && o.length > 0 && o.forEach((n) => {
102
- n.value === e && (n.disabled = !0);
100
+ }, O = (o) => {
101
+ const e = t.options.optionItems;
102
+ e && e.length > 0 && e.forEach((n) => {
103
+ n.value === o && (n.disabled = !0);
103
104
  });
104
105
  };
105
106
  return {
106
107
  selectDefineExpose: {
107
108
  getSelectedItem: k,
108
- disableOption: I,
109
- clearOptionItems: S,
110
- enableOption: (e) => {
111
- const o = t.options.optionItems;
112
- o && o.length > 0 && o.forEach((n) => {
113
- n.value === e && (n.disabled = !1);
109
+ disableOption: O,
110
+ clearOptionItems: I,
111
+ enableOption: (o) => {
112
+ const e = t.options.optionItems;
113
+ e && e.length > 0 && e.forEach((n) => {
114
+ n.value === o && (n.disabled = !1);
114
115
  });
115
116
  },
116
117
  getOptionItems: v,
117
- keyword: F(i)
118
+ keyword: N(i)
118
119
  },
119
- disableOption: I,
120
- clearOptionItems: S,
121
- childrenKey: H,
122
- valueKey: b,
123
- labelKey: x,
124
- optionLabel: z,
125
- loadOptions: c,
126
- filterOption: K,
120
+ disableOption: O,
121
+ clearOptionItems: I,
122
+ childrenKey: L,
123
+ valueKey: K,
124
+ labelKey: C,
125
+ optionLabel: F,
126
+ loadOptions: p,
127
+ filterOption: S,
127
128
  keyword: i,
128
- pager: r,
129
+ pager: a,
129
130
  loading: s,
130
131
  fieldNames: y,
131
132
  selectOps: A,
@@ -134,5 +135,5 @@ function U({ field: t, designState: g, fieldModel: l }) {
134
135
  };
135
136
  }
136
137
  export {
137
- U as useSelect
138
+ V as useSelect
138
139
  };
@@ -7,12 +7,12 @@ import { useEmitter as $e } from "../../../../utils/useEmitter.js";
7
7
  import { useAppRef as je } from "../../useAppRef.js";
8
8
  import { useExecFunction as Ge } from "tmgc2-share";
9
9
  function et(t) {
10
- const K = c("getFormConfig", () => ({})), y = c("formData", f({})), Q = c("getReadMode", () => !1), k = c("isSubFormField", !1), D = c("getSubFormName", () => ""), o = c("designState", !1), { registerToRefList: X, getWidgetRef: Y, getFormRef: B, unregisterFromRefList: Z } = je(), { executeFunction: u, asyncExecuteFunction: m } = Ge(), { i18nt: M, i18n2t: _ } = Je(), { field: d } = t, v = f(null), A = f(null), R = f(!1), w = f(!1), l = f([]), O = f({}), H = f({}), p = f(null), h = ze(), { dispatch: E } = $e(), q = s(() => K()), ee = s(() => {
10
+ const K = c("getFormConfig", () => ({})), y = c("formData", f({})), Q = c("getReadMode", () => !1), k = c("isSubFormField", !1), D = c("getSubFormName", () => ""), o = c("designState", !1), { registerToRefList: X, getWidgetRef: Y, getFormRef: B, unregisterFromRefList: Z } = je(), { executeFunction: u, asyncExecuteFunction: g } = Ge(), { i18nt: M, i18n2t: _ } = Je(), { field: d } = t, v = f(null), A = f(null), R = f(!1), w = f(!1), l = f([]), O = f({}), H = f({}), p = f(null), h = ze(), { dispatch: E } = $e(), q = s(() => K()), ee = s(() => {
11
11
  var e;
12
12
  return (e = d == null ? void 0 : d.options) != null && e.size ? d.options.size : q.value.size || "middle";
13
13
  }), b = s(() => D ? D() : ""), a = s({
14
14
  get() {
15
- return Le(y.value, g.value);
15
+ return Le(y.value, m.value);
16
16
  },
17
17
  set(e) {
18
18
  x(e);
@@ -54,17 +54,17 @@ function et(t) {
54
54
  return e.forEach((r, Ne) => {
55
55
  r === n && (i = Ne);
56
56
  }), i;
57
- }, g = s(() => k && !o ? b.value + "." + t.subFormRowIndex + "." + t.field.options.name : t.field.options.name);
57
+ }, m = s(() => k && !o ? b.value + "." + t.subFormRowIndex + "." + t.field.options.name : t.field.options.name);
58
58
  function oe() {
59
59
  o || t.field.options.onCreated && j(async () => {
60
- await m({
60
+ await g({
61
61
  functionBody: t.field.options.onCreated
62
62
  });
63
63
  });
64
64
  }
65
65
  function le() {
66
66
  o || t.field.options.onMounted && j(async () => {
67
- await m({
67
+ await g({
68
68
  functionBody: t.field.options.onMounted
69
69
  });
70
70
  });
@@ -135,8 +135,8 @@ function et(t) {
135
135
  t.subFormRowIndex
136
136
  ]);
137
137
  }, x = (e) => {
138
- o || (E("VFormRender", "fieldValidation", [g.value]), E("VFormRender", "fieldChange", {
139
- fieldName: g.value,
138
+ o || (E("VFormRender", "fieldValidation", [m.value]), E("VFormRender", "fieldChange", {
139
+ fieldName: m.value,
140
140
  value: e,
141
141
  oldValue: $(a.value),
142
142
  field: d
@@ -170,11 +170,11 @@ function et(t) {
170
170
  });
171
171
  }, me = async () => {
172
172
  if (!o && t.field.options.onClick)
173
- return await m({
173
+ return await g({
174
174
  functionBody: t.field.options.onClick
175
175
  });
176
176
  }, ve = async () => {
177
- o || V.value || d.options.onClickIcon && await m({
177
+ o || V.value || d.options.onClickIcon && await g({
178
178
  functionBody: d.options.onClickIcon
179
179
  });
180
180
  }, F = () => v.value, T = (e) => (typeof e == "string" && (e = JSON.parse(e)), We(e) ? e.map((i, r) => ({
@@ -209,7 +209,7 @@ function et(t) {
209
209
  }, xe = (e) => {
210
210
  t.field.options.required = e, C(), !o && !e && P();
211
211
  }, P = () => {
212
- o || B().clearValidate(g.value);
212
+ o || B().clearValidate(m.value);
213
213
  }, Ie = () => B().vfCtx, ke = (e) => {
214
214
  t.field.options.label = e;
215
215
  }, W = () => {
@@ -275,6 +275,7 @@ function et(t) {
275
275
  focus: W
276
276
  };
277
277
  return {
278
+ asyncExecuteFunction: g,
278
279
  executeFunction: u,
279
280
  options: J,
280
281
  customClass: He,
@@ -302,7 +303,7 @@ function et(t) {
302
303
  handleHidden: ne,
303
304
  handleDisabled: V,
304
305
  findInArray: ie,
305
- getPropName: g,
306
+ getPropName: m,
306
307
  refreshDefaultValue: ae,
307
308
  clearFieldRules: N,
308
309
  buildFieldRules: C,
@@ -1,7 +1,7 @@
1
1
  import o from "./data-table-tableColumns-editor.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-ac7b3122"]]);
3
+ import t from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ff49f09d"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,36 +1,38 @@
1
- import { useI18n as g } from "../../utils/i18n.js";
2
- import { message as c } from "ant-design-vue";
3
- import { inject as x, ref as v, getCurrentInstance as F, computed as I } from "vue";
4
- function b(s, l = !1) {
5
- const { i18nt: m } = g(), f = x("refList", s || v(/* @__PURE__ */ new Map())), e = F(), i = I(() => {
6
- var o, r, t;
7
- return (t = (r = (o = e == null ? void 0 : e.exposed) == null ? void 0 : o.field) == null ? void 0 : r.options) == null ? void 0 : t.name;
8
- }), d = () => {
9
- p();
10
- }, n = (o, r) => {
11
- const t = f.value.get(o);
12
- return !t && r && c.error(m("render.hint.refNotFound") + o), t;
13
- }, p = (o) => {
14
- (l ? s == null ? void 0 : s.value : f.value).set(o || i.value, {
15
- instance: e,
16
- proxy: e == null ? void 0 : e.proxy,
17
- ...e == null ? void 0 : e.appContext.config.globalProperties,
18
- ...e == null ? void 0 : e.exposed
1
+ import { useI18n as i } from "../../utils/i18n.js";
2
+ import { message as a } from "ant-design-vue";
3
+ import { inject as c, ref as d, getCurrentInstance as I, computed as g } from "vue";
4
+ function A(t, u) {
5
+ const { i18nt: v } = i(), l = u !== void 0;
6
+ l || (u = c("formWidgetId", ""));
7
+ const p = c("refList", t || d(/* @__PURE__ */ new Map())), o = I(), x = g(() => {
8
+ var r, e, n;
9
+ return (n = (e = (r = o == null ? void 0 : o.exposed) == null ? void 0 : r.field) == null ? void 0 : e.options) == null ? void 0 : n.name;
10
+ }), F = () => {
11
+ m();
12
+ }, f = (r, e) => {
13
+ const s = (l ? t == null ? void 0 : t.value : p.value).get(r);
14
+ return !s && e && a.error(v("render.hint.refNotFound") + r), s;
15
+ }, m = (r) => {
16
+ (l ? t == null ? void 0 : t.value : p.value).set(r || x.value, {
17
+ instance: o,
18
+ proxy: o == null ? void 0 : o.proxy,
19
+ ...o == null ? void 0 : o.appContext.config.globalProperties,
20
+ ...o == null ? void 0 : o.exposed
19
21
  });
20
22
  };
21
23
  return {
22
- refList: f,
23
- getFormRef: () => n("v_form_ref"),
24
- registerToRefList: p,
24
+ refList: p,
25
+ getFormRef: () => f(u),
26
+ registerToRefList: m,
25
27
  unregisterFromRefList: () => {
26
- var r, t, u;
27
- const o = (u = (t = (r = e == null ? void 0 : e.exposed) == null ? void 0 : r.field) == null ? void 0 : t.options) == null ? void 0 : u.name;
28
- f.value.delete(o);
28
+ var e, n, s;
29
+ const r = (s = (n = (e = o == null ? void 0 : o.exposed) == null ? void 0 : e.field) == null ? void 0 : n.options) == null ? void 0 : s.name;
30
+ p.value.delete(r);
29
31
  },
30
- initRefList: d,
31
- getWidgetRef: n
32
+ initRefList: F,
33
+ getWidgetRef: f
32
34
  };
33
35
  }
34
36
  export {
35
- b as useAppRef
37
+ A as useAppRef
36
38
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as L, ref as B, computed as a, resolveComponent as m, createBlock as u, openBlock as s, withCtx as r, createCommentVNode as k, createTextVNode as v, toDisplayString as y } from "vue";
2
- import { useI18n as V } from "../../utils/i18n.js";
3
- import { useExecFunction as O } from "tmgc2-share";
4
- const T = /* @__PURE__ */ L({
1
+ import { defineComponent as S, ref as B, computed as a, resolveComponent as m, createBlock as u, openBlock as s, withCtx as r, createCommentVNode as k, createTextVNode as v, toDisplayString as y } from "vue";
2
+ import { useI18n as L } from "../../utils/i18n.js";
3
+ import { useExecFunction as V } from "tmgc2-share";
4
+ const E = /* @__PURE__ */ S({
5
5
  __name: "SubmitButtonRender",
6
6
  props: {
7
7
  disabled: { type: Boolean },
@@ -13,7 +13,7 @@ const T = /* @__PURE__ */ L({
13
13
  },
14
14
  emits: ["update:dialogVisible"],
15
15
  setup(C, { emit: g }) {
16
- const e = C, b = g, { executeFunction: _, asyncExecuteFunction: d } = O(), l = B(!1), i = B(!1), { i18nt: f } = V(), c = a(() => (e == null ? void 0 : e.options) ?? {}), h = a(() => c.value.cancelButtonHidden != null ? c.value.cancelButtonHidden === 0 : 1), x = a(() => c.value.okButtonHidden != null ? c.value.okButtonHidden === 0 : 1), F = a(
16
+ const e = C, b = g, { asyncExecuteFunction: d } = V(), l = B(!1), i = B(!1), { i18nt: f } = L(), c = a(() => (e == null ? void 0 : e.options) ?? {}), _ = a(() => c.value.cancelButtonHidden != null ? c.value.cancelButtonHidden === 0 : 1), h = a(() => c.value.okButtonHidden != null ? c.value.okButtonHidden === 0 : 1), x = a(
17
17
  () => {
18
18
  var t;
19
19
  return ((t = e.options) == null ? void 0 : t.cancelButtonLabel) || f("designer.hint.cancel");
@@ -39,16 +39,14 @@ const T = /* @__PURE__ */ L({
39
39
  } finally {
40
40
  i.value = !1;
41
41
  }
42
- }, N = async () => {
42
+ }, F = async () => {
43
43
  var t;
44
44
  if (!l.value)
45
45
  try {
46
- l.value = !0;
47
- const n = _({
46
+ if (l.value = !0, await d({
48
47
  context: e.ctx,
49
48
  functionBody: ((t = e.options) == null ? void 0 : t.onOkButtonClick) || ""
50
- });
51
- if (await d(n) === !1) return;
49
+ }) === !1) return;
52
50
  p();
53
51
  } catch (n) {
54
52
  console.error("提交操作失败:", n);
@@ -57,24 +55,24 @@ const T = /* @__PURE__ */ L({
57
55
  }
58
56
  };
59
57
  return (t, n) => {
60
- const o = m("a-button"), S = m("a-space");
61
- return s(), u(S, { x: 8 }, {
58
+ const o = m("a-button"), N = m("a-space");
59
+ return s(), u(N, { x: 8 }, {
62
60
  default: r(() => [
63
- h.value ? (s(), u(o, {
61
+ _.value ? (s(), u(o, {
64
62
  key: "cancelButtonHidden",
65
63
  loading: i.value,
66
64
  onClick: w
67
65
  }, {
68
66
  default: r(() => [
69
- v(y(F.value), 1)
67
+ v(y(x.value), 1)
70
68
  ]),
71
69
  _: 1
72
70
  }, 8, ["loading"])) : k("", !0),
73
- x.value ? (s(), u(o, {
71
+ h.value ? (s(), u(o, {
74
72
  type: "primary",
75
73
  key: "okButtonHidden",
76
74
  loading: l.value,
77
- onClick: N,
75
+ onClick: F,
78
76
  disabled: t.disabled
79
77
  }, {
80
78
  default: r(() => [
@@ -89,5 +87,5 @@ const T = /* @__PURE__ */ L({
89
87
  }
90
88
  });
91
89
  export {
92
- T as default
90
+ E as default
93
91
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./data-table-widget.vue2.js";
2
2
  /* empty css */
3
3
  import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-d5ee76ba"]]);
4
+ const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-d707610a"]]);
5
5
  export {
6
6
  m as default
7
7
  };