@kp-ui/lowcode 2.14.0-beta.2 → 2.14.0-beta.20

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 (90) hide show
  1. package/package.json +1 -1
  2. package/src/components/FormRender/useFormRender.js +18 -0
  3. package/src/components/form-designer/designer.js +78 -75
  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/vf-box-item.vue.js +9 -9
  7. package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +29 -21
  8. package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +32 -39
  9. package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +24 -31
  10. package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +26 -33
  11. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +4 -4
  12. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
  13. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +84 -152
  14. package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +31 -38
  15. package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +23 -30
  16. package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +56 -63
  17. package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
  18. package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +23 -32
  19. package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +26 -33
  20. package/src/components/form-designer/setting-panel/form-setting.vue.js +2 -2
  21. package/src/components/form-designer/setting-panel/form-setting.vue2.js +81 -94
  22. package/src/components/form-designer/setting-panel/index.vue.js +2 -2
  23. package/src/components/form-designer/setting-panel/index.vue2.js +135 -135
  24. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-colorRow-editor.vue2.js +8 -7
  25. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +23 -22
  26. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
  27. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +7 -7
  28. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/formCode-editor.vue.js +25 -19
  29. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/line-height-editor.vue2.js +7 -6
  30. package/src/components/form-designer/setting-panel/property-editor/index.js +41 -42
  31. package/src/components/form-designer/setting-panel/propertyRegister.js +3 -6
  32. package/src/components/form-designer/widget-panel/PanelItemDrag.vue.js +50 -0
  33. package/src/components/form-designer/widget-panel/PanelItemDrag.vue2.js +4 -0
  34. package/src/components/form-designer/widget-panel/advanced/cascader.js +0 -1
  35. package/src/components/form-designer/widget-panel/advanced/data-table.js +1 -1
  36. package/src/components/form-designer/widget-panel/advanced/file-upload.js +0 -1
  37. package/src/components/form-designer/widget-panel/advanced/rich-editor.js +4 -5
  38. package/src/components/form-designer/widget-panel/advanced/tree-select.js +0 -1
  39. package/src/components/form-designer/widget-panel/basicFields/checkbox.js +2 -3
  40. package/src/components/form-designer/widget-panel/basicFields/color.js +0 -1
  41. package/src/components/form-designer/widget-panel/basicFields/date.js +0 -1
  42. package/src/components/form-designer/widget-panel/basicFields/dateRange.js +0 -1
  43. package/src/components/form-designer/widget-panel/basicFields/input.js +0 -1
  44. package/src/components/form-designer/widget-panel/basicFields/number.js +0 -1
  45. package/src/components/form-designer/widget-panel/basicFields/radio.js +0 -1
  46. package/src/components/form-designer/widget-panel/basicFields/rate.js +5 -6
  47. package/src/components/form-designer/widget-panel/basicFields/select.js +2 -3
  48. package/src/components/form-designer/widget-panel/basicFields/slider.js +0 -1
  49. package/src/components/form-designer/widget-panel/basicFields/switch.js +0 -1
  50. package/src/components/form-designer/widget-panel/basicFields/textarea.js +0 -1
  51. package/src/components/form-designer/widget-panel/basicFields/time.js +0 -1
  52. package/src/components/form-designer/widget-panel/basicFields/timeRange.js +0 -1
  53. package/src/components/form-designer/widget-panel/business/department-select.js +0 -1
  54. package/src/components/form-designer/widget-panel/business/material-select.js +0 -1
  55. package/src/components/form-designer/widget-panel/business/operation-select.js +2 -3
  56. package/src/components/form-designer/widget-panel/business/post-select.js +0 -1
  57. package/src/components/form-designer/widget-panel/business/project-group-select.js +2 -3
  58. package/src/components/form-designer/widget-panel/business/project-select.js +2 -3
  59. package/src/components/form-designer/widget-panel/business/user-select.js +0 -1
  60. package/src/components/form-designer/widget-panel/containers/vf-dialog.js +3 -2
  61. package/src/components/form-designer/widget-panel/index.vue.js +4 -338
  62. package/src/components/form-designer/widget-panel/index.vue2.js +82 -0
  63. package/src/components/form-designer/widget-panel/widgetsConfig.js +19 -18
  64. package/src/components/form-render/RenderWigetList.vue.js +61 -0
  65. package/src/components/form-render/RenderWigetList.vue2.js +4 -0
  66. package/src/components/form-render/SubmitButtonRender.vue.js +41 -29
  67. package/src/components/form-render/container-item/container-item-wrapper.vue.js +2 -23
  68. package/src/components/form-render/container-item/container-item-wrapper.vue2.js +20 -0
  69. package/src/components/form-render/container-item/data-table-item.vue.js +22 -36
  70. package/src/components/form-render/container-item/grid-item.vue.js +7 -7
  71. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +1 -1
  72. package/src/components/form-render/container-item/sub-form-item.vue.js +115 -146
  73. package/src/components/form-render/container-item/tab-item.vue.js +19 -19
  74. package/src/components/form-render/container-item/table-item.vue.js +7 -7
  75. package/src/components/form-render/container-item/vf-collapse-item.vue.js +27 -27
  76. package/src/components/form-render/dynamic-dialog.vue.js +87 -86
  77. package/src/components/form-render/index.vue.js +94 -110
  78. package/src/components/public/ActionButtonListDialog.vue.js +82 -75
  79. package/src/components/public/ActionButtonListDialog.vue2.js +16 -10
  80. package/src/components/public/ActionButtonListRender.vue.js +12 -11
  81. package/src/components/public/CustomerModal/CustomerModal.vue2.js +49 -42
  82. package/src/hooks/useLowcode.js +40 -39
  83. package/src/lang/en-US.js +5 -1
  84. package/src/lang/zh-CN.js +5 -1
  85. package/src/mixins/useDataTableMixin.js +29 -31
  86. package/src/utils/asyncExecuteFunction.js +4 -0
  87. package/stats.html +1 -1
  88. package/styles/style.css +1 -1
  89. package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
  90. package/src/components/form-designer/widget-panel/templatesConfig.js +0 -53
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kp-ui/lowcode",
3
- "version": "2.14.0-beta.2",
3
+ "version": "2.14.0-beta.20",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -0,0 +1,18 @@
1
+ import { ContainerWidgetMap as t } from "../form-render/container-item/index.js";
2
+ import o from "../form-designer/form-widget/field-widget/index.js";
3
+ function m() {
4
+ function i(e) {
5
+ var n;
6
+ if (!e) return "";
7
+ const r = `./${e.type}-item.vue`;
8
+ return t[r] || console.warn(`未找到容器组件类型: ${e.type},请确保已注册该组件。`), (n = t[r]) == null ? void 0 : n.default;
9
+ }
10
+ return {
11
+ getFieldWidget: (e) => e && o[e.type + "-widget"] || "",
12
+ getContainerWidget: i,
13
+ ContainerWidgetMap: t
14
+ };
15
+ }
16
+ export {
17
+ m as useFormRender
18
+ };
@@ -1,8 +1,8 @@
1
- import { deepClone as g, getDefaultFormConfig as F, generateId as p, overwriteObj as u } from "../../utils/util.js";
1
+ import { deepClone as d, getDefaultFormConfig as F, generateId as r, overwriteObj as u } from "../../utils/util.js";
2
2
  import { containers as w, basicFields as y, advancedFields as b, customFields as L } from "./widget-panel/widgetsConfig.js";
3
3
  import D from "../../utils/event-bus.js";
4
4
  function E(T) {
5
- const m = g(F());
5
+ const m = d(F());
6
6
  return {
7
7
  widgetList: [],
8
8
  formConfig: { cssCode: "" },
@@ -22,7 +22,7 @@ function E(T) {
22
22
  steps: []
23
23
  },
24
24
  initDesigner(e) {
25
- this.widgetList = [], this.formConfig = g(m), e || this.initHistoryData();
25
+ this.widgetList = [], this.formConfig = d(m), e || this.initHistoryData();
26
26
  },
27
27
  clearDesigner(e) {
28
28
  const t = this.widgetList.length === 0;
@@ -41,7 +41,7 @@ function E(T) {
41
41
  return {
42
42
  widgetList: [],
43
43
  //formConfig: deepClone(this.formConfig)
44
- formConfig: g(m)
44
+ formConfig: d(m)
45
45
  };
46
46
  },
47
47
  loadFormJson(e) {
@@ -86,9 +86,9 @@ function E(T) {
86
86
  * @param widget
87
87
  */
88
88
  appendTableRow(e) {
89
- const t = e.rows.length, s = g(e.rows[e.rows.length - 1]);
90
- s.id = "table-row-" + p(), s.merged = !1, s.cols.forEach((i) => {
91
- i.id = "table-cell-" + p(), i.options.name = i.id, i.merged = !1, i.options.colspan = 1, i.options.rowspan = 1, i.widgetList.length = 0;
89
+ const t = e.rows.length, s = d(e.rows[e.rows.length - 1]);
90
+ s.id = "table-row-" + r(), s.merged = !1, s.cols.forEach((i) => {
91
+ i.id = "table-cell-" + r(), i.options.name = i.id, i.merged = !1, i.options.colspan = 1, i.options.rowspan = 1, i.widgetList.length = 0;
92
92
  }), e.rows.splice(t, 0, s), this.emitHistoryChange();
93
93
  },
94
94
  /**
@@ -98,47 +98,47 @@ function E(T) {
98
98
  appendTableCol(e) {
99
99
  const t = e.rows[0].cols.length;
100
100
  e.rows.forEach((s) => {
101
- const i = g(this.getContainerByType("table-cell"));
102
- i.id = "table-cell-" + p(), i.options.name = i.id, i.merged = !1, i.options.colspan = 1, i.options.rowspan = 1, i.widgetList.length = 0, s.cols.splice(t, 0, i);
101
+ const i = d(this.getContainerByType("table-cell"));
102
+ i.id = "table-cell-" + r(), i.options.name = i.id, i.merged = !1, i.options.colspan = 1, i.options.rowspan = 1, i.widgetList.length = 0, s.cols.splice(t, 0, i);
103
103
  }), this.emitHistoryChange();
104
104
  },
105
105
  insertTableRow(e, t, s, i, l) {
106
106
  let o = l ? t : t + 1;
107
107
  if (!l) {
108
- let h = o, r = !1;
108
+ let h = o, g = !1;
109
109
  for (; h < e.rows.length; )
110
110
  if (e.rows[h].cols[i].merged)
111
111
  h++;
112
112
  else {
113
- o = h, r = !0;
113
+ o = h, g = !0;
114
114
  break;
115
115
  }
116
- r || (o = e.rows.length);
116
+ g || (o = e.rows.length);
117
117
  }
118
- const n = g(e.rows[s]);
119
- n.id = "table-row-" + p(), n.merged = !1, n.cols.forEach((h) => {
120
- h.id = "table-cell-" + p(), h.options.name = h.id, h.merged = !1, h.options.colspan = 1, h.options.rowspan = 1, h.widgetList.length = 0;
118
+ const n = d(e.rows[s]);
119
+ n.id = "table-row-" + r(), n.merged = !1, n.cols.forEach((h) => {
120
+ h.id = "table-cell-" + r(), h.options.name = h.id, h.merged = !1, h.options.colspan = 1, h.options.rowspan = 1, h.widgetList.length = 0;
121
121
  }), e.rows.splice(o, 0, n);
122
122
  let a = 0;
123
123
  for (; o < e.rows.length - 1 && a < e.rows[0].cols.length; ) {
124
124
  const h = e.rows[o + 1].cols[a];
125
125
  if (h.merged) {
126
126
  const f = e.rows;
127
- let d = {}, C = null;
127
+ let p = {}, C = null;
128
128
  for (let c = o; c >= 0; c--)
129
129
  if (!f[c].cols[a].merged && f[c].cols[a].options.rowspan > 1) {
130
- C = c, d = f[c].cols[a];
130
+ C = c, p = f[c].cols[a];
131
131
  break;
132
132
  }
133
- if (d.options) {
134
- const c = d.options.rowspan + 1;
133
+ if (p.options) {
134
+ const c = p.options.rowspan + 1;
135
135
  this.setPropsOfMergedRows(
136
136
  e.rows,
137
137
  C,
138
138
  a,
139
- d.options.colspan,
139
+ p.options.colspan,
140
140
  c
141
- ), a += d.options.colspan;
141
+ ), a += p.options.colspan;
142
142
  } else
143
143
  a += 1;
144
144
  } else
@@ -161,29 +161,29 @@ function E(T) {
161
161
  }
162
162
  }
163
163
  e.rows.forEach((n) => {
164
- const a = g(this.getContainerByType("table-cell"));
165
- a.id = "table-cell-" + p(), a.options.name = a.id, a.merged = !1, a.options.colspan = 1, a.options.rowspan = 1, a.widgetList.length = 0, n.cols.splice(l, 0, a);
164
+ const a = d(this.getContainerByType("table-cell"));
165
+ a.id = "table-cell-" + r(), a.options.name = a.id, a.merged = !1, a.options.colspan = 1, a.options.rowspan = 1, a.widgetList.length = 0, n.cols.splice(l, 0, a);
166
166
  });
167
167
  let o = 0;
168
168
  for (; l < e.rows[0].cols.length - 1 && o < e.rows.length; ) {
169
169
  const n = e.rows[o].cols[l + 1];
170
170
  if (n.merged) {
171
171
  const h = e.rows[o].cols;
172
- let r = {}, f = null;
173
- for (let d = l; d >= 0; d--)
174
- if (!h[d].merged && h[d].options.colspan > 1) {
175
- f = d, r = h[d];
172
+ let g = {}, f = null;
173
+ for (let p = l; p >= 0; p--)
174
+ if (!h[p].merged && h[p].options.colspan > 1) {
175
+ f = p, g = h[p];
176
176
  break;
177
177
  }
178
- if (r.options) {
179
- const d = r.options.colspan + 1;
178
+ if (g.options) {
179
+ const p = g.options.colspan + 1;
180
180
  this.setPropsOfMergedCols(
181
181
  e.rows,
182
182
  o,
183
183
  f,
184
- d,
185
- r.options.rowspan
186
- ), o += r.options.rowspan;
184
+ p,
185
+ g.options.rowspan
186
+ ), o += g.options.rowspan;
187
187
  } else
188
188
  o += 1;
189
189
  } else
@@ -225,16 +225,16 @@ function E(T) {
225
225
  const n = l ? i : i + t[i].options.colspan;
226
226
  let a = l ? i - 1 : i;
227
227
  if (l) {
228
- let r = a;
229
- for (; r >= 0; )
230
- if (e[s].cols[r].merged)
231
- r--;
228
+ let g = a;
229
+ for (; g >= 0; )
230
+ if (e[s].cols[g].merged)
231
+ g--;
232
232
  else {
233
- a = r;
233
+ a = g;
234
234
  break;
235
235
  }
236
236
  }
237
- t[n].widgetList && t[n].widgetList.length > 0 && (!t[a].widgetList || t[a].widgetList.length === 0) && (t[a].widgetList = g(
237
+ t[n].widgetList && t[n].widgetList.length > 0 && (!t[a].widgetList || t[a].widgetList.length === 0) && (t[a].widgetList = d(
238
238
  t[n].widgetList
239
239
  ));
240
240
  const h = t[n].options.colspan * 1 + t[a].options.colspan * 1;
@@ -261,7 +261,7 @@ function E(T) {
261
261
  return;
262
262
  }
263
263
  const n = t.filter((a) => !a.merged && !!a.widgetList && a.widgetList.length > 0);
264
- n && n.length > 0 && n[0].id !== t[0].id && (!t[0].widgetList || t[0].widgetList.length <= 0) && (t[0].widgetList = g(n[0].widgetList)), this.setPropsOfMergedCols(
264
+ n && n.length > 0 && n[0].id !== t[0].id && (!t[0].widgetList || t[0].widgetList.length <= 0) && (t[0].widgetList = d(n[0].widgetList)), this.setPropsOfMergedCols(
265
265
  e,
266
266
  s,
267
267
  0,
@@ -282,7 +282,7 @@ function E(T) {
282
282
  break;
283
283
  }
284
284
  }
285
- e[o].cols[s].widgetList && e[o].cols[s].widgetList.length > 0 && (!e[n].cols[s].widgetList || e[n].cols[s].widgetList.length === 0) && (e[n].cols[s].widgetList = g(
285
+ e[o].cols[s].widgetList && e[o].cols[s].widgetList.length > 0 && (!e[n].cols[s].widgetList || e[n].cols[s].widgetList.length === 0) && (e[n].cols[s].widgetList = d(
286
286
  e[o].cols[s].widgetList
287
287
  ));
288
288
  const a = e[o].cols[s].options.rowspan * 1 + e[n].cols[s].options.rowspan * 1;
@@ -310,11 +310,11 @@ function E(T) {
310
310
  }
311
311
  const n = [];
312
312
  e.forEach((h) => {
313
- const r = h.cols[i];
314
- !r.merged && r.widgetList && r.widgetList.length > 0 && n.push(r);
313
+ const g = h.cols[i];
314
+ !g.merged && g.widgetList && g.widgetList.length > 0 && n.push(g);
315
315
  });
316
316
  const a = e[0].cols[i];
317
- n && n.length > 0 && n[0].id !== a.id && (!a.widgetList || a.widgetList.length <= 0) && (a.widgetList = g(n[0].widgetList)), this.setPropsOfMergedRows(
317
+ n && n.length > 0 && n[0].id !== a.id && (!a.widgetList || a.widgetList.length <= 0) && (a.widgetList = d(n[0].widgetList)), this.setPropsOfMergedRows(
318
318
  e,
319
319
  0,
320
320
  i,
@@ -403,33 +403,33 @@ function E(T) {
403
403
  upgradeWidgetConfig(e) {
404
404
  let t = null;
405
405
  e.category ? t = this.getContainerByType(e.type) : t = this.getFieldWidgetByType(e.type), !(!t || !t.options) && Object.keys(t.options).forEach((s) => {
406
- e.hasOwnProperty(s) || (e.options[s] = g(t.options[s]));
406
+ e.hasOwnProperty(s) || (e.options[s] = d(t.options[s]));
407
407
  });
408
408
  },
409
409
  upgradeFormConfig(e) {
410
410
  Object.keys(this.formConfig).forEach((t) => {
411
- e.hasOwnProperty(t) || (e[t] = g(this.formConfig[t]));
411
+ e.hasOwnProperty(t) || (e[t] = d(this.formConfig[t]));
412
412
  });
413
413
  },
414
414
  cloneGridCol(e, t) {
415
- const s = g(this.getContainerByType("grid-col"));
415
+ const s = d(this.getContainerByType("grid-col"));
416
416
  s.options.span = e.options.span;
417
- const i = p();
417
+ const i = r();
418
418
  s.id = "grid-col-" + i, s.options.name = "gridCol" + i, t.cols.push(s);
419
419
  },
420
420
  cloneContainer(e) {
421
421
  if (e.type === "grid") {
422
- const t = g(this.getContainerByType("grid"));
423
- return t.id = t.type + p(), t.options.name = t.id, e.cols.forEach((s) => {
424
- const i = g(this.getContainerByType("grid-col")), l = p();
422
+ const t = d(this.getContainerByType("grid"));
423
+ return t.id = t.type + r(), t.options.name = t.id, e.cols.forEach((s) => {
424
+ const i = d(this.getContainerByType("grid-col")), l = r();
425
425
  i.id = "grid-col-" + l, i.options.name = "gridCol" + l, i.options.span = s.options.span, t.cols.push(i);
426
426
  }), t;
427
427
  } else if (e.type === "table") {
428
- const t = g(this.getContainerByType("table"));
429
- return t.id = t.type + p(), t.options.name = t.id, e.rows.forEach((s) => {
430
- const i = g(s);
431
- i.id = "table-row-" + p(), i.cols.forEach((l) => {
432
- l.id = "table-cell-" + p(), l.options.name = l.id, l.widgetList = [];
428
+ const t = d(this.getContainerByType("table"));
429
+ return t.id = t.type + r(), t.options.name = t.id, e.rows.forEach((s) => {
430
+ const i = d(s);
431
+ i.id = "table-row-" + r(), i.cols.forEach((l) => {
432
+ l.id = "table-cell-" + r(), l.options.name = l.id, l.widgetList = [];
433
433
  }), t.rows.push(i);
434
434
  }), t;
435
435
  } else
@@ -460,25 +460,28 @@ function E(T) {
460
460
  }
461
461
  },
462
462
  copyNewFieldWidget(e) {
463
- const t = g(e), s = p();
463
+ const t = d(e), s = r();
464
464
  return t.id = t.type.replace(/-/g, "") + s, t.options.name = t.id, t.options.label = t.options.label || t.type.toLowerCase(), delete t.displayName, t;
465
465
  },
466
466
  copyNewContainerWidget(e) {
467
- const t = g(e);
468
- if (t.id = t.type.replace(/-/g, "") + p(), t.options.name = t.id, t.type === "grid") {
469
- let s = g(this.getContainerByType("grid-col")), i = p();
470
- s.id = "grid-col-" + i, s.options.name = "gridCol" + i, t.cols.push(s), s = g(s), i = p(), s.id = "grid-col-" + i, s.options.name = "gridCol" + i, t.cols.push(s);
467
+ const t = d(e);
468
+ if (t.id = t.type.replace(/-/g, "") + r(), t.options.name = t.id, t.type === "grid") {
469
+ let s = d(this.getContainerByType("grid-col")), i = r();
470
+ s.id = "grid-col-" + i, s.options.name = "gridCol" + i, t.cols.push(s), s = d(s), i = r(), s.id = "grid-col-" + i, s.options.name = "gridCol" + i, t.cols.push(s);
471
471
  } else if (t.type === "table") {
472
472
  const s = { cols: [] };
473
- s.id = "table-row-" + p(), s.merged = !1;
474
- const i = g(this.getContainerByType("table-cell"));
475
- i.id = "table-cell-" + p(), i.options.name = i.id, i.merged = !1, i.options.colspan = 1, i.options.rowspan = 1, s.cols.push(i), t.rows.push(s);
473
+ s.id = "table-row-" + r(), s.merged = !1;
474
+ const i = d(this.getContainerByType("table-cell"));
475
+ i.id = "table-cell-" + r(), i.options.name = i.id, i.merged = !1, i.options.colspan = 1, i.options.rowspan = 1, s.cols.push(i), t.rows.push(s);
476
476
  } else if (t.type === "tab") {
477
- const s = g(this.getContainerByType("tab-pane"));
478
- s.id = "tab-pane-" + p(), s.options.name = "tab1", s.options.label = "tab 1", t.tabs.push(s);
477
+ const s = d(this.getContainerByType("tab-pane"));
478
+ s.id = "tab-pane-" + r(), s.options.name = "tab1", s.options.label = "tab 1", t.tabs.push(s);
479
479
  }
480
480
  return delete t.displayName, t;
481
481
  },
482
+ addWidget(e) {
483
+ e.category === "container" ? this.addContainerByDbClick(e) : this.addFieldByDbClick(e);
484
+ },
482
485
  addContainerByDbClick(e) {
483
486
  const t = this.copyNewContainerWidget(e);
484
487
  this.widgetList.push(t), this.setSelected(t);
@@ -497,7 +500,7 @@ function E(T) {
497
500
  e && e.cols && e.cols.splice(t, 1);
498
501
  },
499
502
  addNewColOfGrid(e) {
500
- const t = e.cols, s = g(this.getContainerByType("grid-col")), i = p();
503
+ const t = e.cols, s = d(this.getContainerByType("grid-col")), i = r();
501
504
  if (s.id = "grid-col-" + i, s.options.name = "gridCol" + i, t && t.length > 0) {
502
505
  let l = 0;
503
506
  t.forEach((o) => {
@@ -507,8 +510,8 @@ function E(T) {
507
510
  e.cols = [s];
508
511
  },
509
512
  addTabPaneOfTabs(e) {
510
- const t = e.tabs, s = g(this.getContainerByType("tab-pane"));
511
- s.id = "tab-pane-" + p(), s.options.name = s.id, s.options.label = "tab " + (t.length + 1), t.push(s);
513
+ const t = e.tabs, s = d(this.getContainerByType("tab-pane"));
514
+ s.id = "tab-pane-" + r(), s.options.name = s.id, s.options.label = "tab " + (t.length + 1), t.push(s);
512
515
  },
513
516
  deleteTabPaneOfTabs(e, t) {
514
517
  e.tabs.splice(t, 1);
@@ -530,30 +533,30 @@ function E(T) {
530
533
  },
531
534
  initHistoryData() {
532
535
  this.loadFormContentFromStorage(), this.historyData.index++, this.historyData.steps[this.historyData.index] = {
533
- widgetList: g(this.widgetList),
534
- formConfig: g(this.formConfig)
536
+ widgetList: d(this.widgetList),
537
+ formConfig: d(this.formConfig)
535
538
  };
536
539
  },
537
540
  emitHistoryChange() {
538
541
  this.historyData.index === this.historyData.maxStep - 1 ? this.historyData.steps.shift() : this.historyData.index++, this.historyData.steps[this.historyData.index] = {
539
- widgetList: g(this.widgetList),
540
- formConfig: g(this.formConfig)
542
+ widgetList: d(this.widgetList),
543
+ formConfig: d(this.formConfig)
541
544
  }, this.saveFormContentToStorage(), this.historyData.index < this.historyData.steps.length - 1 && (this.historyData.steps = this.historyData.steps.slice(
542
545
  0,
543
546
  this.historyData.index + 1
544
547
  ));
545
548
  },
546
549
  saveCurrentHistoryStep() {
547
- this.historyData.steps[this.historyData.index] = g({
550
+ this.historyData.steps[this.historyData.index] = d({
548
551
  widgetList: this.widgetList,
549
552
  formConfig: this.formConfig
550
553
  }), this.saveFormContentToStorage();
551
554
  },
552
555
  undoHistoryStep() {
553
- this.historyData.index !== 0 && this.historyData.index--, this.widgetList = g(this.historyData.steps[this.historyData.index].widgetList), this.formConfig = g(this.historyData.steps[this.historyData.index].formConfig);
556
+ this.historyData.index !== 0 && this.historyData.index--, this.widgetList = d(this.historyData.steps[this.historyData.index].widgetList), this.formConfig = d(this.historyData.steps[this.historyData.index].formConfig);
554
557
  },
555
558
  redoHistoryStep() {
556
- this.historyData.index !== this.historyData.steps.length - 1 && this.historyData.index++, this.widgetList = g(this.historyData.steps[this.historyData.index].widgetList), this.formConfig = g(this.historyData.steps[this.historyData.index].formConfig);
559
+ this.historyData.index !== this.historyData.steps.length - 1 && this.historyData.index++, this.widgetList = d(this.historyData.steps[this.historyData.index].widgetList), this.formConfig = d(this.historyData.steps[this.historyData.index].formConfig);
557
560
  },
558
561
  undoEnabled() {
559
562
  return this.historyData.index > 0 && this.historyData.steps.length > 0;
@@ -1,35 +1,35 @@
1
1
  import u from "./data-table-widget.vue2.js";
2
- import { resolveComponent as a, createBlock as s, openBlock as l, withCtx as i, createElementBlock as C, withModifiers as p, normalizeClass as r, createElementVNode as y, createVNode as m, normalizeStyle as b, createCommentVNode as f } from "vue";
2
+ import { resolveComponent as a, createBlock as s, openBlock as n, withCtx as l, createElementBlock as C, withModifiers as p, normalizeClass as r, createElementVNode as b, createVNode as m, normalizeStyle as y, createCommentVNode as f } from "vue";
3
3
  /* empty css */
4
4
  import R from "../../../../../_virtual/_plugin-vue_export-helper.js";
5
5
  const z = { class: "talbe-wrapper" };
6
- function S(e, d, t, N, _, n) {
7
- const c = a("a-empty"), w = a("RenderBodyCell"), g = a("s-table"), h = a("container-wrapper");
8
- return l(), s(h, {
6
+ function S(e, i, t, N, k, d) {
7
+ const c = a("a-empty"), g = a("RenderBodyCell"), w = a("s-table"), h = a("container-wrapper");
8
+ return n(), s(h, {
9
9
  designer: t.designer,
10
10
  widget: t.widget,
11
11
  "parent-widget": t.parentWidget,
12
12
  "parent-list": t.parentList,
13
13
  "index-of-parent-list": t.indexOfParentList
14
14
  }, {
15
- default: i(() => [
16
- (l(), C("div", {
15
+ default: l(() => [
16
+ (n(), C("div", {
17
17
  key: t.widget.id,
18
- class: r(["collapse-container data-table-container", { selected: n.selected }]),
19
- onClick: d[0] || (d[0] = p((o) => n.selectWidget(t.widget), ["stop"]))
18
+ class: r(["collapse-container data-table-container", { selected: d.selected }]),
19
+ onClick: i[0] || (i[0] = p((o) => e.selectWidget(t.widget), ["stop"]))
20
20
  }, [
21
- y("div", z, [
22
- m(g, {
21
+ b("div", z, [
22
+ m(w, {
23
23
  ref: "dataTable2",
24
24
  columns: e.columns.columns,
25
25
  scroll: { y: e.tableHeight },
26
26
  height: e.tableHeight,
27
- dataSource: n.data,
28
- class: r([e.customClass]),
27
+ dataSource: d.data,
28
+ class: r(["tpf-surely-table", [e.customClass]]),
29
29
  size: e.widgetSize,
30
30
  rowKey: (o) => o[t.widget.options.rowKey],
31
31
  bordered: t.widget.options.border,
32
- style: b({ width: t.widget.options.tableWidth }),
32
+ style: y({ width: t.widget.options.tableWidth, height: e.tableHeight + "px" }),
33
33
  "row-class-name": e.rowClassName,
34
34
  rowSelection: e.handleRowSelection(),
35
35
  pagination: e.fmtPagination,
@@ -41,11 +41,11 @@ function S(e, d, t, N, _, n) {
41
41
  loading: e.loading,
42
42
  "row-height": e.lineHeight
43
43
  }, {
44
- emptyText: i(() => [
44
+ emptyText: l(() => [
45
45
  m(c)
46
46
  ]),
47
- bodyCell: i((o) => [
48
- e.isShowBodyCell(o.column.dataIndex) ? (l(), s(w, {
47
+ bodyCell: l((o) => [
48
+ e.isShowBodyCell(o.column.dataIndex) ? (n(), s(g, {
49
49
  key: 0,
50
50
  bodyCell: e.columns.bodyCell,
51
51
  scope: o
@@ -59,7 +59,7 @@ function S(e, d, t, N, _, n) {
59
59
  _: 1
60
60
  }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
61
61
  }
62
- const W = /* @__PURE__ */ R(u, [["render", S], ["__scopeId", "data-v-83fedb64"]]);
62
+ const T = /* @__PURE__ */ R(u, [["render", S], ["__scopeId", "data-v-bcb92396"]]);
63
63
  export {
64
- W as default
64
+ T as default
65
65
  };
@@ -1,18 +1,18 @@
1
- import t from "./container-wrapper.vue.js";
2
- import i from "../../../../utils/emitter.js";
3
- import r from "../../../../utils/i18n.js";
4
- import o from "../field-widget/index.js";
5
- import a from "./containerMixin.js";
6
- import n from "../../refMixinDesign.js";
7
- import m from "../../../../mixins/useDataTableMixin.js";
8
- const l = {
1
+ import e from "./container-wrapper.vue.js";
2
+ import t from "../../../../utils/emitter.js";
3
+ import i from "../../../../utils/i18n.js";
4
+ import r from "../field-widget/index.js";
5
+ import o from "./containerMixin.js";
6
+ import a from "../../refMixinDesign.js";
7
+ import n from "../../../../mixins/useDataTableMixin.js";
8
+ const c = {
9
9
  name: "DataTableWidget",
10
10
  componentName: "DataTableWidget",
11
- mixins: [r, a, n, i, m],
11
+ mixins: [i, o, a, t, n],
12
12
  inject: ["refList"],
13
13
  components: {
14
- ContainerWrapper: t,
15
- ...o
14
+ ContainerWrapper: e,
15
+ ...r
16
16
  },
17
17
  data() {
18
18
  return {
@@ -45,9 +45,11 @@ const l = {
45
45
  this.initRefList();
46
46
  },
47
47
  mounted() {
48
- this.loadDataTableDataSource();
49
- },
50
- beforeUnmount() {
48
+ this.setPagination({
49
+ pageSize: this.widget.options.pagination.pageSize,
50
+ page: 1,
51
+ total: 1
52
+ });
51
53
  },
52
54
  computed: {
53
55
  data() {
@@ -57,12 +59,8 @@ const l = {
57
59
  return this.widget.id === this.designer.selectedId;
58
60
  }
59
61
  },
60
- methods: {
61
- selectWidget(e) {
62
- this.designer.setSelected(e);
63
- }
64
- }
62
+ methods: {}
65
63
  };
66
64
  export {
67
- l as default
65
+ c as default
68
66
  };
@@ -1,8 +1,8 @@
1
- import F from "../../../form-render/container-item/container-item-wrapper.vue.js";
1
+ import F from "../../../form-render/container-item/container-item-wrapper.vue2.js";
2
2
  import R from "../../../../utils/emitter.js";
3
- import { defineAsyncComponent as O, resolveComponent as c, withDirectives as L, createBlock as a, openBlock as n, withCtx as m, createElementBlock as f, normalizeStyle as S, normalizeClass as _, createCommentVNode as g, Fragment as p, renderList as u, resolveDynamicComponent as w, createSlots as b, renderSlot as h, mergeProps as x, vShow as k } from "vue";
4
- import j from "../../../../utils/i18n.js";
5
- import $ from "../field-widget/index.js";
3
+ import { defineAsyncComponent as O, resolveComponent as c, withDirectives as _, createBlock as a, openBlock as n, withCtx as m, createElementBlock as f, normalizeStyle as L, normalizeClass as S, createCommentVNode as g, Fragment as p, renderList as u, resolveDynamicComponent as w, createSlots as b, renderSlot as h, mergeProps as x, vShow as k } from "vue";
4
+ import $ from "../../../../utils/i18n.js";
5
+ import j from "../field-widget/index.js";
6
6
  import B from "../../../form-render/refMixin.js";
7
7
  import I from "../../../form-render/container-item/containerItemMixin.js";
8
8
  import M from "../../../svg-icon/index.vue.js";
@@ -12,11 +12,11 @@ const D = {
12
12
  name: "VfBoxItem",
13
13
  componentName: "boxItem",
14
14
  // 必须固定为ContainerItem,用于接收父级组件的broadcast事件
15
- mixins: [R, j, B, I],
15
+ mixins: [R, $, B, I],
16
16
  components: {
17
17
  ContainerItemWrapper: F,
18
18
  SvgIcon: M,
19
- ...$,
19
+ ...j,
20
20
  VFormRender: O(() => import("../../../form-render/index.vue.js"))
21
21
  },
22
22
  props: {
@@ -118,11 +118,11 @@ const D = {
118
118
  };
119
119
  function N(e, o, t, T, V, l) {
120
120
  const y = c("VFormRender"), C = c("container-item-wrapper");
121
- return L((n(), a(C, { widget: t.widget }, {
121
+ return _((n(), a(C, { widget: t.widget }, {
122
122
  default: m(() => [
123
123
  (n(), f("div", {
124
- class: _(["box-container-item", [l.customClass]]),
125
- style: S(l.boxStyle),
124
+ class: S(["box-container-item", [l.customClass]]),
125
+ style: L(l.boxStyle),
126
126
  key: t.widget.id
127
127
  }, [
128
128
  t.widget.options.formCode ? (n(), a(y, {
@@ -1,19 +1,18 @@
1
- import d from "../../../../utils/i18n.js";
2
- import a from "../../refMixinDesign.js";
3
- import o from "../field-widget/index.js";
4
- import g from "./container-wrapper.vue.js";
5
- import { resolveComponent as l, createBlock as c, openBlock as n, withCtx as h, createElementBlock as m, withModifiers as p, normalizeClass as f, createElementVNode as w, toDisplayString as x } from "vue";
1
+ import l from "../../../../utils/i18n.js";
2
+ import g from "../../refMixinDesign.js";
3
+ import c from "../field-widget/index.js";
4
+ import h from "./container-wrapper.vue.js";
5
+ import { resolveComponent as m, createBlock as f, openBlock as d, withCtx as p, createElementBlock as w, withModifiers as L, normalizeClass as x, createElementVNode as a, toDisplayString as C } from "vue";
6
6
  /* empty css */
7
- import L from "../../../../../_virtual/_plugin-vue_export-helper.js";
8
- const W = {
7
+ import W from "../../../../../_virtual/_plugin-vue_export-helper.js";
8
+ const u = {
9
9
  name: "vf-dialog-widget",
10
10
  componentName: "VfDialogWidget",
11
- mixins: [d, a],
11
+ mixins: [l, g],
12
12
  inject: ["refList"],
13
13
  components: {
14
- // Draggable,
15
- ContainerWrapper: g,
16
- ...o
14
+ ContainerWrapper: h,
15
+ ...c
17
16
  },
18
17
  props: {
19
18
  widget: Object,
@@ -39,6 +38,10 @@ const W = {
39
38
  this.initRefList();
40
39
  },
41
40
  methods: {
41
+ handleClickTitle() {
42
+ const e = new URL(window.location.href), { title: i, formCode: t, formId: n } = this.widget.options;
43
+ n && (e.searchParams.set("formCode", t), e.searchParams.set("remark", i), e.searchParams.set("id", n), window.open(e.href));
44
+ },
42
45
  onDialogDragEnd(e, i) {
43
46
  },
44
47
  onDialogDragAdd(e, i) {
@@ -73,28 +76,33 @@ const W = {
73
76
  }
74
77
  }
75
78
  }, v = { class: "dialog-title" };
76
- function u(e, i, t, _, C, s) {
77
- const r = l("container-wrapper");
78
- return n(), c(r, {
79
+ function k(e, i, t, n, D, s) {
80
+ const o = m("container-wrapper");
81
+ return d(), f(o, {
79
82
  designer: t.designer,
80
83
  widget: t.widget,
81
84
  "parent-widget": t.parentWidget,
82
85
  "parent-list": t.parentList,
83
86
  "index-of-parent-list": t.indexOfParentList
84
87
  }, {
85
- default: h(() => [
86
- (n(), m("div", {
87
- class: f(["dialog-container", [s.selected ? "selected" : "", s.customClass]]),
88
+ default: p(() => [
89
+ (d(), w("div", {
90
+ class: x(["dialog-container", [s.selected ? "selected" : "", s.customClass]]),
88
91
  key: t.widget.id,
89
- onClick: i[0] || (i[0] = p((D) => s.selectWidget(t.widget), ["stop"]))
92
+ onClick: i[1] || (i[1] = L((r) => s.selectWidget(t.widget), ["stop"]))
90
93
  }, [
91
- w("div", v, x(t.widget.options.title), 1)
94
+ a("div", v, [
95
+ a("span", {
96
+ class: "tpf-link",
97
+ onClick: i[0] || (i[0] = (...r) => s.handleClickTitle && s.handleClickTitle(...r))
98
+ }, C(t.widget.options.title), 1)
99
+ ])
92
100
  ], 2))
93
101
  ]),
94
102
  _: 1
95
103
  }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
96
104
  }
97
- const E = /* @__PURE__ */ L(W, [["render", u], ["__scopeId", "data-v-48ae3673"]]);
105
+ const j = /* @__PURE__ */ W(u, [["render", k], ["__scopeId", "data-v-3833bfd1"]]);
98
106
  export {
99
- E as default
107
+ j as default
100
108
  };