@kp-ui/lowcode 2.14.0-beta → 2.14.0-beta.10

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 (117) hide show
  1. package/install.js +26 -25
  2. package/package.json +2 -2
  3. package/src/components/FormRender/useFormRender.js +18 -0
  4. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +18 -18
  5. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +18 -20
  6. package/src/components/form-designer/form-widget/container-widget/index.js +6 -6
  7. package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +9 -9
  8. package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +20 -19
  9. package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +32 -39
  10. package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +24 -31
  11. package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +26 -33
  12. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +1 -1
  13. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
  14. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +84 -152
  15. package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +31 -38
  16. package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +23 -30
  17. package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +56 -63
  18. package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
  19. package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +23 -32
  20. package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +26 -33
  21. package/src/components/form-designer/index.vue.js +55 -54
  22. package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +62 -23
  23. package/src/components/form-designer/setting-panel/form-setting.vue.js +2 -2
  24. package/src/components/form-designer/setting-panel/form-setting.vue2.js +81 -94
  25. package/src/components/form-designer/setting-panel/index.vue.js +4 -386
  26. package/src/components/form-designer/setting-panel/index.vue2.js +273 -0
  27. package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue2.js +5 -4
  28. package/src/components/form-designer/setting-panel/property-editor/container-data-table/customRowEvent/data-table-customRow-editor.vue.js +1 -0
  29. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-colorRow-editor.vue2.js +8 -7
  30. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +26 -24
  31. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +1 -0
  32. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue2.js +24 -24
  33. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +9 -8
  34. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
  35. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +13 -12
  36. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue2.js +7 -6
  37. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/line-height-editor.vue2.js +7 -6
  38. package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue.js +2 -40
  39. package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue2.js +41 -0
  40. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue.js +2 -47
  41. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue2.js +44 -0
  42. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue.js +2 -47
  43. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue2.js +43 -0
  44. package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue.js +2 -46
  45. package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue2.js +43 -0
  46. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue.js +2 -47
  47. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue2.js +44 -0
  48. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +2 -66
  49. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue2.js +42 -0
  50. package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue.js +5 -4
  51. package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +6 -5
  52. package/src/components/form-designer/setting-panel/property-editor/index.js +146 -153
  53. package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue.js +8 -7
  54. package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue.js +38 -35
  55. package/src/components/form-designer/setting-panel/propertyRegister.js +3 -18
  56. package/src/components/form-designer/widget-panel/advanced/cascader.js +0 -1
  57. package/src/components/form-designer/widget-panel/advanced/data-table.js +1 -1
  58. package/src/components/form-designer/widget-panel/advanced/file-upload.js +0 -1
  59. package/src/components/form-designer/widget-panel/advanced/rich-editor.js +4 -5
  60. package/src/components/form-designer/widget-panel/advanced/tree-select.js +0 -1
  61. package/src/components/form-designer/widget-panel/basicFields/checkbox.js +2 -3
  62. package/src/components/form-designer/widget-panel/basicFields/color.js +0 -1
  63. package/src/components/form-designer/widget-panel/basicFields/date.js +0 -1
  64. package/src/components/form-designer/widget-panel/basicFields/dateRange.js +0 -1
  65. package/src/components/form-designer/widget-panel/basicFields/input.js +0 -1
  66. package/src/components/form-designer/widget-panel/basicFields/number.js +0 -1
  67. package/src/components/form-designer/widget-panel/basicFields/radio.js +0 -1
  68. package/src/components/form-designer/widget-panel/basicFields/rate.js +5 -6
  69. package/src/components/form-designer/widget-panel/basicFields/select.js +2 -3
  70. package/src/components/form-designer/widget-panel/basicFields/slider.js +0 -1
  71. package/src/components/form-designer/widget-panel/basicFields/switch.js +0 -1
  72. package/src/components/form-designer/widget-panel/basicFields/textarea.js +0 -1
  73. package/src/components/form-designer/widget-panel/basicFields/time.js +0 -1
  74. package/src/components/form-designer/widget-panel/basicFields/timeRange.js +0 -1
  75. package/src/components/form-designer/widget-panel/business/department-select.js +0 -1
  76. package/src/components/form-designer/widget-panel/business/material-select.js +0 -1
  77. package/src/components/form-designer/widget-panel/business/operation-select.js +2 -3
  78. package/src/components/form-designer/widget-panel/business/post-select.js +0 -1
  79. package/src/components/form-designer/widget-panel/business/project-group-select.js +2 -3
  80. package/src/components/form-designer/widget-panel/business/project-select.js +2 -3
  81. package/src/components/form-designer/widget-panel/business/user-select.js +0 -1
  82. package/src/components/form-render/RenderWigetList.vue.js +61 -0
  83. package/src/components/form-render/RenderWigetList.vue2.js +4 -0
  84. package/src/components/form-render/SubmitButtonRender.vue.js +33 -29
  85. package/src/components/form-render/container-item/container-item-wrapper.vue.js +2 -23
  86. package/src/components/form-render/container-item/container-item-wrapper.vue2.js +20 -0
  87. package/src/components/form-render/container-item/data-table-item.vue.js +135 -0
  88. package/src/components/form-render/container-item/grid-col-item.vue.js +149 -0
  89. package/src/components/form-render/container-item/grid-item.vue.js +92 -0
  90. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +319 -0
  91. package/src/components/form-render/container-item/index.js +24 -0
  92. package/src/components/form-render/container-item/sub-form-item.vue.js +398 -0
  93. package/src/components/form-render/container-item/tab-item.vue.js +160 -0
  94. package/src/components/form-render/container-item/table-cell-item.vue.js +95 -0
  95. package/src/components/form-render/container-item/table-item.vue.js +96 -0
  96. package/src/components/form-render/container-item/vf-collapse-item.vue.js +252 -0
  97. package/src/components/form-render/container-item/vf-dialog-item.vue.js +12 -0
  98. package/src/components/form-render/container-item/vf-drawer-item.vue.js +12 -0
  99. package/src/components/form-render/dynamic-dialog.vue.js +66 -81
  100. package/src/components/form-render/index.vue.js +96 -114
  101. package/src/components/http-editor/index.vue.js +10 -10
  102. package/src/components/public/ActionButtonListRender.vue.js +19 -24
  103. package/src/hooks/useLowcode.js +40 -39
  104. package/src/lang/en-US.js +4 -4
  105. package/src/lang/zh-CN.js +3 -4
  106. package/src/mixins/useDataTableMixin.js +18 -23
  107. package/src/utils/useEmitter.js +57 -0
  108. package/src/utils/util.js +50 -49
  109. package/stats.html +1 -1
  110. package/styles/style.css +1 -1
  111. package/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue.js +0 -46
  112. package/src/components/form-designer/setting-panel/property-editor/event-handler/onVformAdd-editor.vue.js +0 -49
  113. package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
  114. package/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue.js +0 -30
  115. package/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue.js +0 -31
  116. package/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue.js +0 -44
  117. package/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue.js +0 -30
@@ -1,22 +1,27 @@
1
- import { resolveComponent as b, createElementBlock as F, openBlock as m, Fragment as D, createVNode as u, withCtx as c, createElementVNode as x, normalizeStyle as A, withKeys as _, normalizeClass as B, renderList as C, createBlock as W, resolveDynamicComponent as O, createSlots as v, renderSlot as M, mergeProps as y, render as J } from "vue";
2
- import P from "../../utils/emitter.js";
3
- import $ from "../form-designer/form-widget/field-widget/index.js";
4
- import { useI18n as H } from "@kp-ui/i18n";
5
- import { buildDefaultFormJson as T, getContainerWidgetByName as R, cloneFormConfigWithoutEventHandler as w, deepClone as f, getDSByName as E, overwriteObj as g, runDataSourceRequest as j, getAllContainerWidgets as z, getAllFieldWidgets as G, getDefaultFormConfig as K, traverseFieldWidgets as q, getFieldWidgetByName as V, traverseFieldWidgetsOfContainer as N, insertCustomCssToHead as U, insertGlobalFunctionsToHtml as Q, generateId as L } from "../../utils/util.js";
6
- import X, { setLangMessages as Y } from "../../utils/i18n.js";
7
- import Z from "./dynamic-dialog.vue.js";
1
+ import { resolveComponent as d, createElementBlock as S, openBlock as u, Fragment as W, createElementVNode as v, createVNode as m, normalizeStyle as O, createBlock as M, createCommentVNode as w, withKeys as E, normalizeClass as V, withCtx as j, mergeProps as k, render as x } from "vue";
2
+ import A from "../../utils/emitter.js";
3
+ import { useI18n as _ } from "@kp-ui/i18n";
4
+ import B from "./RenderWigetList.vue.js";
5
+ import { Skeleton as $ } from "ant-design-vue";
6
+ import { buildDefaultFormJson as J, getContainerWidgetByName as g, cloneFormConfigWithoutEventHandler as p, deepClone as f, getDSByName as F, overwriteObj as h, runDataSourceRequest as b, getAllContainerWidgets as P, getAllFieldWidgets as H, getDefaultFormConfig as T, traverseFieldWidgets as z, getFieldWidgetByName as D, traverseFieldWidgetsOfContainer as K, insertCustomCssToHead as G, insertGlobalFunctionsToHtml as q, generateId as c } from "../../utils/util.js";
7
+ import U, { setLangMessages as N } from "../../utils/i18n.js";
8
+ import Q from "./dynamic-dialog.vue.js";
8
9
  /* empty css */
9
- import I from "./dynamic-drawer.vue.js";
10
- import { fmtHttpParams as k } from "../../utils/request/fmtHttpParams.js";
10
+ import X from "./dynamic-drawer.vue.js";
11
+ import { fmtHttpParams as C } from "../../utils/request/fmtHttpParams.js";
12
+ import { executeFunction as y } from "../../utils/executeFunction.js";
11
13
  /* empty css */
12
- import tt from "../../../_virtual/_plugin-vue_export-helper.js";
13
- const et = {
14
+ import Y from "../../../_virtual/_plugin-vue_export-helper.js";
15
+ const Z = {
14
16
  name: "VFormRender",
15
17
  componentName: "VFormRender",
16
- mixins: [P, X],
18
+ inheritAttrs: !1,
19
+ mixins: [A, U],
17
20
  components: {
18
- DynamicDialog: Z,
19
- ...$
21
+ Skeleton: $,
22
+ RenderWigetList: B,
23
+ DynamicDialog: Q
24
+ // ...FieldComponents
20
25
  },
21
26
  props: {
22
27
  vfCtx: {
@@ -26,7 +31,7 @@ const et = {
26
31
  formJson: {
27
32
  //prop传入的表单JSON配置
28
33
  type: Object,
29
- default: () => T()
34
+ default: () => J()
30
35
  },
31
36
  formData: {
32
37
  //prop传入的表单数据
@@ -138,11 +143,8 @@ const et = {
138
143
  return this.formConfig && this.formConfig.customClass ? this.formConfig.customClass : "";
139
144
  }
140
145
  },
141
- watch: {
142
- //
143
- },
144
146
  created() {
145
- this.isLoading = !1, this.buildFormModel(this.formJsonObj ? this.formJsonObj.widgetList : null), this.initFormObject(), console.log({ te: this });
147
+ this.isLoading = !1, this.buildFormModel(this.formJsonObj ? this.formJsonObj.widgetList : null), this.initFormObject();
146
148
  },
147
149
  mounted() {
148
150
  this.initLocale(), this.initDataSetRequest();
@@ -152,10 +154,6 @@ const et = {
152
154
  this.isLoading = t;
153
155
  },
154
156
  // 处理回车键事件
155
- handleEnterKey() {
156
- var t;
157
- ((t = this.formConfig) == null ? void 0 : t.isEnterSubmit) === 1 && this.handleOnSubmit();
158
- },
159
157
  handleCancelClick() {
160
158
  if (!this.isClosing && this.handleBeforeClose())
161
159
  try {
@@ -184,7 +182,7 @@ const et = {
184
182
  var e;
185
183
  const t = this.formConfig.serveList;
186
184
  if ((e = t.vformDetail.http) != null && e.url) {
187
- const i = await k.call(this, t.vformDetail, {
185
+ const i = await C.call(this, t.vformDetail, {
188
186
  vfCtx: this.vfCtx
189
187
  });
190
188
  return console.log("res: ", i), i;
@@ -194,7 +192,7 @@ const et = {
194
192
  var i;
195
193
  const t = await this.getFormData(), e = this.formConfig.serveList;
196
194
  if ((i = e.vformDetail.http) != null && i.url) {
197
- const o = await k.call(this, e.vformUpdate, {
195
+ const o = await C.call(this, e.vformUpdate, {
198
196
  data: t,
199
197
  vfCtx: this.vfCtx
200
198
  });
@@ -202,7 +200,7 @@ const et = {
202
200
  }
203
201
  },
204
202
  initFormObject(t = !0) {
205
- this.formId = "vfRender" + L(), t && !this.dynamicCreation && this.insertCustomStyleAndScriptNode(), this.addFieldChangeEventHandler(), this.addFieldValidateEventHandler(), this.registerFormToRefList(), this.handleOnCreated(), this.disabledMode && this.$nextTick(() => {
203
+ this.formId = "vfRender" + c(), t && !this.dynamicCreation && this.insertCustomStyleAndScriptNode(), this.addFieldChangeEventHandler(), this.addFieldValidateEventHandler(), this.registerFormToRefList(), this.handleOnCreated(), this.disabledMode && this.$nextTick(() => {
206
204
  this.disableForm();
207
205
  });
208
206
  },
@@ -213,14 +211,14 @@ const et = {
213
211
  return t.type + "-widget";
214
212
  },
215
213
  initLocale() {
216
- const { t, messages: e } = H(), i = e.value[this.getLocale];
217
- i && Y(this.getLocale, i.lang), this.changeLanguage(this.getLocale);
214
+ const { t, messages: e } = _(), i = e.value[this.getLocale];
215
+ i && N(this.getLocale, i.lang), this.changeLanguage(this.getLocale);
218
216
  },
219
217
  insertCustomStyleAndScriptNode() {
220
- this.formConfig && this.formConfig.cssCode && U(
218
+ this.formConfig && this.formConfig.cssCode && G(
221
219
  this.formConfig.cssCode,
222
220
  this.previewState ? "" : this.formId
223
- ), this.formConfig && this.formConfig.functions && Q(
221
+ ), this.formConfig && this.formConfig.functions && q(
224
222
  this.formConfig.functions,
225
223
  this.previewState ? "" : this.formId
226
224
  );
@@ -271,7 +269,7 @@ const et = {
271
269
  this.formDataModel[e] = f(i);
272
270
  } else {
273
271
  const i = [];
274
- N(t, (r) => {
272
+ K(t, (r) => {
275
273
  i.push(r);
276
274
  });
277
275
  const s = {};
@@ -344,8 +342,17 @@ const et = {
344
342
  handleOnCreated() {
345
343
  this.formConfig && this.formConfig.onFormCreated && new Function(this.formConfig.onFormCreated).call(this);
346
344
  },
347
- handleOnSubmit() {
348
- this.formConfig && this.formConfig.handleOnSubmit && new Function(this.formConfig.handleOnSubmit).call(this);
345
+ onFormEnterKey() {
346
+ if (this.formConfig && this.formConfig.onFormEnterKey) {
347
+ const t = y({
348
+ functionBody: this.formConfig.onFormEnterKey,
349
+ context: this
350
+ });
351
+ t && y({
352
+ functionBody: t,
353
+ context: this
354
+ });
355
+ }
349
356
  },
350
357
  handleOnMounted() {
351
358
  this.formConfig && this.formConfig.onFormMounted && new Function(this.formConfig.onFormMounted).call(this);
@@ -355,7 +362,7 @@ const et = {
355
362
  i && i.setDisabled ? i.setDisabled(e) : this.findWidgetOfSubFormAndSetDisabled(t, e);
356
363
  },
357
364
  findWidgetOfSubFormAndSetDisabled(t, e) {
358
- const i = V(
365
+ const i = D(
359
366
  this.formJsonObj.widgetList,
360
367
  t,
361
368
  !0
@@ -370,7 +377,7 @@ const et = {
370
377
  i && i.setDisabled ? i.setHidden(e) : this.findWidgetOfSubFormAndSetHidden(t, e);
371
378
  },
372
379
  findWidgetOfSubFormAndSetHidden(t, e) {
373
- const i = V(
380
+ const i = D(
374
381
  this.formJsonObj.widgetList,
375
382
  t,
376
383
  !0
@@ -386,7 +393,7 @@ const et = {
386
393
  const o = (s, r) => {
387
394
  s.options && s.options.name === t && (i = r.options.name);
388
395
  };
389
- if (q(this.widgetList, o), i) {
396
+ if (z(this.widgetList, o), i) {
390
397
  const s = this.getWidgetRef(i);
391
398
  if (s) {
392
399
  const r = s.getRowIdData();
@@ -402,13 +409,13 @@ const et = {
402
409
  this.getFieldWidgets().forEach((e) => {
403
410
  e.field.options.dsEnabled && e.field.options.dsName && e.field.options.dataSetName && t.add(e.field.options.dsName);
404
411
  }), t.size > 0 && t.forEach(async (e) => {
405
- const i = E(this.formConfig, e);
412
+ const i = F(this.formConfig, e);
406
413
  if (i) {
407
414
  const o = new Object({});
408
- g(o, this.globalDsv || {});
415
+ h(o, this.globalDsv || {});
409
416
  let s = null;
410
417
  try {
411
- s = await j(
418
+ s = await b(
412
419
  i,
413
420
  o,
414
421
  this,
@@ -456,8 +463,8 @@ const et = {
456
463
  return;
457
464
  }
458
465
  this.clearFormDataModel(), this.buildFormModel(e.widgetList);
459
- const i = f(K());
460
- g(i, e.formConfig), this.formJsonObj.formConfig = i, this.formJsonObj.widgetList = e.widgetList, this.insertCustomStyleAndScriptNode(), this.$nextTick(() => {
466
+ const i = f(T());
467
+ h(i, e.formConfig), this.formJsonObj.formConfig = i, this.formJsonObj.widgetList = e.widgetList, this.insertCustomStyleAndScriptNode(), this.$nextTick(() => {
461
468
  this.initFormObject(!1), this.initDataSetRequest(), this.handleOnMounted();
462
469
  });
463
470
  } else
@@ -597,14 +604,14 @@ const et = {
597
604
  * @returns {*[]}
598
605
  */
599
606
  getFieldWidgets(t = !1) {
600
- return G(this.formJsonObj.widgetList, t);
607
+ return H(this.formJsonObj.widgetList, t);
601
608
  },
602
609
  /**
603
610
  * 获取所有容器组件
604
611
  * @returns {*[]}
605
612
  */
606
613
  getContainerWidgets() {
607
- return z(this.formJsonObj.widgetList);
614
+ return P(this.formJsonObj.widgetList);
608
615
  },
609
616
  /**
610
617
  * 增加外部组件引用,可通过getEC()方法获取外部组件,以便在VForm内部调用外部组件方法
@@ -657,8 +664,8 @@ const et = {
657
664
  * @param localDsv
658
665
  */
659
666
  async executeDataSource(t, e) {
660
- const i = E(this.formJsonObj.formConfig, t), o = new Object({});
661
- return g(o, this.globalDsv), g(o, e), await j(i, o, this, !1, this.$message);
667
+ const i = F(this.formJsonObj.formConfig, t), o = new Object({});
668
+ return h(o, this.globalDsv), h(o, e), await b(i, o, this, !1, this.$message);
662
669
  },
663
670
  /**
664
671
  * 获取父级VFormRender组件实例
@@ -709,15 +716,15 @@ const et = {
709
716
  * @param extraData
710
717
  */
711
718
  showDialog(t, e = {}, i = {}) {
712
- const o = this.getTopFormRef(), s = this.getFormRef(), r = R(o.widgetList, t) || R(s.widgetList, t);
719
+ const o = this.getTopFormRef(), s = this.getFormRef(), r = g(o.widgetList, t) || g(s.widgetList, t);
713
720
  if (!t || r.type !== "vf-dialog") {
714
721
  this.$message.error(this.i18nt("render.hint.refNotFound") + t);
715
722
  return;
716
723
  }
717
724
  const n = {
718
725
  widgetList: f(r.widgetList),
719
- formConfig: w(o.formConfig)
720
- }, a = L() + "";
726
+ formConfig: p(o.formConfig)
727
+ }, a = c() + "";
721
728
  this.dialogProps = {
722
729
  options: r.options,
723
730
  formJson: n,
@@ -731,15 +738,15 @@ const et = {
731
738
  }, this.$refs.dynamicDialgRef.appContext = this.$root.$.appContext, this.$refs.dynamicDialgRef.show();
732
739
  },
733
740
  showDrawer(t, e = {}, i = {}) {
734
- const o = this.getTopFormRef(), s = R(o.widgetList, t);
741
+ const o = this.getTopFormRef(), s = g(o.widgetList, t);
735
742
  if (!s || s.type !== "vf-drawer") {
736
743
  this.$message.error(this.i18nt("render.hint.refNotFound") + t);
737
744
  return;
738
745
  }
739
746
  const r = {
740
747
  widgetList: f(s.widgetList),
741
- formConfig: w(o.formConfig)
742
- }, n = L() + "", a = u(I, {
748
+ formConfig: p(o.formConfig)
749
+ }, n = c() + "", a = m(X, {
743
750
  options: s.options,
744
751
  formJson: r,
745
752
  formData: e || {},
@@ -750,8 +757,8 @@ const et = {
750
757
  wrapperId: n
751
758
  });
752
759
  a.appContext = this.$root.$.appContext;
753
- const d = document.createElement("div");
754
- d.id = "vf-dynamic-drawer-wrapper" + n, document.body.appendChild(d), J(a, d), document.body.appendChild(a.el), a.component.ctx.show();
760
+ const l = document.createElement("div");
761
+ l.id = "vf-dynamic-drawer-wrapper" + n, document.body.appendChild(l), x(a, l), document.body.appendChild(a.el), a.component.ctx.show();
755
762
  },
756
763
  /**
757
764
  * 判断表单是否处于设计器预览状态
@@ -766,68 +773,43 @@ const et = {
766
773
  //--------------------- 以上为组件支持外部调用的API方法 end ------------------//
767
774
  }
768
775
  };
769
- function it(t, e, i, o, s, r) {
770
- const n = b("a-form"), a = b("a-spin"), d = b("DynamicDialog");
771
- return m(), F(D, null, [
772
- u(a, { spinning: s.isLoading }, {
773
- default: c(() => [
774
- x("div", {
775
- style: A(s.isLoading ? "min-height: 260px" : "")
776
- }, [
777
- u(n, {
778
- layout: r.labelPosition,
779
- class: B([[r.customClass, s.readModeFlag ? "readonly-mode-form" : ""], "render-form tpf-form"]),
780
- "label-width": r.labelWidth,
781
- "validate-on-rule-change": !1,
782
- model: s.formDataModel,
783
- ref: "renderForm",
784
- onKeydown: _(r.handleEnterKey, ["enter"])
785
- }, {
786
- default: c(() => [
787
- (m(!0), F(D, null, C(r.widgetList, (l, S) => (m(), F(D, null, [
788
- l.category === "container" ? (m(), W(O(r.getContainerWidgetName(l)), {
789
- widget: l,
790
- key: l.id,
791
- data: s.formDataModel[l.options.name],
792
- "parent-list": r.widgetList,
793
- "index-of-parent-list": S,
794
- "parent-widget": null,
795
- model: s.formDataModel
796
- }, v({ _: 2 }, [
797
- C(Object.keys(t.$slots), (h) => ({
798
- name: h,
799
- fn: c((p) => [
800
- M(t.$slots, h, y({ ref_for: !0 }, p), void 0, !0)
801
- ])
802
- }))
803
- ]), 1032, ["widget", "data", "parent-list", "index-of-parent-list", "model"])) : (m(), W(O(r.getWidgetName(l)), {
804
- field: l,
805
- "form-model": s.formDataModel,
806
- designer: null,
807
- key: l.id,
808
- "parent-list": r.widgetList,
809
- "index-of-parent-list": S,
810
- "parent-widget": null
811
- }, v({ _: 2 }, [
812
- C(Object.keys(t.$slots), (h) => ({
813
- name: h,
814
- fn: c((p) => [
815
- M(t.$slots, h, y({ ref_for: !0 }, p), void 0, !0)
816
- ])
817
- }))
818
- ]), 1032, ["field", "form-model", "parent-list", "index-of-parent-list"]))
819
- ], 64))), 256))
820
- ]),
821
- _: 3
822
- }, 8, ["layout", "class", "label-width", "model", "onKeydown"])
823
- ], 4)
824
- ]),
825
- _: 3
826
- }, 8, ["spinning"]),
827
- u(d, y(s.dialogProps, { ref: "dynamicDialgRef" }), null, 16)
776
+ function I(t, e, i, o, s, r) {
777
+ const n = d("Skeleton"), a = d("RenderWigetList"), l = d("a-form"), R = d("DynamicDialog");
778
+ return u(), S(W, null, [
779
+ v("div", {
780
+ class: "form-render-container",
781
+ style: O(s.isLoading ? "min-height: 260px" : "")
782
+ }, [
783
+ s.isLoading ? (u(), M(n, {
784
+ key: 0,
785
+ class: "skeleton-form",
786
+ active: "",
787
+ loading: !0
788
+ })) : w("", !0),
789
+ m(l, {
790
+ layout: r.labelPosition,
791
+ class: V([[r.customClass, s.readModeFlag ? "readonly-mode-form" : ""], "render-form tpf-form"]),
792
+ "label-width": r.labelWidth,
793
+ "validate-on-rule-change": !1,
794
+ model: s.formDataModel,
795
+ ref: "renderForm",
796
+ onKeydown: E(r.onFormEnterKey, ["enter"])
797
+ }, {
798
+ default: j(() => [
799
+ m(a, {
800
+ "parent-widget": null,
801
+ "widget-list": r.widgetList,
802
+ formDataModel: s.formDataModel,
803
+ "onUpdate:formDataModel": e[0] || (e[0] = (L) => s.formDataModel = L)
804
+ }, null, 8, ["widget-list", "formDataModel"])
805
+ ]),
806
+ _: 1
807
+ }, 8, ["layout", "class", "label-width", "model", "onKeydown"])
808
+ ], 4),
809
+ m(R, k(s.dialogProps, { ref: "dynamicDialgRef" }), null, 16)
828
810
  ], 64);
829
811
  }
830
- const ut = /* @__PURE__ */ tt(et, [["render", it], ["__scopeId", "data-v-4214c6c8"]]);
812
+ const ct = /* @__PURE__ */ Y(Z, [["render", I], ["__scopeId", "data-v-efb592b3"]]);
831
813
  export {
832
- ut as default
814
+ ct as default
833
815
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as m, mergeModels as s, useModel as f, ref as b, resolveComponent as i, createElementBlock as c, openBlock as g, Fragment as v, createVNode as a, withCtx as r, normalizeClass as M, createTextVNode as w, toDisplayString as x, unref as C } from "vue";
1
+ import { defineComponent as p, mergeModels as s, useModel as f, ref as b, resolveComponent as i, createElementBlock as c, openBlock as g, Fragment as v, createVNode as a, withCtx as d, normalizeClass as M, createTextVNode as w, toDisplayString as x, unref as C } from "vue";
2
2
  import { HttpEditor as h } from "tmgc2-share";
3
3
  import "../../utils/i18n.js";
4
- const N = /* @__PURE__ */ m({
4
+ const k = /* @__PURE__ */ p({
5
5
  __name: "index",
6
6
  props: /* @__PURE__ */ s({
7
7
  drawerTitle: {
@@ -35,25 +35,25 @@ const N = /* @__PURE__ */ m({
35
35
  }),
36
36
  emits: ["update:optionModel"],
37
37
  setup(e) {
38
- const n = f(e, "optionModel"), o = b(!1), d = () => {
38
+ const n = f(e, "optionModel"), o = b(!1), r = () => {
39
39
  o.value = !0;
40
40
  };
41
41
  return (S, t) => {
42
- const u = i("a-button"), p = i("a-form-item");
42
+ const u = i("a-button"), m = i("a-form-item");
43
43
  return g(), c(v, null, [
44
- a(p, {
44
+ a(m, {
45
45
  label: e.label,
46
46
  labelAlign: "left",
47
47
  "label-width": "150px"
48
48
  }, {
49
- default: r(() => [
49
+ default: d(() => [
50
50
  a(u, {
51
51
  shape: "round",
52
- onClick: d,
52
+ onClick: r,
53
53
  class: M(["button-text-highlight"])
54
54
  }, {
55
- default: r(() => [
56
- w(x(e.buttonName), 1)
55
+ default: d(() => [
56
+ w(x(e.buttonName || e.label), 1)
57
57
  ]),
58
58
  _: 1
59
59
  })
@@ -72,5 +72,5 @@ const N = /* @__PURE__ */ m({
72
72
  }
73
73
  });
74
74
  export {
75
- N as default
75
+ k as default
76
76
  };
@@ -1,21 +1,21 @@
1
- import b from "./ActionButtonListRender.vue2.js";
2
- import { resolveComponent as t, createElementBlock as s, openBlock as n, normalizeStyle as f, normalizeClass as _, createBlock as c, Teleport as m, createVNode as a, withCtx as l, Fragment as r, renderList as g, createCommentVNode as y, createTextVNode as k, toDisplayString as v } from "vue";
1
+ import d from "./ActionButtonListRender.vue2.js";
2
+ import { resolveComponent as n, createElementBlock as s, openBlock as t, normalizeStyle as p, normalizeClass as u, createBlock as a, Teleport as b, createVNode as f, withCtx as l, Fragment as _, renderList as m, createCommentVNode as y, createTextVNode as k, toDisplayString as C } from "vue";
3
3
  /* empty css */
4
- import C from "../../../_virtual/_plugin-vue_export-helper.js";
5
- function S(o, B, I, $, h, z) {
6
- const i = t("SvgIcon"), d = t("SvgIcon2"), p = t("a-button"), u = t("a-space");
7
- return n(), s("div", {
4
+ import g from "../../../_virtual/_plugin-vue_export-helper.js";
5
+ function v(o, B, S, $, h, z) {
6
+ const r = n("SvgIcon"), c = n("a-button"), i = n("a-space");
7
+ return t(), s("div", {
8
8
  ref: "fieldEditor",
9
- class: _(["button-list-container", ...o.customClass]),
10
- style: f(o.containerStyle)
9
+ class: u(["button-list-container", ...o.customClass]),
10
+ style: p(o.containerStyle)
11
11
  }, [
12
- (n(), c(m, {
12
+ (t(), a(b, {
13
13
  disabled: o.isDisabled,
14
14
  to: o.getContainer
15
15
  }, [
16
- a(u, { size: 8 }, {
16
+ f(i, { size: 8 }, {
17
17
  default: l(() => [
18
- (n(!0), s(r, null, g(o.visibleButtons, (e) => (n(), c(p, {
18
+ (t(!0), s(_, null, m(o.visibleButtons, (e) => (t(), a(c, {
19
19
  key: e.key,
20
20
  type: e.type,
21
21
  danger: e.danger,
@@ -24,17 +24,12 @@ function S(o, B, I, $, h, z) {
24
24
  onClick: (D) => o.handleClick(e)
25
25
  }, {
26
26
  default: l(() => [
27
- e.icon ? (n(), s(r, { key: 0 }, [
28
- a(i, {
29
- "icon-class": e.icon,
30
- class: "button-icon"
31
- }, null, 8, ["icon-class"]),
32
- a(d, {
33
- "icon-class": e.icon,
34
- class: "button-icon"
35
- }, null, 8, ["icon-class"])
36
- ], 64)) : y("", !0),
37
- k(" " + v(e.label), 1)
27
+ e.icon ? (t(), a(r, {
28
+ key: 0,
29
+ "icon-class": e.icon,
30
+ class: "button-icon"
31
+ }, null, 8, ["icon-class"])) : y("", !0),
32
+ k(" " + C(e.label), 1)
38
33
  ]),
39
34
  _: 2
40
35
  }, 1032, ["type", "danger", "disabled", "onClick"]))), 128))
@@ -44,7 +39,7 @@ function S(o, B, I, $, h, z) {
44
39
  ], 8, ["disabled", "to"]))
45
40
  ], 6);
46
41
  }
47
- const T = /* @__PURE__ */ C(b, [["render", S], ["__scopeId", "data-v-8bf7bfc0"]]);
42
+ const L = /* @__PURE__ */ g(d, [["render", v], ["__scopeId", "data-v-a5c375c2"]]);
48
43
  export {
49
- T as default
44
+ L as default
50
45
  };
@@ -1,13 +1,14 @@
1
- import v from "../components/form-render/index.vue.js";
1
+ import w from "../components/form-render/index.vue.js";
2
2
  import { basicFieldsEnums as y } from "../components/form-designer/widget-panel/basicFieldsEnums.js";
3
- import { getUuidKey as w } from "@kp-ui/tool";
4
- import { useDataQueryApi as L, useComRef as R, useRouteBackTab as P, routerReloadStatus as N } from "tmgc2-share";
3
+ import { getUuidKey as L } from "@kp-ui/tool";
4
+ import { useDataQueryApi as R, useComRef as P, useRouteBackTab as N, routerReloadStatus as j } from "tmgc2-share";
5
5
  import { ref as g } from "vue";
6
- const Q = (C) => {
7
- const { formCode: d, entityCode: l, type: h } = C, r = g(!1), f = L(), s = R(v), u = g(), { routeBackTab: b } = P(), F = (t = []) => {
8
- const o = {
6
+ const S = (C) => {
7
+ let { formCode: i, entityCode: l, type: h = "add" } = C;
8
+ const a = g(!1), f = R(), r = P(w), u = g(), { routeBackTab: b } = N(), F = (o = []) => {
9
+ const e = {
9
10
  label: "提交",
10
- name: w(),
11
+ name: L(),
11
12
  onCreated: `
12
13
  const hidden = this.getFormRef().vfCtx?.type==='view';
13
14
  this.setHidden(hidden)
@@ -21,64 +22,64 @@ const Q = (C) => {
21
22
  }
22
23
  })()`
23
24
  };
24
- return t.push(y.button(o)), t;
25
- }, m = (t = []) => {
26
- const e = t.reduce((o, n) => {
27
- const i = y[n.componentType];
28
- if (i) {
29
- const c = i({
25
+ return o.push(y.button(e)), o;
26
+ }, m = (o = []) => {
27
+ const t = o.reduce((e, n) => {
28
+ const s = y[n.componentType];
29
+ if (s) {
30
+ const d = s({
30
31
  name: n.entityPropertyCode,
31
32
  label: n.entityPropertyName,
32
33
  ...n.options
33
34
  });
34
- o = [...o, c];
35
+ e = [...e, d];
35
36
  }
36
- return o;
37
+ return e;
37
38
  }, []);
38
- return e.length ? F(e) : e;
39
- }, a = async (t = []) => {
40
- var o, n;
39
+ return t.length ? F(t) : t;
40
+ }, c = async (o = [], t) => {
41
+ var n, s;
41
42
  let e = { widgetList: [], formConfig: {} };
42
- if (d && h) {
43
- (o = s.value) == null || o.setLoading(!0);
43
+ if (i = t || i, i && h) {
44
+ (n = r.value) == null || n.setLoading(!0);
44
45
  try {
45
- const i = await f.dataQueryDetail({ code: d }, "FormDefinitionManagement").then((c) => c.data.object || {});
46
- e = JSON.parse(i.frontendDefinition || "{}");
46
+ const d = await f.dataQueryDetail({ code: i }, "FormDefinitionManagement").then((v) => v.data.object || {});
47
+ e = JSON.parse(d.frontendDefinition || "{}");
47
48
  } finally {
48
- (n = s.value) == null || n.setLoading(!1);
49
+ (s = r.value) == null || s.setLoading(!1);
49
50
  }
50
51
  } else
51
- e.widgetList = m(t);
52
- return r.value = !1, console.log("json: ", e), u.value = e.formConfig, s.value.setFormJson(e), e;
52
+ e.widgetList = m(o);
53
+ return a.value = !1, console.log("json: ", e), u.value = e.formConfig, r.value.setFormJson(e), e;
53
54
  }, p = async () => {
54
- if (r.value = !0, !l)
55
- return a([]), [];
56
- const t = {
55
+ if (a.value = !0, !l)
56
+ return c([]), [];
57
+ const o = {
57
58
  pageCode: "EntityPropertyFormItem",
58
59
  conditions: [{ fieldCode: "entityCode", type: "EQ", value: l }],
59
60
  requiredFields: ["entityPropertyCode", "entityPropertyName", "valueType"],
60
61
  page: 1,
61
62
  pageSize: null,
62
63
  sorts: []
63
- }, e = await f.execute(t).then((o) => o.data.object.list);
64
- return a(e), e;
64
+ }, t = await f.execute(o).then((e) => e.data.object.list);
65
+ return c(t), t;
65
66
  };
66
67
  return {
67
- isLoading: r,
68
- goBack: (t = N.view) => {
69
- b(t);
68
+ isLoading: a,
69
+ goBack: (o = j.view) => {
70
+ b(o);
70
71
  },
71
72
  formConfig: u,
72
73
  getInitRenderJSON: m,
73
- vfdRef: s,
74
- getComponentJson: a,
74
+ vfdRef: r,
75
+ getComponentJson: c,
75
76
  getFieldList: p,
76
- fieldListApi: async () => (await p()).map((e) => ({
77
- showName: e.entityPropertyName,
78
- fieldCode: e.entityPropertyCode
77
+ fieldListApi: async () => (await p()).map((t) => ({
78
+ showName: t.entityPropertyName,
79
+ fieldCode: t.entityPropertyCode
79
80
  }))
80
81
  };
81
82
  };
82
83
  export {
83
- Q as useLowcode
84
+ S as useLowcode
84
85
  };