@kp-ui/lowcode 1.0.45 → 1.0.47

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.
@@ -1,5 +1,4 @@
1
1
  import i18n from "../../../../../utils/i18n.js";
2
- import Sortable from "sortablejs";
3
2
  import CodeModalEditor from "../../../../code-editor/code-modal-editor.vue.js";
4
3
  import { resolveComponent, createElementBlock, openBlock, Fragment, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, createBlock, createCommentVNode } from "vue";
5
4
  /* empty css */
@@ -15,6 +14,83 @@ const _sfc_main = {
15
14
  },
16
15
  data() {
17
16
  return {
17
+ columns: [
18
+ {
19
+ title: "序号",
20
+ dataIndex: "index",
21
+ width: 60,
22
+ fixed: "left",
23
+ rowDrag: true,
24
+ resizable: true,
25
+ customRender: ({ index }) => index + 1
26
+ },
27
+ {
28
+ title: this.i18nt("designer.setting.columnName"),
29
+ dataIndex: "dataIndex",
30
+ resizable: true,
31
+ width: 100
32
+ },
33
+ {
34
+ title: this.i18nt("designer.setting.columnLabel"),
35
+ dataIndex: "title",
36
+ resizable: true,
37
+ width: 100
38
+ },
39
+ {
40
+ title: this.i18nt("designer.setting.columnWidth"),
41
+ dataIndex: "width",
42
+ resizable: true,
43
+ width: 100
44
+ },
45
+ {
46
+ title: this.i18nt("designer.setting.visibleColumn"),
47
+ dataIndex: "show",
48
+ resizable: true,
49
+ width: 90
50
+ },
51
+ {
52
+ title: this.i18nt("designer.setting.sortableColumn"),
53
+ dataIndex: "sorter",
54
+ resizable: true,
55
+ width: 90
56
+ },
57
+ {
58
+ title: "可拖动调整宽度",
59
+ dataIndex: "resizable",
60
+ width: 150
61
+ },
62
+ {
63
+ title: "超过宽度将自动省略",
64
+ dataIndex: "ellipsis",
65
+ resizable: true,
66
+ width: 150
67
+ },
68
+ {
69
+ title: this.i18nt("designer.setting.fixedColumn"),
70
+ dataIndex: "fixed",
71
+ resizable: true,
72
+ width: 100
73
+ },
74
+ {
75
+ title: this.i18nt("designer.setting.alignTypeOfColumn"),
76
+ dataIndex: "align",
77
+ resizable: true,
78
+ width: 100
79
+ },
80
+ {
81
+ title: "自定义渲染函数",
82
+ dataIndex: "customRender",
83
+ width: 120,
84
+ resizable: true,
85
+ fixed: "right"
86
+ },
87
+ {
88
+ title: this.i18nt("designer.setting.actionColumn"),
89
+ dataIndex: "action",
90
+ width: 80,
91
+ fixed: "right"
92
+ }
93
+ ],
18
94
  dialogVisible: false,
19
95
  currentTableColumn: {},
20
96
  renderJson: "",
@@ -27,27 +103,6 @@ const _sfc_main = {
27
103
  };
28
104
  },
29
105
  methods: {
30
- //表格拖动排序
31
- dragSort() {
32
- const el = document.querySelectorAll(
33
- "#singleTable .ant-table-body tbody.ant-table-tbody "
34
- )[0];
35
- const tableData = this.optionModel.tableColumns;
36
- this.sortable = Sortable.create(el, {
37
- ghostClass: "sortable-ghost",
38
- setData: function(dataTransfer) {
39
- dataTransfer.setData("Text", "");
40
- },
41
- onEnd: (e) => {
42
- const { oldIndex, newIndex } = e;
43
- if (oldIndex === newIndex) {
44
- return;
45
- }
46
- const targetRow = tableData.splice(e.oldIndex - 1, 1)[0];
47
- tableData.splice(newIndex - 1, 0, targetRow);
48
- }
49
- });
50
- },
51
106
  showRenderDialog(tableColumn) {
52
107
  this.currentTableColumn = tableColumn;
53
108
  this.renderJson = tableColumn.customRender || "";
@@ -65,7 +120,6 @@ const _sfc_main = {
65
120
  width: 150,
66
121
  sorter: false,
67
122
  customRender: "",
68
- autoHeight: false,
69
123
  fixed: "",
70
124
  align: "center",
71
125
  title: "标题名",
@@ -91,25 +145,21 @@ const _sfc_main = {
91
145
  },
92
146
  openSetting() {
93
147
  this.dialogVisible = true;
94
- this.$nextTick(() => {
95
- this.dragSort();
96
- });
97
148
  }
98
149
  }
99
150
  };
100
151
  const _hoisted_1 = { class: "table-wrap" };
101
- const _hoisted_2 = { class: "dialog-footer" };
152
+ const _hoisted_2 = { class: "add-btn" };
153
+ const _hoisted_3 = { class: "dialog-footer" };
102
154
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
103
155
  const _component_a_button = resolveComponent("a-button");
104
156
  const _component_a_form_item = resolveComponent("a-form-item");
105
- const _component_a_table_column = resolveComponent("a-table-column");
106
157
  const _component_a_input = resolveComponent("a-input");
107
- const _component_a_input_number = resolveComponent("a-input-number");
108
158
  const _component_a_switch = resolveComponent("a-switch");
109
159
  const _component_a_select_option = resolveComponent("a-select-option");
110
160
  const _component_a_select = resolveComponent("a-select");
111
161
  const _component_a_space = resolveComponent("a-space");
112
- const _component_a_table = resolveComponent("a-table");
162
+ const _component_s_table = resolveComponent("s-table");
113
163
  const _component_a_modal = resolveComponent("a-modal");
114
164
  const _component_CodeModalEditor = resolveComponent("CodeModalEditor");
115
165
  return openBlock(), createElementBlock(Fragment, null, [
@@ -133,7 +183,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
133
183
  createVNode(_component_a_modal, {
134
184
  title: _ctx.i18nt("designer.setting.tableColEdit"),
135
185
  visible: $data.dialogVisible,
136
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => $data.dialogVisible = $event),
186
+ "onUpdate:visible": _cache[3] || (_cache[3] = ($event) => $data.dialogVisible = $event),
137
187
  "show-close": true,
138
188
  "append-to-body": "",
139
189
  "close-on-click-modal": false,
@@ -142,10 +192,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
142
192
  width: "1200px"
143
193
  }, {
144
194
  footer: withCtx(() => [
145
- createElementVNode("div", _hoisted_2, [
195
+ createElementVNode("div", _hoisted_3, [
146
196
  createVNode(_component_a_button, {
147
197
  size: "default",
148
- onClick: _cache[0] || (_cache[0] = ($event) => $data.dialogVisible = false)
198
+ onClick: _cache[2] || (_cache[2] = ($event) => $data.dialogVisible = false)
149
199
  }, {
150
200
  default: withCtx(() => [
151
201
  createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
@@ -166,234 +216,137 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
166
216
  ]),
167
217
  default: withCtx(() => [
168
218
  createElementVNode("div", _hoisted_1, [
169
- createVNode(_component_a_table, {
219
+ createVNode(_component_s_table, {
170
220
  dataSource: $props.optionModel.tableColumns,
171
221
  style: { "width": "100%" },
172
- class: "tpf-table",
222
+ class: "tpf-surely-table",
223
+ deepWatchDataSource: "",
173
224
  "cell-style": { padding: "0" },
174
225
  height: "600",
175
- bordered: "",
176
- "row-key": (r) => r.columnId,
177
226
  id: "singleTable",
178
227
  scroll: { y: 300, x: 300 },
179
- pagination: false
228
+ pagination: false,
229
+ resizable: "",
230
+ "row-key": (record) => record.columnId,
231
+ columns: $data.columns
180
232
  }, {
181
- default: withCtx(() => [
182
- createVNode(_component_a_table_column, {
183
- title: "序号",
184
- width: 60,
185
- fixed: "left",
186
- customRender: ({ index }) => index + 1
187
- }, null, 8, ["customRender"]),
188
- createVNode(_component_a_table_column, {
189
- title: _ctx.i18nt("designer.setting.columnName"),
190
- width: 100,
191
- dataIndex: "dataIndex"
192
- }, {
193
- default: withCtx((scope) => [
194
- createVNode(_component_a_input, {
195
- value: scope.record.dataIndex,
196
- "onUpdate:value": ($event) => scope.record.dataIndex = $event,
197
- style: { "width": "90%" }
198
- }, null, 8, ["value", "onUpdate:value"])
199
- ]),
200
- _: 1
201
- }, 8, ["title"]),
202
- createVNode(_component_a_table_column, {
203
- title: _ctx.i18nt("designer.setting.columnLabel"),
204
- width: 100,
205
- dataIndex: "title"
206
- }, {
207
- default: withCtx((scope) => [
208
- createVNode(_component_a_input, {
209
- value: scope.record.title,
210
- "onUpdate:value": ($event) => scope.record.title = $event,
211
- style: { "width": "90%" }
212
- }, null, 8, ["value", "onUpdate:value"])
213
- ]),
214
- _: 1
215
- }, 8, ["title"]),
216
- createVNode(_component_a_table_column, {
217
- title: _ctx.i18nt("designer.setting.columnWidth"),
218
- width: 100,
219
- dataIndex: "width"
220
- }, {
221
- default: withCtx((scope) => [
222
- createVNode(_component_a_input_number, {
223
- min: 20,
224
- max: 500,
225
- value: scope.record.width,
226
- "onUpdate:value": ($event) => scope.record.width = $event
227
- }, null, 8, ["value", "onUpdate:value"])
228
- ]),
229
- _: 1
230
- }, 8, ["title"]),
231
- createVNode(_component_a_table_column, {
232
- title: _ctx.i18nt("designer.setting.visibleColumn"),
233
- width: 90,
234
- dataIndex: "show"
235
- }, {
236
- default: withCtx((scope) => [
237
- createVNode(_component_a_switch, {
238
- checked: scope.record.show,
239
- "onUpdate:checked": ($event) => scope.record.show = $event
240
- }, null, 8, ["checked", "onUpdate:checked"])
241
- ]),
242
- _: 1
243
- }, 8, ["title"]),
244
- createVNode(_component_a_table_column, {
245
- title: _ctx.i18nt("designer.setting.sortableColumn"),
246
- width: 90,
247
- dataIndex: "sorter"
248
- }, {
249
- default: withCtx((scope) => [
250
- createVNode(_component_a_switch, {
251
- checked: scope.record.sorter,
252
- "onUpdate:checked": ($event) => scope.record.sorter = $event
253
- }, null, 8, ["checked", "onUpdate:checked"])
254
- ]),
255
- _: 1
256
- }, 8, ["title"]),
257
- createVNode(_component_a_table_column, {
258
- title: `可拖动调整宽度`,
259
- width: 150,
260
- dataIndex: "resizable"
261
- }, {
262
- default: withCtx((scope) => [
263
- createVNode(_component_a_switch, {
264
- checked: scope.record.resizable,
265
- "onUpdate:checked": ($event) => scope.record.resizable = $event
266
- }, null, 8, ["checked", "onUpdate:checked"])
267
- ]),
268
- _: 1
269
- }),
270
- createVNode(_component_a_table_column, {
271
- title: "超过宽度将自动省略",
272
- width: 150,
273
- dataIndex: "ellipsis"
274
- }, {
275
- default: withCtx((scope) => [
276
- createVNode(_component_a_switch, {
277
- checked: scope.record.ellipsis,
278
- "onUpdate:checked": ($event) => scope.record.ellipsis = $event
279
- }, null, 8, ["checked", "onUpdate:checked"])
280
- ]),
281
- _: 1
282
- }),
283
- createVNode(_component_a_table_column, {
284
- title: _ctx.i18nt("designer.setting.fixedColumn"),
285
- width: 100,
286
- dataIndex: "fixed"
233
+ bodyCell: withCtx(({ column, recordIndexs }) => [
234
+ column.dataIndex === "dataIndex" ? (openBlock(), createBlock(_component_a_input, {
235
+ key: 0,
236
+ value: $props.optionModel.tableColumns[recordIndexs[0]].dataIndex,
237
+ "onUpdate:value": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].dataIndex = $event
238
+ }, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("", true),
239
+ column.dataIndex === "title" ? (openBlock(), createBlock(_component_a_input, {
240
+ key: 1,
241
+ value: $props.optionModel.tableColumns[recordIndexs[0]].title,
242
+ "onUpdate:value": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].title = $event
243
+ }, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("", true),
244
+ column.dataIndex === "width" ? (openBlock(), createBlock(_component_a_input, {
245
+ key: 2,
246
+ value: $props.optionModel.tableColumns[recordIndexs[0]].width,
247
+ "onUpdate:value": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].width = $event
248
+ }, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("", true),
249
+ column.dataIndex === "show" ? (openBlock(), createBlock(_component_a_input, {
250
+ key: 3,
251
+ value: $props.optionModel.tableColumns[recordIndexs[0]].show,
252
+ "onUpdate:value": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].show = $event
253
+ }, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("", true),
254
+ column.dataIndex === "sorter" ? (openBlock(), createBlock(_component_a_switch, {
255
+ key: 4,
256
+ checked: $props.optionModel.tableColumns[recordIndexs[0]].sorter,
257
+ "onUpdate:checked": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].sorter = $event
258
+ }, null, 8, ["checked", "onUpdate:checked"])) : createCommentVNode("", true),
259
+ column.dataIndex === "resizable" ? (openBlock(), createBlock(_component_a_switch, {
260
+ key: 5,
261
+ checked: $props.optionModel.tableColumns[recordIndexs[0]].resizable,
262
+ "onUpdate:checked": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].resizable = $event
263
+ }, null, 8, ["checked", "onUpdate:checked"])) : createCommentVNode("", true),
264
+ column.dataIndex === "ellipsis" ? (openBlock(), createBlock(_component_a_switch, {
265
+ key: 6,
266
+ checked: $props.optionModel.tableColumns[recordIndexs[0]].ellipsis,
267
+ "onUpdate:checked": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].ellipsis = $event
268
+ }, null, 8, ["checked", "onUpdate:checked"])) : createCommentVNode("", true),
269
+ column.dataIndex === "fixed" ? (openBlock(), createBlock(_component_a_select, {
270
+ key: 7,
271
+ value: $props.optionModel.tableColumns[recordIndexs[0]].fixed,
272
+ "onUpdate:value": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].fixed = $event,
273
+ allowClear: "",
274
+ style: {}
287
275
  }, {
288
- default: withCtx((scope) => [
289
- createVNode(_component_a_select, {
290
- value: scope.record.fixed,
291
- "onUpdate:value": ($event) => scope.record.fixed = $event,
292
- style: { "width": "90%" },
293
- allowClear: ""
294
- }, {
276
+ default: withCtx(() => [
277
+ createVNode(_component_a_select_option, { value: "left" }, {
278
+ default: withCtx(() => [
279
+ createTextVNode("左固定")
280
+ ]),
281
+ _: 1
282
+ }),
283
+ createVNode(_component_a_select_option, { value: "right" }, {
295
284
  default: withCtx(() => [
296
- createVNode(_component_a_select_option, { value: "left" }, {
297
- default: withCtx(() => [
298
- createTextVNode("左固定")
299
- ]),
300
- _: 1
301
- }),
302
- createVNode(_component_a_select_option, { value: "right" }, {
303
- default: withCtx(() => [
304
- createTextVNode("右固定")
305
- ]),
306
- _: 1
307
- })
285
+ createTextVNode("右固定")
308
286
  ]),
309
- _: 2
310
- }, 1032, ["value", "onUpdate:value"])
287
+ _: 1
288
+ })
311
289
  ]),
312
- _: 1
313
- }, 8, ["title"]),
314
- createVNode(_component_a_table_column, {
315
- title: _ctx.i18nt("designer.setting.alignTypeOfColumn"),
316
- width: 100,
317
- dataIndex: "align"
290
+ _: 2
291
+ }, 1032, ["value", "onUpdate:value"])) : createCommentVNode("", true),
292
+ column.dataIndex === "align" ? (openBlock(), createBlock(_component_a_select, {
293
+ key: 8,
294
+ style: {},
295
+ value: $props.optionModel.tableColumns[recordIndexs[0]].align,
296
+ "onUpdate:value": ($event) => $props.optionModel.tableColumns[recordIndexs[0]].align = $event,
297
+ options: $data.alignOptions
298
+ }, null, 8, ["value", "onUpdate:value", "options"])) : createCommentVNode("", true),
299
+ column.dataIndex === "customRender" ? (openBlock(), createBlock(_component_a_button, {
300
+ key: 9,
301
+ onClick: ($event) => $options.showRenderDialog(_ctx.index, column.dataIndex),
302
+ size: "small",
303
+ shape: "round"
318
304
  }, {
319
- default: withCtx((scope) => [
320
- createVNode(_component_a_select, {
321
- value: scope.record.align,
322
- "onUpdate:value": ($event) => scope.record.align = $event,
323
- options: $data.alignOptions,
324
- style: { "width": "100%" }
325
- }, null, 8, ["value", "onUpdate:value", "options"])
305
+ default: withCtx(() => [
306
+ createTextVNode(" edit ")
326
307
  ]),
327
- _: 1
328
- }, 8, ["title"]),
329
- createVNode(_component_a_table_column, {
330
- align: "center",
331
- title: "自定义渲染函数",
332
- width: 120,
333
- fixed: "right"
334
- }, {
335
- default: withCtx((scope) => [
336
- createVNode(_component_a_button, {
337
- onClick: ($event) => $options.showRenderDialog(scope.record),
308
+ _: 2
309
+ }, 1032, ["onClick"])) : createCommentVNode("", true),
310
+ column.dataIndex === "action" ? (openBlock(), createBlock(_component_a_space, { key: 10 }, {
311
+ default: withCtx(() => [
312
+ $props.optionModel.tableColumns.length !== 1 ? (openBlock(), createBlock(_component_a_button, {
313
+ key: 0,
314
+ title: _ctx.i18nt("designer.setting.deleteTableColumn"),
338
315
  size: "small",
339
- shape: "round"
316
+ onClick: _cache[0] || (_cache[0] = ($event) => $options.handleDelete(_ctx.scope.$index, _ctx.scope.row)),
317
+ type: "text"
340
318
  }, {
341
319
  default: withCtx(() => [
342
- createTextVNode(" edit ")
343
- ]),
344
- _: 2
345
- }, 1032, ["onClick"])
346
- ]),
347
- _: 1
348
- }),
349
- createVNode(_component_a_table_column, {
350
- align: "center",
351
- title: _ctx.i18nt("designer.setting.actionColumn"),
352
- width: 120,
353
- fixed: "right"
354
- }, {
355
- default: withCtx((scope) => [
356
- createVNode(_component_a_space, null, {
357
- default: withCtx(() => [
358
- createVNode(_component_a_button, {
359
- title: _ctx.i18nt("designer.setting.addTableColumn"),
360
- size: "small",
361
- onClick: $options.addCol,
362
- type: "text"
363
- }, {
364
- default: withCtx(() => [
365
- createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.addTableColumn")), 1)
366
- ]),
367
- _: 1
368
- }, 8, ["title", "onClick"]),
369
- $props.optionModel.tableColumns.length !== 1 ? (openBlock(), createBlock(_component_a_button, {
370
- key: 0,
371
- title: _ctx.i18nt("designer.setting.deleteTableColumn"),
372
- size: "small",
373
- onClick: ($event) => $options.handleDelete(scope.$index, scope.row),
374
- type: "text"
375
- }, {
376
- default: withCtx(() => [
377
- createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.deleteTableColumn")), 1)
378
- ]),
379
- _: 2
380
- }, 1032, ["title", "onClick"])) : createCommentVNode("", true)
320
+ createTextVNode(" 删除 ")
381
321
  ]),
382
- _: 2
383
- }, 1024)
322
+ _: 1
323
+ }, 8, ["title"])) : createCommentVNode("", true)
384
324
  ]),
385
325
  _: 1
386
- }, 8, ["title"])
326
+ })) : createCommentVNode("", true)
387
327
  ]),
388
328
  _: 1
389
- }, 8, ["dataSource", "row-key"])
329
+ }, 8, ["dataSource", "row-key", "columns"]),
330
+ createElementVNode("div", _hoisted_2, [
331
+ createVNode(_component_a_button, {
332
+ title: _ctx.i18nt("designer.setting.addTableColumn"),
333
+ type: "primary",
334
+ size: "medium",
335
+ onClick: _cache[1] || (_cache[1] = ($event) => $options.addCol())
336
+ }, {
337
+ default: withCtx(() => [
338
+ createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.addTableColumn")), 1)
339
+ ]),
340
+ _: 1
341
+ }, 8, ["title"])
342
+ ])
390
343
  ])
391
344
  ]),
392
345
  _: 1
393
346
  }, 8, ["title", "visible"]),
394
347
  createVNode(_component_CodeModalEditor, {
395
348
  modelValue: $data.renderJson,
396
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.renderJson = $event),
349
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.renderJson = $event),
397
350
  onSave: $options.saveColumnRender,
398
351
  ref: "CodeModalEditorRef",
399
352
  title: _ctx.i18nt("designer.setting.renderFunction"),
@@ -401,7 +354,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
401
354
  }, null, 8, ["modelValue", "onSave", "title", "event-header"])
402
355
  ], 64);
403
356
  }
404
- const dataTableTableColumnsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-56fe3743"]]);
357
+ const dataTableTableColumnsEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ec98caec"]]);
405
358
  export {
406
359
  dataTableTableColumnsEditor as default
407
360
  };
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-tableColumns-editor.vue.js","sources":["../../../../../../../src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue"],"sourcesContent":["<template>\n <a-form-item :label=\"i18nt('designer.setting.tableColEdit')\">\n <a-button type=\"primary\" shape=\"round\" @click=\"openSetting\">\n {{ i18nt('designer.setting.editAction') }}\n </a-button>\n </a-form-item>\n <a-modal\n :title=\"i18nt('designer.setting.tableColEdit')\"\n v-model:visible=\"dialogVisible\"\n :show-close=\"true\"\n append-to-body\n :close-on-click-modal=\"false\"\n :close-on-press-escape=\"false\"\n :destroy-on-close=\"true\"\n width=\"1200px\"\n >\n <div class=\"table-wrap\">\n <a-table\n :dataSource=\"optionModel.tableColumns\"\n style=\"width: 100%\"\n class=\"tpf-table\"\n :cell-style=\"{ padding: '0' }\"\n height=\"600\"\n bordered\n :row-key=\"r => r.columnId\"\n id=\"singleTable\"\n :scroll=\"{ y: 300, x: 300 }\"\n :pagination=\"false\"\n >\n <a-table-column\n title=\"序号\"\n :width=\"60\"\n fixed=\"left\"\n :customRender=\"({ index }) => index + 1\"\n />\n <a-table-column\n :title=\"i18nt('designer.setting.columnName')\"\n :width=\"100\"\n dataIndex=\"dataIndex\"\n >\n <template #default=\"scope\">\n <a-input v-model:value=\"scope.record.dataIndex\" style=\"width: 90%\" />\n </template>\n </a-table-column>\n <a-table-column\n :title=\"i18nt('designer.setting.columnLabel')\"\n :width=\"100\"\n dataIndex=\"title\"\n >\n <template #default=\"scope\">\n <a-input v-model:value=\"scope.record.title\" style=\"width: 90%\" />\n </template>\n </a-table-column>\n <a-table-column\n :title=\"i18nt('designer.setting.columnWidth')\"\n :width=\"100\"\n dataIndex=\"width\"\n >\n <template #default=\"scope\">\n <a-input-number :min=\"20\" :max=\"500\" v-model:value=\"scope.record.width\" />\n </template>\n </a-table-column>\n <a-table-column\n :title=\"i18nt('designer.setting.visibleColumn')\"\n :width=\"90\"\n dataIndex=\"show\"\n >\n <template #default=\"scope\">\n <a-switch v-model:checked=\"scope.record.show\" />\n </template>\n </a-table-column>\n <a-table-column\n :title=\"i18nt('designer.setting.sortableColumn')\"\n :width=\"90\"\n dataIndex=\"sorter\"\n >\n <template #default=\"scope\">\n <a-switch v-model:checked=\"scope.record.sorter\" />\n </template>\n </a-table-column>\n <a-table-column :title=\"`可拖动调整宽度`\" :width=\"150\" dataIndex=\"resizable\">\n <template #default=\"scope\">\n <a-switch v-model:checked=\"scope.record.resizable\" />\n </template>\n </a-table-column>\n <a-table-column :title=\"'超过宽度将自动省略'\" :width=\"150\" dataIndex=\"ellipsis\">\n <template #default=\"scope\">\n <a-switch v-model:checked=\"scope.record.ellipsis\" />\n </template>\n </a-table-column>\n <a-table-column\n :title=\"i18nt('designer.setting.fixedColumn')\"\n :width=\"100\"\n dataIndex=\"fixed\"\n >\n <template #default=\"scope\">\n <a-select v-model:value=\"scope.record.fixed\" style=\"width: 90%\" allowClear>\n <a-select-option value=\"left\">左固定</a-select-option>\n <a-select-option value=\"right\">右固定</a-select-option>\n </a-select>\n </template>\n </a-table-column>\n <a-table-column\n :title=\"i18nt('designer.setting.alignTypeOfColumn')\"\n :width=\"100\"\n dataIndex=\"align\"\n >\n <template #default=\"scope\">\n <a-select\n v-model:value=\"scope.record.align\"\n :options=\"alignOptions\"\n style=\"width: 100%\"\n />\n </template>\n </a-table-column>\n <a-table-column align=\"center\" :title=\"'自定义渲染函数'\" :width=\"120\" fixed=\"right\">\n <template #default=\"scope\">\n <a-button\n @click=\"showRenderDialog(scope.record)\"\n size=\"small\"\n shape=\"round\"\n >\n edit\n </a-button>\n </template>\n </a-table-column>\n <a-table-column\n align=\"center\"\n :title=\"i18nt('designer.setting.actionColumn')\"\n :width=\"120\"\n fixed=\"right\"\n >\n <template #default=\"scope\">\n <a-space>\n <a-button\n :title=\"i18nt('designer.setting.addTableColumn')\"\n size=\"small\"\n @click=\"addCol\"\n type=\"text\"\n >\n {{ i18nt('designer.setting.addTableColumn') }}\n </a-button>\n <a-button\n v-if=\"optionModel.tableColumns.length !== 1\"\n :title=\"i18nt('designer.setting.deleteTableColumn')\"\n size=\"small\"\n @click=\"handleDelete(scope.$index, scope.row)\"\n type=\"text\"\n >\n {{ i18nt('designer.setting.deleteTableColumn') }}\n </a-button>\n </a-space>\n </template>\n </a-table-column>\n </a-table>\n </div>\n <template #footer>\n <div class=\"dialog-footer\">\n <a-button size=\"default\" @click=\"dialogVisible = false\">\n {{ i18nt('designer.hint.cancel') }}\n </a-button>\n <a-button size=\"default\" type=\"primary\" @click=\"colSubmit\">\n {{ i18nt('designer.hint.confirm') }}\n </a-button>\n </div>\n </template>\n </a-modal>\n\n <CodeModalEditor\n v-model=\"renderJson\"\n @save=\"saveColumnRender\"\n ref=\"CodeModalEditorRef\"\n :title=\"i18nt('designer.setting.renderFunction')\"\n :event-header=\"`async function customRender(scope) {`\"\n />\n</template>\n\n<script>\n import i18n from '@/utils/i18n';\n import Sortable from 'sortablejs';\n import CodeModalEditor from '@/components/code-editor/code-modal-editor.vue';\n\n export default {\n name: 'tableColumns-editor',\n mixins: [i18n],\n components: { CodeModalEditor },\n props: {\n designer: Object,\n selectedWidget: Object,\n optionModel: Object\n },\n data() {\n return {\n dialogVisible: false,\n currentTableColumn: {},\n renderJson: '',\n showRenderDialogFlag: false,\n alignOptions: [\n { value: 'left', label: 'left' },\n { value: 'center', label: 'center' },\n { value: 'right', label: 'right' }\n ]\n };\n },\n methods: {\n //表格拖动排序\n dragSort() {\n const el = document.querySelectorAll(\n '#singleTable .ant-table-body tbody.ant-table-tbody '\n )[0];\n\n const tableData = this.optionModel.tableColumns;\n this.sortable = Sortable.create(el, {\n ghostClass: 'sortable-ghost',\n setData: function (dataTransfer) {\n dataTransfer.setData('Text', '');\n },\n onEnd: e => {\n const { oldIndex, newIndex } = e;\n if (oldIndex === newIndex) {\n return;\n }\n //e.oldIndex为拖动一行原来的位置,e.newIndex为拖动后新的位置\n const targetRow = tableData.splice(e.oldIndex - 1, 1)[0];\n tableData.splice(newIndex - 1, 0, targetRow);\n }\n });\n },\n showRenderDialog(tableColumn) {\n this.currentTableColumn = tableColumn;\n this.renderJson = tableColumn.customRender || '';\n // this.showRenderDialogFlag = true;\n this.$refs.CodeModalEditorRef.open(this.renderJson);\n },\n saveColumnRender() {\n this.currentTableColumn.customRender = this.renderJson;\n console.log('this.renderJson: ', this.renderJson);\n this.showRenderDialogFlag = false;\n },\n addCol() {\n const newRow = {\n columnId: new Date().getTime(),\n show: true,\n width: 150,\n sorter: false,\n customRender: '',\n autoHeight: false,\n fixed: '',\n align: 'center',\n title: '标题名',\n dataIndex: '',\n resizable: true,\n showSorterTooltip: false\n };\n this.optionModel.tableColumns.push(newRow);\n this.designer.emitHistoryChange();\n },\n handleDelete(index, row) {\n if (this.optionModel.tableColumns.length === 1) {\n this.$message.warning(\n this.i18nt('designer.setting.onlyOneColumnCannotBeDeleted')\n );\n return false;\n }\n this.optionModel.tableColumns.splice(index, 1);\n },\n // 确认表格列更改\n colSubmit() {\n this.dialogVisible = false;\n },\n openSetting() {\n this.dialogVisible = true;\n this.$nextTick(() => {\n this.dragSort();\n });\n }\n }\n };\n</script>\n\n<style lang=\"less\" scoped>\n .drag-option {\n cursor: move;\n }\n .table-wrap {\n display: flex;\n font-size: 12px;\n :deep(.ant-table) {\n .ant-table-body {\n height: 50vh;\n }\n }\n :deep(.ant-input) {\n font-size: 12px;\n }\n }\n</style>\n"],"names":["_createVNode","_createElementVNode","_withCtx","_createBlock"],"mappings":";;;;;;AAsLI,MAAK,YAAU;AAAA,EACX,MAAM;AAAA,EACN,QAAQ,CAAC,IAAI;AAAA,EACb,YAAY,EAAE,gBAAiB;AAAA,EAC/B,OAAO;AAAA,IACH,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,aAAa;AAAA,EAChB;AAAA,EACD,OAAO;AACH,WAAO;AAAA,MACH,eAAe;AAAA,MACf,oBAAoB,CAAE;AAAA,MACtB,YAAY;AAAA,MACZ,sBAAsB;AAAA,MACtB,cAAc;AAAA,QACV,EAAE,OAAO,QAAQ,OAAO,OAAQ;AAAA,QAChC,EAAE,OAAO,UAAU,OAAO,SAAU;AAAA,QACpC,EAAE,OAAO,SAAS,OAAO,QAAQ;AAAA,MACrC;AAAA,IACH;AAAA,EACJ;AAAA,EACD,SAAS;AAAA;AAAA,IAEL,WAAW;AACP,YAAM,KAAK,SAAS;AAAA,QAChB;AAAA,MACH,EAAC,CAAC;AAEH,YAAM,YAAY,KAAK,YAAY;AACnC,WAAK,WAAW,SAAS,OAAO,IAAI;AAAA,QAChC,YAAY;AAAA,QACZ,SAAS,SAAU,cAAc;AAC7B,uBAAa,QAAQ,QAAQ,EAAE;AAAA,QAClC;AAAA,QACD,OAAO,OAAK;AACR,gBAAM,EAAE,UAAU,SAAO,IAAM;AAC/B,cAAI,aAAa,UAAU;AACvB;AAAA,UACJ;AAEA,gBAAM,YAAY,UAAU,OAAO,EAAE,WAAW,GAAG,CAAC,EAA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AA;AAAA,kBALW,MAAU;AAAA,mEAAV,MAAU,aAAA;AAAA,MAClB,QAAM,SAAgB;AAAA,MACvB,KAAI;AAAA,MACH,OAAO,KAAK,MAAA,iCAAA;AAAA,MACZ,gBAAc;AAAA;;;;"}
1
+ {"version":3,"file":"data-table-tableColumns-editor.vue.js","sources":["../../../../../../../src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue"],"sourcesContent":["<template>\n <a-form-item :label=\"i18nt('designer.setting.tableColEdit')\">\n <a-button type=\"primary\" shape=\"round\" @click=\"openSetting\">\n {{ i18nt('designer.setting.editAction') }}\n </a-button>\n </a-form-item>\n <a-modal\n :title=\"i18nt('designer.setting.tableColEdit')\"\n v-model:visible=\"dialogVisible\"\n :show-close=\"true\"\n append-to-body\n :close-on-click-modal=\"false\"\n :close-on-press-escape=\"false\"\n :destroy-on-close=\"true\"\n width=\"1200px\"\n >\n <div class=\"table-wrap\">\n <s-table\n :dataSource=\"optionModel.tableColumns\"\n style=\"width: 100%\"\n class=\"tpf-surely-table\"\n deepWatchDataSource\n :cell-style=\"{ padding: '0' }\"\n height=\"600\"\n id=\"singleTable\"\n :scroll=\"{ y: 300, x: 300 }\"\n :pagination=\"false\"\n resizable\n :row-key=\"record => record.columnId\"\n :columns=\"columns\"\n >\n <template #bodyCell=\"{ column, recordIndexs }\">\n <template v-if=\"column.dataIndex === 'dataIndex'\">\n <a-input\n v-model:value=\"optionModel.tableColumns[recordIndexs[0]].dataIndex\"\n />\n </template>\n <template v-if=\"column.dataIndex === 'title'\">\n <a-input v-model:value=\"optionModel.tableColumns[recordIndexs[0]].title\" />\n </template>\n <template v-if=\"column.dataIndex === 'width'\">\n <a-input v-model:value=\"optionModel.tableColumns[recordIndexs[0]].width\" />\n </template>\n <template v-if=\"column.dataIndex === 'show'\">\n <a-input v-model:value=\"optionModel.tableColumns[recordIndexs[0]].show\" />\n </template>\n <template v-if=\"column.dataIndex === 'sorter'\">\n <a-switch\n v-model:checked=\"optionModel.tableColumns[recordIndexs[0]].sorter\"\n />\n </template>\n <template v-if=\"column.dataIndex === 'resizable'\">\n <a-switch\n v-model:checked=\"optionModel.tableColumns[recordIndexs[0]].resizable\"\n />\n </template>\n <template v-if=\"column.dataIndex === 'ellipsis'\">\n <a-switch\n v-model:checked=\"optionModel.tableColumns[recordIndexs[0]].ellipsis\"\n />\n </template>\n <template v-if=\"column.dataIndex === 'fixed'\">\n <a-select\n v-model:value=\"optionModel.tableColumns[recordIndexs[0]].fixed\"\n allowClear\n style=\"100%\"\n >\n <a-select-option value=\"left\">左固定</a-select-option>\n <a-select-option value=\"right\">右固定</a-select-option>\n </a-select>\n </template>\n <template v-if=\"column.dataIndex === 'align'\">\n <a-select\n style=\"100%\"\n v-model:value=\"optionModel.tableColumns[recordIndexs[0]].align\"\n :options=\"alignOptions\"\n />\n </template>\n <template v-if=\"column.dataIndex === 'customRender'\">\n <a-button\n @click=\"showRenderDialog(index, column.dataIndex)\"\n size=\"small\"\n shape=\"round\"\n >\n edit\n </a-button>\n </template>\n <template v-if=\"column.dataIndex === 'action'\">\n <a-space>\n <a-button\n v-if=\"optionModel.tableColumns.length !== 1\"\n :title=\"i18nt('designer.setting.deleteTableColumn')\"\n size=\"small\"\n @click=\"handleDelete(scope.$index, scope.row)\"\n type=\"text\"\n >\n 删除\n </a-button>\n </a-space>\n </template>\n </template>\n </s-table>\n <div class=\"add-btn\">\n <a-button\n :title=\"i18nt('designer.setting.addTableColumn')\"\n type=\"primary\"\n size=\"medium\"\n @click=\"addCol()\"\n >\n {{ i18nt('designer.setting.addTableColumn') }}\n </a-button>\n </div>\n </div>\n <template #footer>\n <div class=\"dialog-footer\">\n <a-button size=\"default\" @click=\"dialogVisible = false\">\n {{ i18nt('designer.hint.cancel') }}\n </a-button>\n <a-button size=\"default\" type=\"primary\" @click=\"colSubmit\">\n {{ i18nt('designer.hint.confirm') }}\n </a-button>\n </div>\n </template>\n </a-modal>\n\n <CodeModalEditor\n v-model=\"renderJson\"\n @save=\"saveColumnRender\"\n ref=\"CodeModalEditorRef\"\n :title=\"i18nt('designer.setting.renderFunction')\"\n :event-header=\"`async function customRender(scope) {`\"\n />\n</template>\n\n<script>\n import i18n from '@/utils/i18n';\n import CodeModalEditor from '@/components/code-editor/code-modal-editor.vue';\n export default {\n name: 'tableColumns-editor',\n mixins: [i18n],\n components: { CodeModalEditor },\n props: {\n designer: Object,\n selectedWidget: Object,\n optionModel: Object\n },\n data() {\n return {\n columns: [\n {\n title: '序号',\n dataIndex: 'index',\n width: 60,\n fixed: 'left',\n rowDrag: true,\n resizable: true,\n customRender: ({ index }) => index + 1\n },\n {\n title: this.i18nt('designer.setting.columnName'),\n dataIndex: 'dataIndex',\n resizable: true,\n width: 100\n },\n {\n title: this.i18nt('designer.setting.columnLabel'),\n dataIndex: 'title',\n resizable: true,\n width: 100\n },\n {\n title: this.i18nt('designer.setting.columnWidth'),\n dataIndex: 'width',\n resizable: true,\n width: 100\n },\n {\n title: this.i18nt('designer.setting.visibleColumn'),\n dataIndex: 'show',\n resizable: true,\n width: 90\n },\n {\n title: this.i18nt('designer.setting.sortableColumn'),\n dataIndex: 'sorter',\n resizable: true,\n width: 90\n },\n {\n title: '可拖动调整宽度',\n dataIndex: 'resizable',\n width: 150\n },\n {\n title: '超过宽度将自动省略',\n dataIndex: 'ellipsis',\n resizable: true,\n width: 150\n },\n {\n title: this.i18nt('designer.setting.fixedColumn'),\n dataIndex: 'fixed',\n resizable: true,\n width: 100\n },\n {\n title: this.i18nt('designer.setting.alignTypeOfColumn'),\n dataIndex: 'align',\n resizable: true,\n width: 100\n },\n {\n title: '自定义渲染函数',\n dataIndex: 'customRender',\n width: 120,\n resizable: true,\n fixed: 'right'\n },\n {\n title: this.i18nt('designer.setting.actionColumn'),\n dataIndex: 'action',\n width: 80,\n fixed: 'right'\n }\n ],\n dialogVisible: false,\n currentTableColumn: {},\n renderJson: '',\n showRenderDialogFlag: false,\n alignOptions: [\n { value: 'left', label: 'left' },\n { value: 'center', label: 'center' },\n { value: 'right', label: 'right' }\n ]\n };\n },\n methods: {\n showRenderDialog(tableColumn) {\n this.currentTableColumn = tableColumn;\n this.renderJson = tableColumn.customRender || '';\n // this.showRenderDialogFlag = true;\n this.$refs.CodeModalEditorRef.open(this.renderJson);\n },\n saveColumnRender() {\n this.currentTableColumn.customRender = this.renderJson;\n console.log('this.renderJson: ', this.renderJson);\n this.showRenderDialogFlag = false;\n },\n addCol() {\n const newRow = {\n columnId: new Date().getTime(),\n show: true,\n width: 150,\n sorter: false,\n customRender: '',\n fixed: '',\n align: 'center',\n title: '标题名',\n dataIndex: '',\n resizable: true,\n showSorterTooltip: false\n };\n this.optionModel.tableColumns.push(newRow);\n this.designer.emitHistoryChange();\n },\n handleDelete(index, row) {\n if (this.optionModel.tableColumns.length === 1) {\n this.$message.warning(\n this.i18nt('designer.setting.onlyOneColumnCannotBeDeleted')\n );\n return false;\n }\n this.optionModel.tableColumns.splice(index, 1);\n },\n // 确认表格列更改\n colSubmit() {\n this.dialogVisible = false;\n },\n openSetting() {\n this.dialogVisible = true;\n }\n }\n };\n</script>\n\n<style lang=\"less\" scoped>\n .drag-option {\n cursor: move;\n }\n .table-wrap {\n display: flex;\n font-size: 12px;\n flex-direction: column;\n :deep(.surely-table-body) {\n height: 50vh;\n }\n :deep(.ant-input) {\n font-size: 12px;\n }\n .add-btn {\n margin-top: 10px;\n text-align: center;\n }\n }\n</style>\n"],"names":["_createVNode","_createElementVNode","_withCtx","_createBlock"],"mappings":";;;;;AAyII,MAAK,YAAU;AAAA,EACX,MAAM;AAAA,EACN,QAAQ,CAAC,IAAI;AAAA,EACb,YAAY,EAAE,gBAAiB;AAAA,EAC/B,OAAO;AAAA,IACH,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,aAAa;AAAA,EAChB;AAAA,EACD,OAAO;AACH,WAAO;AAAA,MACH,SAAS;AAAA,QACL;AAAA,UACI,OAAO;AAAA,UACP,WAAW;AAAA,UACX,OAAO;AAAA,UACP,OA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KhBF,mBASM,OATN,YASM;AAAA,YARFD,YAOW,qBAAA;AAAA,cANN,OAAO,KAAK,MAAA,iCAAA;AAAA,cACb,MAAK;AAAA,cACL,MAAK;AAAA,cACJ,+CAAO,SAAM;;+BAEd,MAA8C;AAAA,gDAA3C,KAAK,MAAA,iCAAA,CAAA,GAAA,CAAA;AAAA;;;;;;;;IAgBxBA,YAME,4BAAA;AAAA,kBALW,MAAU;AAAA,mEAAV,MAAU,aAAA;AAAA,MAClB,QAAM,SAAgB;AAAA,MACvB,KAAI;AAAA,MACH,OAAO,KAAK,MAAA,iCAAA;AAAA,MACZ,gBAAc;AAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, withCtx, createTextVNode, normalizeClass, toDisplayString, unref, createElementVNode } from "vue";
1
+ import { defineComponent, ref, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, withCtx, normalizeClass, createTextVNode, toDisplayString, unref, createElementVNode } from "vue";
2
2
  import { useI18n } from "../../utils/i18n.js";
3
3
  import CodeEditor from "../code-editor/index.vue.js";
4
4
  import { message } from "ant-design-vue";
@@ -63,8 +63,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
63
63
  createTextVNode(toDisplayString(unref(i18nt)("designer.setting.addEventHandler")), 1)
64
64
  ]),
65
65
  _: 1
66
- }, 8, ["class"]),
67
- createTextVNode(" " + toDisplayString(_ctx.moduleValue), 1)
66
+ }, 8, ["class"])
68
67
  ]),
69
68
  _: 1
70
69
  }, 8, ["label"]),