@kp-ui/lowcode 2.14.0-beta.1 → 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 (112) 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 -323
  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 +19 -18
  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 +100 -102
  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 -6
  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 +95 -110
  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/event-handler/onVformAdd-editor.vue.js +0 -49
  112. package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
@@ -1,22 +1,27 @@
1
- import { resolveComponent as b, createElementBlock as F, openBlock as m, Fragment as D, createVNode as u, withCtx as g, 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 c, 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传入的表单数据
@@ -149,10 +154,6 @@ const et = {
149
154
  this.isLoading = t;
150
155
  },
151
156
  // 处理回车键事件
152
- handleEnterKey() {
153
- var t;
154
- ((t = this.formConfig) == null ? void 0 : t.isEnterSubmit) === 1 && this.handleOnSubmit();
155
- },
156
157
  handleCancelClick() {
157
158
  if (!this.isClosing && this.handleBeforeClose())
158
159
  try {
@@ -181,7 +182,7 @@ const et = {
181
182
  var e;
182
183
  const t = this.formConfig.serveList;
183
184
  if ((e = t.vformDetail.http) != null && e.url) {
184
- const i = await k.call(this, t.vformDetail, {
185
+ const i = await C.call(this, t.vformDetail, {
185
186
  vfCtx: this.vfCtx
186
187
  });
187
188
  return console.log("res: ", i), i;
@@ -191,7 +192,7 @@ const et = {
191
192
  var i;
192
193
  const t = await this.getFormData(), e = this.formConfig.serveList;
193
194
  if ((i = e.vformDetail.http) != null && i.url) {
194
- const o = await k.call(this, e.vformUpdate, {
195
+ const o = await C.call(this, e.vformUpdate, {
195
196
  data: t,
196
197
  vfCtx: this.vfCtx
197
198
  });
@@ -199,7 +200,7 @@ const et = {
199
200
  }
200
201
  },
201
202
  initFormObject(t = !0) {
202
- 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(() => {
203
204
  this.disableForm();
204
205
  });
205
206
  },
@@ -210,14 +211,14 @@ const et = {
210
211
  return t.type + "-widget";
211
212
  },
212
213
  initLocale() {
213
- const { t, messages: e } = H(), i = e.value[this.getLocale];
214
- 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);
215
216
  },
216
217
  insertCustomStyleAndScriptNode() {
217
- this.formConfig && this.formConfig.cssCode && U(
218
+ this.formConfig && this.formConfig.cssCode && G(
218
219
  this.formConfig.cssCode,
219
220
  this.previewState ? "" : this.formId
220
- ), this.formConfig && this.formConfig.functions && Q(
221
+ ), this.formConfig && this.formConfig.functions && q(
221
222
  this.formConfig.functions,
222
223
  this.previewState ? "" : this.formId
223
224
  );
@@ -268,7 +269,7 @@ const et = {
268
269
  this.formDataModel[e] = f(i);
269
270
  } else {
270
271
  const i = [];
271
- N(t, (r) => {
272
+ K(t, (r) => {
272
273
  i.push(r);
273
274
  });
274
275
  const s = {};
@@ -341,8 +342,17 @@ const et = {
341
342
  handleOnCreated() {
342
343
  this.formConfig && this.formConfig.onFormCreated && new Function(this.formConfig.onFormCreated).call(this);
343
344
  },
344
- handleOnSubmit() {
345
- 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
+ }
346
356
  },
347
357
  handleOnMounted() {
348
358
  this.formConfig && this.formConfig.onFormMounted && new Function(this.formConfig.onFormMounted).call(this);
@@ -352,7 +362,7 @@ const et = {
352
362
  i && i.setDisabled ? i.setDisabled(e) : this.findWidgetOfSubFormAndSetDisabled(t, e);
353
363
  },
354
364
  findWidgetOfSubFormAndSetDisabled(t, e) {
355
- const i = V(
365
+ const i = D(
356
366
  this.formJsonObj.widgetList,
357
367
  t,
358
368
  !0
@@ -367,7 +377,7 @@ const et = {
367
377
  i && i.setDisabled ? i.setHidden(e) : this.findWidgetOfSubFormAndSetHidden(t, e);
368
378
  },
369
379
  findWidgetOfSubFormAndSetHidden(t, e) {
370
- const i = V(
380
+ const i = D(
371
381
  this.formJsonObj.widgetList,
372
382
  t,
373
383
  !0
@@ -383,7 +393,7 @@ const et = {
383
393
  const o = (s, r) => {
384
394
  s.options && s.options.name === t && (i = r.options.name);
385
395
  };
386
- if (q(this.widgetList, o), i) {
396
+ if (z(this.widgetList, o), i) {
387
397
  const s = this.getWidgetRef(i);
388
398
  if (s) {
389
399
  const r = s.getRowIdData();
@@ -399,13 +409,13 @@ const et = {
399
409
  this.getFieldWidgets().forEach((e) => {
400
410
  e.field.options.dsEnabled && e.field.options.dsName && e.field.options.dataSetName && t.add(e.field.options.dsName);
401
411
  }), t.size > 0 && t.forEach(async (e) => {
402
- const i = E(this.formConfig, e);
412
+ const i = F(this.formConfig, e);
403
413
  if (i) {
404
414
  const o = new Object({});
405
- c(o, this.globalDsv || {});
415
+ h(o, this.globalDsv || {});
406
416
  let s = null;
407
417
  try {
408
- s = await j(
418
+ s = await b(
409
419
  i,
410
420
  o,
411
421
  this,
@@ -453,8 +463,8 @@ const et = {
453
463
  return;
454
464
  }
455
465
  this.clearFormDataModel(), this.buildFormModel(e.widgetList);
456
- const i = f(K());
457
- c(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(() => {
458
468
  this.initFormObject(!1), this.initDataSetRequest(), this.handleOnMounted();
459
469
  });
460
470
  } else
@@ -594,14 +604,14 @@ const et = {
594
604
  * @returns {*[]}
595
605
  */
596
606
  getFieldWidgets(t = !1) {
597
- return G(this.formJsonObj.widgetList, t);
607
+ return H(this.formJsonObj.widgetList, t);
598
608
  },
599
609
  /**
600
610
  * 获取所有容器组件
601
611
  * @returns {*[]}
602
612
  */
603
613
  getContainerWidgets() {
604
- return z(this.formJsonObj.widgetList);
614
+ return P(this.formJsonObj.widgetList);
605
615
  },
606
616
  /**
607
617
  * 增加外部组件引用,可通过getEC()方法获取外部组件,以便在VForm内部调用外部组件方法
@@ -654,8 +664,8 @@ const et = {
654
664
  * @param localDsv
655
665
  */
656
666
  async executeDataSource(t, e) {
657
- const i = E(this.formJsonObj.formConfig, t), o = new Object({});
658
- return c(o, this.globalDsv), c(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);
659
669
  },
660
670
  /**
661
671
  * 获取父级VFormRender组件实例
@@ -706,15 +716,15 @@ const et = {
706
716
  * @param extraData
707
717
  */
708
718
  showDialog(t, e = {}, i = {}) {
709
- 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);
710
720
  if (!t || r.type !== "vf-dialog") {
711
721
  this.$message.error(this.i18nt("render.hint.refNotFound") + t);
712
722
  return;
713
723
  }
714
724
  const n = {
715
725
  widgetList: f(r.widgetList),
716
- formConfig: w(o.formConfig)
717
- }, a = L() + "";
726
+ formConfig: p(o.formConfig)
727
+ }, a = c() + "";
718
728
  this.dialogProps = {
719
729
  options: r.options,
720
730
  formJson: n,
@@ -728,15 +738,15 @@ const et = {
728
738
  }, this.$refs.dynamicDialgRef.appContext = this.$root.$.appContext, this.$refs.dynamicDialgRef.show();
729
739
  },
730
740
  showDrawer(t, e = {}, i = {}) {
731
- const o = this.getTopFormRef(), s = R(o.widgetList, t);
741
+ const o = this.getTopFormRef(), s = g(o.widgetList, t);
732
742
  if (!s || s.type !== "vf-drawer") {
733
743
  this.$message.error(this.i18nt("render.hint.refNotFound") + t);
734
744
  return;
735
745
  }
736
746
  const r = {
737
747
  widgetList: f(s.widgetList),
738
- formConfig: w(o.formConfig)
739
- }, n = L() + "", a = u(I, {
748
+ formConfig: p(o.formConfig)
749
+ }, n = c() + "", a = m(X, {
740
750
  options: s.options,
741
751
  formJson: r,
742
752
  formData: e || {},
@@ -747,8 +757,8 @@ const et = {
747
757
  wrapperId: n
748
758
  });
749
759
  a.appContext = this.$root.$.appContext;
750
- const d = document.createElement("div");
751
- 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();
752
762
  },
753
763
  /**
754
764
  * 判断表单是否处于设计器预览状态
@@ -763,68 +773,43 @@ const et = {
763
773
  //--------------------- 以上为组件支持外部调用的API方法 end ------------------//
764
774
  }
765
775
  };
766
- function it(t, e, i, o, s, r) {
767
- const n = b("a-form"), a = b("a-spin"), d = b("DynamicDialog");
768
- return m(), F(D, null, [
769
- u(a, { spinning: s.isLoading }, {
770
- default: g(() => [
771
- x("div", {
772
- style: A(s.isLoading ? "min-height: 260px" : "")
773
- }, [
774
- u(n, {
775
- layout: r.labelPosition,
776
- class: B([[r.customClass, s.readModeFlag ? "readonly-mode-form" : ""], "render-form tpf-form"]),
777
- "label-width": r.labelWidth,
778
- "validate-on-rule-change": !1,
779
- model: s.formDataModel,
780
- ref: "renderForm",
781
- onKeydown: _(r.handleEnterKey, ["enter"])
782
- }, {
783
- default: g(() => [
784
- (m(!0), F(D, null, C(r.widgetList, (l, S) => (m(), F(D, null, [
785
- l.category === "container" ? (m(), W(O(r.getContainerWidgetName(l)), {
786
- widget: l,
787
- key: l.id,
788
- data: s.formDataModel[l.options.name],
789
- "parent-list": r.widgetList,
790
- "index-of-parent-list": S,
791
- "parent-widget": null,
792
- model: s.formDataModel
793
- }, v({ _: 2 }, [
794
- C(Object.keys(t.$slots), (h) => ({
795
- name: h,
796
- fn: g((p) => [
797
- M(t.$slots, h, y({ ref_for: !0 }, p), void 0, !0)
798
- ])
799
- }))
800
- ]), 1032, ["widget", "data", "parent-list", "index-of-parent-list", "model"])) : (m(), W(O(r.getWidgetName(l)), {
801
- field: l,
802
- "form-model": s.formDataModel,
803
- designer: null,
804
- key: l.id,
805
- "parent-list": r.widgetList,
806
- "index-of-parent-list": S,
807
- "parent-widget": null
808
- }, v({ _: 2 }, [
809
- C(Object.keys(t.$slots), (h) => ({
810
- name: h,
811
- fn: g((p) => [
812
- M(t.$slots, h, y({ ref_for: !0 }, p), void 0, !0)
813
- ])
814
- }))
815
- ]), 1032, ["field", "form-model", "parent-list", "index-of-parent-list"]))
816
- ], 64))), 256))
817
- ]),
818
- _: 3
819
- }, 8, ["layout", "class", "label-width", "model", "onKeydown"])
820
- ], 4)
821
- ]),
822
- _: 3
823
- }, 8, ["spinning"]),
824
- 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)
825
810
  ], 64);
826
811
  }
827
- const ut = /* @__PURE__ */ tt(et, [["render", it], ["__scopeId", "data-v-70622583"]]);
812
+ const ct = /* @__PURE__ */ Y(Z, [["render", I], ["__scopeId", "data-v-efb592b3"]]);
828
813
  export {
829
- ut as default
814
+ ct as default
830
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
  };
package/src/lang/en-US.js CHANGED
@@ -171,6 +171,8 @@ const e = {
171
171
  generateSFC: "Generate SFC"
172
172
  },
173
173
  setting: {
174
+ // 序号
175
+ seq: "Seq",
174
176
  containerInputPlaceholder: "Enter the container selector",
175
177
  langMode: "language Mode",
176
178
  editAPIConfig: "Edit API Config",
@@ -182,6 +184,7 @@ const e = {
182
184
  tags: "Tags Mode",
183
185
  buttonList: "Button Group",
184
186
  buttonPosition: "Position",
187
+ autoWidth: "Auto Width",
185
188
  fixed: "Fixed Position",
186
189
  fixedRight: "Fixed Right",
187
190
  resizableColumn: "Resizable Column",
@@ -306,7 +309,6 @@ const e = {
306
309
  customLabelIcon: "Custom Label",
307
310
  labelIconClass: "Label Icon Class",
308
311
  labelIconPosition: "Label Icon Position",
309
- labelTooltip: "Label Tooltip",
310
312
  minValue: "Min Value",
311
313
  maxValue: "Max Value",
312
314
  precision: "Precision",
@@ -322,7 +324,6 @@ const e = {
322
324
  appendButtonDisabled: "Button Disabled",
323
325
  appendButtonIcon: "Append Button Icon",
324
326
  buttonIcon: "Button Icon",
325
- danger: "Danger Button",
326
327
  switchWidth: "Width of Switch(px)",
327
328
  checkedValue: "Active Text",
328
329
  unCheckedValue: "Inactive Text",
@@ -357,10 +358,8 @@ const e = {
357
358
  buttonConfig: "Button Config",
358
359
  placement: "Placement",
359
360
  bottomLeft: "Bottom Left",
360
- bottom: "Bottom Center",
361
361
  bottomRight: "Bottom Right",
362
362
  topLeft: "Top Left",
363
- top: "Top Center",
364
363
  topRight: "Top Right",
365
364
  menuList: "Menu Options",
366
365
  widgetName: "Unique Name",
@@ -414,6 +413,7 @@ const e = {
414
413
  showSummary: "Show Summary",
415
414
  rowSpacing: "Row Spacing(px)",
416
415
  editAction: "Edit...",
416
+ dsEnabled: "Use Datasource",
417
417
  columnName: "Name",
418
418
  columnLabel: "Label",
419
419
  columnWidth: "Width(px/%)",