cloud-web-corejs 1.0.73 → 1.0.74

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.
@@ -31,24 +31,45 @@
31
31
  <span>{{ scope.$index + 1 }}</span>
32
32
  </template>
33
33
  </el-table-column>
34
- <el-table-column label="" width="35" fixed="left"><i class="el-icon-s-operation drag-option"></i>
34
+ <el-table-column label="" width="35" fixed="left"
35
+ ><i class="el-icon-s-operation drag-option"></i>
35
36
  </el-table-column>
36
- <el-table-column :label="i18nt('designer.setting.columnLabel')" width="150" prop="label" fixed="left">
37
+ <el-table-column
38
+ :label="i18nt('designer.setting.columnLabel')"
39
+ width="150"
40
+ prop="label"
41
+ fixed="left"
42
+ >
37
43
  <template slot-scope="scope">
38
44
  <el-input v-model="scope.row.label"></el-input>
39
45
  </template>
40
46
  </el-table-column>
41
- <el-table-column :label="i18nt('designer.setting.columnName')" width="150" prop="prop">
47
+ <el-table-column
48
+ :label="i18nt('designer.setting.columnName')"
49
+ width="150"
50
+ prop="prop"
51
+ >
42
52
  <template slot-scope="scope">
43
- <el-input v-model="scope.row.prop" :disabled="'editAttachment' == scope.row.formatS"></el-input>
53
+ <el-input
54
+ v-model="scope.row.prop"
55
+ :disabled="'editAttachment' == scope.row.formatS"
56
+ ></el-input>
44
57
  </template>
45
58
  </el-table-column>
46
- <el-table-column :label="i18nt('designer.setting.columnWidth')" width="100" prop="width">
59
+ <el-table-column
60
+ :label="i18nt('designer.setting.columnWidth')"
61
+ width="100"
62
+ prop="width"
63
+ >
47
64
  <template slot-scope="scope">
48
65
  <el-input v-model="scope.row.width"></el-input>
49
66
  </template>
50
67
  </el-table-column>
51
- <el-table-column :label="i18nt('designer.setting.visibleColumn')" width="70" prop="show">
68
+ <el-table-column
69
+ :label="i18nt('designer.setting.visibleColumn')"
70
+ width="70"
71
+ prop="show"
72
+ >
52
73
  <template slot-scope="scope">
53
74
  <el-switch v-model="scope.row.show"></el-switch>
54
75
  </template>
@@ -58,7 +79,11 @@
58
79
  <el-switch v-model="scope.row.required"></el-switch>
59
80
  </template>
60
81
  </el-table-column>
61
- <el-table-column :label="i18nt('designer.setting.sortableColumn')" width="70" prop="sortable">
82
+ <el-table-column
83
+ :label="i18nt('designer.setting.sortableColumn')"
84
+ width="70"
85
+ prop="sortable"
86
+ >
62
87
  <template slot-scope="scope">
63
88
  <el-switch v-model="scope.row.sortable"></el-switch>
64
89
  </template>
@@ -68,7 +93,11 @@
68
93
  <el-switch v-model="scope.row.isItemLine"></el-switch>
69
94
  </template>
70
95
  </el-table-column>
71
- <el-table-column :label="i18nt('designer.setting.fixedColumn')" width="100" prop="fixed">
96
+ <el-table-column
97
+ :label="i18nt('designer.setting.fixedColumn')"
98
+ width="100"
99
+ prop="fixed"
100
+ >
72
101
  <template slot-scope="scope">
73
102
  <el-select v-model="scope.row.fixed" clearable>
74
103
  <el-option value="left">left</el-option>
@@ -83,22 +112,44 @@
83
112
  </el-select>
84
113
  </template>
85
114
  </el-table-column>-->
86
- <el-table-column :label="i18nt('designer.setting.formatOfColumn')" width="200" prop="formatS">
115
+ <el-table-column
116
+ :label="i18nt('designer.setting.formatOfColumn')"
117
+ width="200"
118
+ prop="formatS"
119
+ >
87
120
  <template slot-scope="scope">
88
- <el-select v-model="scope.row.formatS" @change="changeFormatS(scope.row)" clearable>
89
- <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
121
+ <el-select
122
+ v-model="scope.row.formatS"
123
+ @change="changeFormatS(scope.row)"
124
+ clearable
125
+ >
126
+ <el-option-group
127
+ :label="i18nt('designer.setting.customRenderGroup')"
128
+ >
90
129
  <el-option value="render" label="render"></el-option>
91
130
  </el-option-group>
92
- <el-option-group v-for="t in op" :key="t.label" :label="t.label">
93
- <el-option v-for="e in t.options" :key="e.value" :value="e.value" :label="e.label"></el-option>
131
+ <el-option-group
132
+ v-for="t in op"
133
+ :key="t.label"
134
+ :label="t.label"
135
+ >
136
+ <el-option
137
+ v-for="e in t.options"
138
+ :key="e.value"
139
+ :value="e.value"
140
+ :label="e.label"
141
+ ></el-option>
94
142
  </el-option-group>
95
143
  </el-select>
96
144
  </template>
97
145
  </el-table-column>
98
146
  <el-table-column :label="i18nt('自定义表格列配置')" width="150">
99
147
  <template slot-scope="scope">
100
- <a href="javascript:void(0);" class="a-link link-oneLind"
101
- @click="openTableColumnConfigDialog(scope.row,scope.$index)">
148
+ <a
149
+ href="javascript:void(0);"
150
+ class="a-link link-oneLind"
151
+ @click="openTableColumnConfigDialog(scope.row, scope.$index)"
152
+ >
102
153
  <span>{{ scope.row.tableColumnConfig }}</span>
103
154
  <i class="el-icon-edit"></i>
104
155
  </a>
@@ -109,21 +160,43 @@
109
160
  <el-switch v-model="scope.row.treeNode"></el-switch>
110
161
  </template>
111
162
  </el-table-column>
112
- <el-table-column :label="i18nt('编辑插槽类型')" width="200" prop="editFormatS">
163
+ <el-table-column
164
+ :label="i18nt('编辑插槽类型')"
165
+ width="200"
166
+ prop="editFormatS"
167
+ >
113
168
  <template slot-scope="scope">
114
- <el-select v-model="scope.row.editFormatS" @change="changeFormatS(scope.row)" clearable>
115
- <el-option v-for="e in editOp" :key="e.value" :value="e.value" :label="e.label"></el-option>
169
+ <el-select
170
+ v-model="scope.row.editFormatS"
171
+ @change="changeFormatS(scope.row)"
172
+ clearable
173
+ >
174
+ <el-option
175
+ v-for="e in editOp"
176
+ :key="e.value"
177
+ :value="e.value"
178
+ :label="e.label"
179
+ ></el-option>
116
180
  </el-select>
117
181
  </template>
118
182
  </el-table-column>
119
- <el-table-column label="编辑插槽配置" width="70" align="center">
183
+ <el-table-column label="编辑插槽配置" width="150" align="center">
120
184
  <template slot-scope="scope">
121
- <el-button size="mini" plain="" round="" icon="el-icon-edit"
122
- @click="openEditFormatConfigDialog(scope.row,scope.$index)"
123
- :disabled="!scope.row.editFormatS"></el-button>
185
+ <el-button
186
+ size="mini"
187
+ plain=""
188
+ round=""
189
+ icon="el-icon-edit"
190
+ @click="openEditFormatConfigDialog(scope.row, scope.$index)"
191
+ :disabled="!scope.row.editFormatS"
192
+ ></el-button>
124
193
  </template>
125
194
  </el-table-column>
126
- <el-table-column :label="i18nt('导出类型')" width="200" prop="formatS">
195
+ <el-table-column
196
+ :label="i18nt('导出类型')"
197
+ width="200"
198
+ prop="formatS"
199
+ >
127
200
  <template slot-scope="scope">
128
201
  <el-select v-model="scope.row.exportType" clearable>
129
202
  <el-option value="Image2" label="图片"></el-option>
@@ -131,17 +204,71 @@
131
204
  </el-select>
132
205
  </template>
133
206
  </el-table-column>
134
- <el-table-column label="格式化配置" width="90" fixed="right" align="center">
207
+
208
+ <el-table-column
209
+ :label="i18nt('表尾统计行类型')"
210
+ width="200"
211
+ prop="formatS"
212
+ >
135
213
  <template slot-scope="scope">
136
- <el-button size="mini" plain="" round="" icon="el-icon-edit"
137
- @click="openFormatConfigDialog(scope.row,scope.$index)"
138
- :disabled="!columnFormatMap[scope.row.formatS]"></el-button>
214
+ <el-select v-model="scope.row.footerDataType" clearable>
215
+ <el-option value="1" label="合计"></el-option>
216
+ <el-option value="2" label="平均"></el-option>
217
+ <el-option value="3" label="自定义"></el-option>
218
+ </el-select>
139
219
  </template>
140
220
  </el-table-column>
141
- <el-table-column :label="i18nt('designer.setting.renderFunction')" width="70" fixed="right" align="center">
221
+ <el-table-column label="表尾统计行配置" width="150" align="center">
142
222
  <template slot-scope="scope">
143
- <el-button :disabled="'render' !== scope.row.formatS" size="mini" plain="" round="" icon="el-icon-edit"
144
- @click="showRenderDialog(scope.row)"></el-button>
223
+ <el-button
224
+ size="mini"
225
+ plain=""
226
+ round=""
227
+ icon="el-icon-edit"
228
+ @click="
229
+ editFormEventHandler(
230
+ scope.row,
231
+ scope.$index,
232
+ 'footerMethodConfg'
233
+ )
234
+ "
235
+ :disabled="scope.row.footerDataType !== '3'"
236
+ ></el-button>
237
+ </template>
238
+ </el-table-column>
239
+
240
+ <el-table-column
241
+ label="格式化配置"
242
+ width="90"
243
+ fixed="right"
244
+ align="center"
245
+ >
246
+ <template slot-scope="scope">
247
+ <el-button
248
+ size="mini"
249
+ plain=""
250
+ round=""
251
+ icon="el-icon-edit"
252
+ @click="openFormatConfigDialog(scope.row, scope.$index)"
253
+ :disabled="!columnFormatMap[scope.row.formatS]"
254
+ ></el-button>
255
+ </template>
256
+ </el-table-column>
257
+ <el-table-column
258
+ :label="i18nt('designer.setting.renderFunction')"
259
+ width="70"
260
+ fixed="right"
261
+ align="center"
262
+ >
263
+ <template slot-scope="scope">
264
+ <el-button
265
+ :disabled="'render' !== scope.row.formatS"
266
+ size="mini"
267
+ plain=""
268
+ round=""
269
+ icon="el-icon-edit"
270
+ @click="showRenderDialog(scope.row)"
271
+ ></el-button>
145
272
  </template>
146
273
  </el-table-column>
147
274
  <el-table-column label="操作" width="150" fixed="right">
@@ -154,7 +281,9 @@
154
281
  placement="top"
155
282
  >
156
283
  <el-button
157
- size="mini" type="" circle=""
284
+ size="mini"
285
+ type=""
286
+ circle=""
158
287
  icon="el-icon-plus"
159
288
  @click="onAddRoot"
160
289
  />
@@ -169,7 +298,9 @@
169
298
  placement="top"
170
299
  >
171
300
  <el-button
172
- size="mini" type="" circle=""
301
+ size="mini"
302
+ type=""
303
+ circle=""
173
304
  icon="el-icon-plus"
174
305
  @click="onAddSibling(row, $index)"
175
306
  />
@@ -183,7 +314,9 @@
183
314
  placement="top"
184
315
  >
185
316
  <el-button
186
- size="mini" type="" circle=""
317
+ size="mini"
318
+ type=""
319
+ circle=""
187
320
  icon="el-icon-circle-plus-outline"
188
321
  @click="onAddChild(row, $index)"
189
322
  />
@@ -196,7 +329,9 @@
196
329
  placement="top"
197
330
  >
198
331
  <el-button
199
- size="mini" type="" circle=""
332
+ size="mini"
333
+ type=""
334
+ circle=""
200
335
  icon="el-icon-delete"
201
336
  @click="onDelete(row, $index)"
202
337
  />
@@ -207,10 +342,15 @@
207
342
  </div>
208
343
  <div class="dialog-footer" slot="footer">
209
344
  <el-button @click="closeHandle" class="button-sty" icon="el-icon-close">
210
- {{ i18nt('designer.hint.cancel') }}
345
+ {{ i18nt("designer.hint.cancel") }}
211
346
  </el-button>
212
- <el-button type="primary" @click="colSubmit" class="button-sty" icon="el-icon-check">
213
- {{ i18nt('designer.hint.confirm') }}
347
+ <el-button
348
+ type="primary"
349
+ @click="colSubmit"
350
+ class="button-sty"
351
+ icon="el-icon-check"
352
+ >
353
+ {{ i18nt("designer.hint.confirm") }}
214
354
  </el-button>
215
355
  </div>
216
356
  </el-dialog>
@@ -227,15 +367,33 @@
227
367
  v-dialog-drag
228
368
  top="7vh"
229
369
  >
230
- <el-alert type="info" :closable="!1" title="function customRender(params,h) {"/>
231
- <code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="renderJson"></code-editor>
232
- <el-alert type="info" :closable="!1" title="}"/>
370
+ <el-alert
371
+ type="info"
372
+ :closable="!1"
373
+ title="function customRender(params,h) {"
374
+ />
375
+ <code-editor
376
+ ref="dsResultEditor"
377
+ mode="javascript"
378
+ :readonly="!1"
379
+ v-model="renderJson"
380
+ ></code-editor>
381
+ <el-alert type="info" :closable="!1" title="}" />
233
382
  <div class="dialog-footer" slot="footer">
234
- <el-button @click="showRenderDialogFlag = !1" class="button-sty" icon="el-icon-close">
235
- {{ i18nt('designer.hint.cancel') }}
383
+ <el-button
384
+ @click="showRenderDialogFlag = !1"
385
+ class="button-sty"
386
+ icon="el-icon-close"
387
+ >
388
+ {{ i18nt("designer.hint.cancel") }}
236
389
  </el-button>
237
- <el-button type="primary" @click="saveColumnRender" class="button-sty" icon="el-icon-check">
238
- {{ i18nt('designer.hint.confirm') }}
390
+ <el-button
391
+ type="primary"
392
+ @click="saveColumnRender"
393
+ class="button-sty"
394
+ icon="el-icon-check"
395
+ >
396
+ {{ i18nt("designer.hint.confirm") }}
239
397
  </el-button>
240
398
  </div>
241
399
  </el-dialog>
@@ -254,37 +412,99 @@
254
412
  top="5vh"
255
413
  >
256
414
  <div class="cont">
257
- <el-alert type="info" :closable="false" :title="tableColumnConfigHeader"></el-alert>
258
- <code-editor :mode="'javascript'" :readonly="false" v-model="tableColumnConfigCode"
259
- ref="ecEditor"></code-editor>
415
+ <el-alert
416
+ type="info"
417
+ :closable="false"
418
+ :title="tableColumnConfigHeader"
419
+ ></el-alert>
420
+ <code-editor
421
+ :mode="'javascript'"
422
+ :readonly="false"
423
+ v-model="tableColumnConfigCode"
424
+ ref="ecEditor"
425
+ ></code-editor>
426
+ <el-alert type="info" :closable="false" title="}"></el-alert>
427
+ </div>
428
+ <div slot="footer" class="dialog-footer">
429
+ <el-button
430
+ @click="showTableColumnConfigDialog = false"
431
+ class="button-sty"
432
+ icon="el-icon-close"
433
+ >
434
+ {{ i18nt("designer.hint.cancel") }}
435
+ </el-button>
436
+ <el-button
437
+ type="primary"
438
+ @click="saveTableColumnConfigDialog"
439
+ class="button-sty"
440
+ icon="el-icon-check"
441
+ >
442
+ {{ i18nt("designer.hint.confirm") }}
443
+ </el-button>
444
+ </div>
445
+ </el-dialog>
446
+ <el-dialog
447
+ :title="i18nt('designer.setting.editFormEventHandler')"
448
+ :visible.sync="showFormEventDialogFlag"
449
+ v-if="showFormEventDialogFlag"
450
+ :show-close="true"
451
+ custom-class="dialog-style list-dialog"
452
+ v-dialog-drag
453
+ :close-on-click-modal="false"
454
+ :close-on-press-escape="false"
455
+ :destroy-on-close="true"
456
+ :append-to-body="true"
457
+ :modal-append-to-body="true"
458
+ top="5vh"
459
+ >
460
+ <div class="cont">
461
+ <el-alert
462
+ type="info"
463
+ :closable="false"
464
+ :title="'form.' + eventParamsMap[curEventName]"
465
+ ></el-alert>
466
+ <code-editor
467
+ :mode="'javascript'"
468
+ :readonly="false"
469
+ v-model="formEventHandlerCode"
470
+ ref="ecEditor"
471
+ ></code-editor>
260
472
  <el-alert type="info" :closable="false" title="}"></el-alert>
261
473
  </div>
262
474
  <div slot="footer" class="dialog-footer">
263
- <el-button @click="showTableColumnConfigDialog = false" class="button-sty" icon="el-icon-close">
264
- {{ i18nt('designer.hint.cancel') }}
475
+ <el-button
476
+ @click="showFormEventDialogFlag = false"
477
+ class="button-sty"
478
+ icon="el-icon-close"
479
+ >
480
+ {{ i18nt("designer.hint.cancel") }}
265
481
  </el-button>
266
- <el-button type="primary" @click="saveTableColumnConfigDialog" class="button-sty" icon="el-icon-check">
267
- {{ i18nt('designer.hint.confirm') }}
482
+ <el-button
483
+ type="primary"
484
+ @click="saveFormEventHandler"
485
+ class="button-sty"
486
+ icon="el-icon-check"
487
+ >
488
+ {{ i18nt("designer.hint.confirm") }}
268
489
  </el-button>
269
490
  </div>
270
491
  </el-dialog>
271
492
  </div>
272
-
273
493
  </template>
274
494
  <script>
275
495
  import i18n from "../../../../../../components/xform/utils/i18n";
276
496
  import Sortable from "sortablejs";
277
- import {generateId} from "../../../../../../components/xform/utils/util";
497
+ import { generateId } from "../../../../../../components/xform/utils/util";
278
498
 
279
499
  export default {
280
500
  mixins: [i18n],
281
501
  props: {
282
502
  designer: Object,
283
503
  selectedWidget: Object,
284
- optionModel: Object
504
+ optionModel: Object,
285
505
  },
286
506
  components: {},
287
- inject: ['openWidgetPropertyDialog'],
507
+ inject: ["openWidgetPropertyDialog"],
288
508
  data() {
289
509
  return {
290
510
  tableColumnConfigTitle: null,
@@ -295,228 +515,264 @@ export default {
295
515
  dialogVisible: true,
296
516
  alignOptions: [
297
517
  {
298
- value: 'left',
299
- label: 'left'
518
+ value: "left",
519
+ label: "left",
300
520
  },
301
521
  {
302
- value: 'center',
303
- label: 'center'
522
+ value: "center",
523
+ label: "center",
304
524
  },
305
525
  {
306
- value: 'right',
307
- label: 'right'
308
- }
526
+ value: "right",
527
+ label: "right",
528
+ },
309
529
  ],
310
530
  op: [
311
531
  {
312
- label: 'edit Format',
532
+ label: "edit Format",
313
533
  options: [
314
534
  {
315
- value: 'editInput',
316
- label: '文本输入框'
535
+ value: "editInput",
536
+ label: "文本输入框",
317
537
  },
318
538
  {
319
- value: 'editNumber',
320
- label: '数字输入框'
539
+ value: "editNumber",
540
+ label: "数字输入框",
321
541
  },
322
542
  {
323
- value: 'editDate',
324
- label: '日期输入框'
543
+ value: "editDate",
544
+ label: "日期输入框",
325
545
  },
326
546
  {
327
- value: 'editSelect',
328
- label: '下拉框'
547
+ value: "editSelect",
548
+ label: "下拉框",
329
549
  },
330
550
  {
331
- value: 'editAttachment',
332
- label: '附件'
551
+ value: "editAttachment",
552
+ label: "附件",
333
553
  },
334
554
  {
335
- value: 'editSearch',
336
- label: '搜索框'
555
+ value: "editSearch",
556
+ label: "搜索框",
337
557
  },
338
558
  {
339
- value: 'editStatus',
340
- label: '状态'
559
+ value: "editStatus",
560
+ label: "状态",
341
561
  },
342
562
  {
343
- value: 'editDelete',
344
- label: '删除按钮'
563
+ value: "editDelete",
564
+ label: "删除按钮",
345
565
  },
346
566
  {
347
- value: 'editButton',
348
- label: '查看按钮'
567
+ value: "editButton",
568
+ label: "查看按钮",
349
569
  },
350
570
  {
351
- value: 'aText',
352
- label: '超链接文本'
571
+ value: "aText",
572
+ label: "超链接文本",
353
573
  },
354
574
  {
355
- value: 'aLink',
356
- label: '超链接按钮'
575
+ value: "aLink",
576
+ label: "超链接按钮",
357
577
  },
358
578
  {
359
- value: 'button',
360
- label: '按钮'
579
+ value: "button",
580
+ label: "按钮",
361
581
  },
362
582
  {
363
- value: 'editTreeButtonGroup',
364
- label: '编辑行按钮组'
365
- }
366
- ]
583
+ value: "editTreeButtonGroup",
584
+ label: "编辑行按钮组",
585
+ },
586
+ ],
367
587
  },
368
588
  {
369
- label: '树控件',
589
+ label: "树控件",
370
590
  options: [
371
591
  {
372
- value: 'addSiblingEditRow',
373
- label: '新增兄弟节点'
592
+ value: "addSiblingEditRow",
593
+ label: "新增兄弟节点",
374
594
  },
375
595
  {
376
- value: 'addChildTreeRow',
377
- label: '新增子节点'
596
+ value: "addChildTreeRow",
597
+ label: "新增子节点",
378
598
  },
379
599
  {
380
- value: 'moveUpRow',
381
- label: '上移'
600
+ value: "moveUpRow",
601
+ label: "上移",
382
602
  },
383
603
  {
384
- value: 'moveDownRow',
385
- label: '下移'
604
+ value: "moveDownRow",
605
+ label: "下移",
386
606
  },
387
607
  {
388
- value: 'removeTreeRow',
389
- label: '删除树节点'
390
- }
391
- ]
608
+ value: "removeTreeRow",
609
+ label: "删除树节点",
610
+ },
611
+ ],
392
612
  },
393
613
  {
394
- label: 'Date Format',
614
+ label: "Date Format",
395
615
  options: [
396
616
  {
397
- value: 'd1',
398
- label: 'yyyy-MM-dd'
617
+ value: "d1",
618
+ label: "yyyy-MM-dd",
399
619
  },
400
620
  {
401
- value: 'd2',
402
- label: 'yyyy/MM/dd'
621
+ value: "d2",
622
+ label: "yyyy/MM/dd",
403
623
  },
404
624
  {
405
- value: 'd3',
406
- label: 'yyyy年MM月dd日'
625
+ value: "d3",
626
+ label: "yyyy年MM月dd日",
407
627
  },
408
628
  {
409
- value: 'd4',
410
- label: 'yyyy-MM-dd HH:mm:ss'
629
+ value: "d4",
630
+ label: "yyyy-MM-dd HH:mm:ss",
411
631
  },
412
632
  {
413
- value: 'd5',
414
- label: 'yyyy-MM-dd hh:mm:ss'
415
- }
416
- ]
633
+ value: "d5",
634
+ label: "yyyy-MM-dd hh:mm:ss",
635
+ },
636
+ ],
417
637
  },
418
638
  {
419
- label: 'Number Format',
639
+ label: "Number Format",
420
640
  options: [
421
641
  {
422
- value: 'n1',
423
- label: '###,###,###,##0.######'
642
+ value: "n1",
643
+ label: "###,###,###,##0.######",
424
644
  },
425
645
  {
426
- value: 'n2',
427
- label: '###,###,###,##0.00####'
646
+ value: "n2",
647
+ label: "###,###,###,##0.00####",
428
648
  },
429
649
  {
430
- value: 'n3',
431
- label: '###,###,###,##0.000000'
650
+ value: "n3",
651
+ label: "###,###,###,##0.000000",
432
652
  },
433
653
  {
434
- value: 'n4',
435
- label: '###,###,###,##0.000'
654
+ value: "n4",
655
+ label: "###,###,###,##0.000",
436
656
  },
437
657
  {
438
- value: 'n5',
439
- label: '###,###,###,##0.00'
658
+ value: "n5",
659
+ label: "###,###,###,##0.00",
440
660
  },
441
661
  {
442
- value: 'n6',
443
- label: '###,###,###,##0'
662
+ value: "n6",
663
+ label: "###,###,###,##0",
444
664
  },
445
665
  {
446
- value: 'n7',
447
- label: '###,##0.00##%'
448
- }
449
- ]
450
- }
666
+ value: "n7",
667
+ label: "###,##0.00##%",
668
+ },
669
+ ],
670
+ },
451
671
  ],
452
672
  editOp: [
453
673
  {
454
- value: 'editInput',
455
- label: '文本输入框'
674
+ value: "editInput",
675
+ label: "文本输入框",
456
676
  },
457
677
  {
458
- value: 'editNumber',
459
- label: '数字输入框'
678
+ value: "editNumber",
679
+ label: "数字输入框",
460
680
  },
461
681
  {
462
- value: 'editDate',
463
- label: '日期输入框'
682
+ value: "editDate",
683
+ label: "日期输入框",
464
684
  },
465
685
  {
466
- value: 'editSelect',
467
- label: '下拉框'
686
+ value: "editSelect",
687
+ label: "下拉框",
468
688
  },
469
689
  {
470
- value: 'editAttachment',
471
- label: '附件'
690
+ value: "editAttachment",
691
+ label: "附件",
472
692
  },
473
693
  {
474
- value: 'editSearch',
475
- label: '搜索框'
476
- }
694
+ value: "editSearch",
695
+ label: "搜索框",
696
+ },
477
697
  ],
478
698
  showRenderDialogFlag: !1,
479
- renderJson: '',
699
+ renderJson: "",
480
700
  currentTableColumn: null,
481
701
 
482
702
  hideAfter: 1500,
483
703
  openDelay: 500,
484
- tableData: [],//树形结构数据转的数组
704
+ tableData: [], //树形结构数据转的数组
485
705
  tableDataArray: [],
486
706
  dragSort: null,
487
707
  columnFormatMap: {
488
- editInput: 'input',
489
- editNumber: 'number',
490
- editDate: 'date',
491
- editSelect: 'select',
492
- editSearch: 'vabsearch',
493
- editAttachment: 'baseAttachment',
494
- editStatus: 'status',
495
- aText: 'a-text',
496
- aLink: 'a-link',
497
- editDelete: 'a-link',
498
- editButton: 'a-link',
499
- button: 'button',
500
- addSiblingEditRow: 'a-link',
501
- addChildTreeRow: 'a-link',
502
- moveUpRow: 'a-link',
503
- moveDownRow: 'a-link',
504
- removeTreeRow: 'a-link'
708
+ editInput: "input",
709
+ editNumber: "number",
710
+ editDate: "date",
711
+ editSelect: "select",
712
+ editSearch: "vabsearch",
713
+ editAttachment: "baseAttachment",
714
+ editStatus: "status",
715
+ aText: "a-text",
716
+ aLink: "a-link",
717
+ editDelete: "a-link",
718
+ editButton: "a-link",
719
+ button: "button",
720
+ addSiblingEditRow: "a-link",
721
+ addChildTreeRow: "a-link",
722
+ moveUpRow: "a-link",
723
+ moveDownRow: "a-link",
724
+ removeTreeRow: "a-link",
505
725
  },
506
- }
726
+
727
+ showFormEventDialogFlag: false,
728
+ formEventHandlerCode: "",
729
+ curEventName: "",
730
+
731
+ eventParamsMap: {
732
+ footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
733
+ },
734
+ };
507
735
  },
508
736
  beforeDestroy() {
509
- if (this.dragSort) this.dragSort.destroy()
510
- },
511
- created() {
512
-
737
+ if (this.dragSort) this.dragSort.destroy();
513
738
  },
739
+ created() {},
514
740
  mounted() {
515
741
  this.init();
516
742
  },
517
743
  methods: {
744
+ editFormEventHandler(row, index, eventName) {
745
+ this.curEventName = eventName;
746
+ this.curEventIndex = index;
747
+ this.formEventHandlerCode = row[eventName];
748
+ this.showFormEventDialogFlag = true;
749
+ },
750
+
751
+ saveFormEventHandler() {
752
+ const codeHints = this.$refs.ecEditor.getEditorAnnotations();
753
+ let syntaxErrorFlag = false;
754
+ if (!!codeHints && codeHints.length > 0) {
755
+ codeHints.forEach((chItem) => {
756
+ if (chItem.type === "error") {
757
+ syntaxErrorFlag = true;
758
+ }
759
+ });
760
+
761
+ if (syntaxErrorFlag) {
762
+ this.$message.error(
763
+ this.i18nt("designer.setting.syntaxCheckWarning")
764
+ );
765
+ return;
766
+ }
767
+ }
768
+ this.tableData[this.curEventIndex][this.curEventName] =
769
+ this.formEventHandlerCode;
770
+ this.showFormEventDialogFlag = false;
771
+ },
518
772
  init() {
519
- this.tableData = this.$baseLodash.cloneDeep(this.optionModel.tableColumns);
773
+ this.tableData = this.$baseLodash.cloneDeep(
774
+ this.optionModel.tableColumns
775
+ );
520
776
  this.$nextTick(() => {
521
777
  this.rowDrop();
522
778
  });
@@ -527,32 +783,38 @@ export default {
527
783
  this.closeHandle();
528
784
  },
529
785
  showRenderDialog: function (e) {
530
- (this.currentTableColumn = e), (this.renderJson = e.render || ''), (this.showRenderDialogFlag = !0);
786
+ (this.currentTableColumn = e),
787
+ (this.renderJson = e.render || ""),
788
+ (this.showRenderDialogFlag = !0);
531
789
  },
532
790
  saveColumnRender: function () {
533
- this.$set(this.currentTableColumn, 'render', this.renderJson), (this.showRenderDialogFlag = !1);
791
+ this.$set(this.currentTableColumn, "render", this.renderJson),
792
+ (this.showRenderDialogFlag = !1);
534
793
  },
535
794
  closeHandle() {
536
- this.$emit('update:visiable', false);
537
- this.$emit('close');
795
+ this.$emit("update:visiable", false);
796
+ this.$emit("close");
538
797
  },
539
798
  // 添加同级节点
540
799
  onAddSibling(row, index) {
541
- console.log('onAddSibling', row, index)
542
- const parentId = row.parentId || null
800
+ console.log("onAddSibling", row, index);
801
+ const parentId = row.parentId || null;
543
802
  // 先判断是不是根节点
544
803
  if (!parentId) {
545
804
  // 当前节点直接添加
546
805
  // this.tableData.push(this.generateRow(parentId))
547
- let addIndex = this.tableData.filter(item => !item.parentId).findIndex(item => item.columnId == row.columnId) + 1;
548
- this.tableData.splice(addIndex, 0, this.generateRow(parentId))
806
+ let addIndex =
807
+ this.tableData
808
+ .filter((item) => !item.parentId)
809
+ .findIndex((item) => item.columnId == row.columnId) + 1;
810
+ this.tableData.splice(addIndex, 0, this.generateRow(parentId));
549
811
  } else {
550
- this.handleAddOneRow(row, index, 'SIBLING')
812
+ this.handleAddOneRow(row, index, "SIBLING");
551
813
  }
552
814
  },
553
815
  // 添加子节点 todo
554
816
  onAddChild(row, index) {
555
- this.handleAddOneRow(row, index, 'CHILD')
817
+ this.handleAddOneRow(row, index, "CHILD");
556
818
  },
557
819
  /**
558
820
  * 处理添加一行数据
@@ -561,36 +823,36 @@ export default {
561
823
  * @param {string} type 操作类型 SIBLING 同级 / CHILD 子级
562
824
  */
563
825
  handleAddOneRow(row, index, type) {
564
-
565
- const {parentId, columnId} = row
566
- const curId = type === 'SIBLING' ? parentId : columnId
567
- let curRow = {}
826
+ const { parentId, columnId } = row;
827
+ const curId = type === "SIBLING" ? parentId : columnId;
828
+ let curRow = {};
568
829
  // 在 tableData 中,找到当前节点
569
830
  const findRow = (data) => {
570
831
  data.forEach((item) => {
571
832
  if (item.columnId === curId) {
572
- curRow = item
833
+ curRow = item;
573
834
  }
574
835
  if (item.children && item.children.length) {
575
- findRow(item.children)
836
+ findRow(item.children);
576
837
  }
577
- })
578
- }
838
+ });
839
+ };
579
840
 
580
- findRow(this.tableData)
841
+ findRow(this.tableData);
581
842
 
582
- const {columnId: generateParentId, children} = curRow
843
+ const { columnId: generateParentId, children } = curRow;
583
844
 
584
- let newRow = this.generateRow(generateParentId)
845
+ let newRow = this.generateRow(generateParentId);
585
846
  if (children) {
586
- if (type === 'SIBLING') {
587
- let addIndex = children.findIndex(item => item.columnId == row.columnId) + 1;
588
- children.splice(addIndex, 0, newRow)
847
+ if (type === "SIBLING") {
848
+ let addIndex =
849
+ children.findIndex((item) => item.columnId == row.columnId) + 1;
850
+ children.splice(addIndex, 0, newRow);
589
851
  } else {
590
- children.push(newRow)
852
+ children.push(newRow);
591
853
  }
592
854
  } else {
593
- this.$set(curRow, 'children', [newRow])
855
+ this.$set(curRow, "children", [newRow]);
594
856
  }
595
857
  },
596
858
  getUuid() {
@@ -600,7 +862,7 @@ export default {
600
862
  * 生成一行数据
601
863
  */
602
864
  generateRow(parentId) {
603
- let tmpId = 'column' + generateId();
865
+ let tmpId = "column" + generateId();
604
866
  let uuid = this.getUuid();
605
867
  var row = {
606
868
  columnId: uuid,
@@ -610,46 +872,51 @@ export default {
610
872
  width: 150,
611
873
  prop: tmpId,
612
874
  label: tmpId,
613
- align: 'left',
875
+ align: "left",
614
876
  show: true,
615
877
  sortable: true,
616
-
878
+ exportType: null,
879
+ footerDataType: null,
880
+ footerMethodConfg: null,
617
881
  // treeNode: false,
618
-
619
882
  };
620
883
  return row;
621
884
  },
622
885
  // 添加根节点
623
886
  onAddRoot() {
624
- this.tableData.push(this.generateRow())
887
+ this.tableData.push(this.generateRow());
625
888
  },
626
889
  // 删除当前节点及对应子节点数据
627
890
  onDelete(row) {
628
- const {parentId, columnId} = row
891
+ const { parentId, columnId } = row;
629
892
  // 根节点直接删除
630
893
  if (!parentId) {
631
- const delIndex = this.tableData.findIndex((item) => item.columnId === columnId)
632
- this.tableData.splice(delIndex, 1)
894
+ const delIndex = this.tableData.findIndex(
895
+ (item) => item.columnId === columnId
896
+ );
897
+ this.tableData.splice(delIndex, 1);
633
898
  } else {
634
899
  // 找到父节点,通过父节点删除
635
- let parentRow = {}
900
+ let parentRow = {};
636
901
  const findRow = (data) => {
637
902
  data.forEach((item) => {
638
903
  if (item.columnId === parentId) {
639
- parentRow = {...item}
904
+ parentRow = { ...item };
640
905
  }
641
906
  if (item.children && item.children.length) {
642
- findRow(item.children)
907
+ findRow(item.children);
643
908
  }
644
- })
645
- }
646
- findRow(this.tableData)
909
+ });
910
+ };
911
+ findRow(this.tableData);
647
912
 
648
- const {children} = parentRow
913
+ const { children } = parentRow;
649
914
 
650
- const delIndex = children.findIndex((item) => item.columnId === columnId)
915
+ const delIndex = children.findIndex(
916
+ (item) => item.columnId === columnId
917
+ );
651
918
 
652
- children.splice(delIndex, 1)
919
+ children.splice(delIndex, 1);
653
920
  }
654
921
  },
655
922
  // 数据准备 生成 id 和 parentId
@@ -657,30 +924,32 @@ export default {
657
924
  const tableFormat = (tableData, parentId) => {
658
925
  tableData.forEach((item) => {
659
926
  // item.parentId = parentId || null
660
- if (!item.kid) item.kid = item.columnId
927
+ if (!item.kid) item.kid = item.columnId;
661
928
  if (item.children && item.children.length > 0) {
662
- tableFormat(item.children, item.columnId)
929
+ tableFormat(item.children, item.columnId);
663
930
  }
664
- })
665
- }
931
+ });
932
+ };
666
933
 
667
- tableFormat(data)
668
- return data
934
+ tableFormat(data);
935
+ return data;
669
936
  },
670
937
  //drag begin
671
938
  //行拖拽
672
939
  rowDrop() {
673
- if (this.dragSort) this.dragSort.destroy() // 防止在Dom上重复绑定事件
940
+ if (this.dragSort) this.dragSort.destroy(); // 防止在Dom上重复绑定事件
674
941
  // const tbody = document.querySelector('.drag .el-table__body-wrapper tbody');
675
- var tbody = this.$refs.singleTable.$el.querySelectorAll('.el-table__fixed-body-wrapper > table > tbody')[0];
942
+ var tbody = this.$refs.singleTable.$el.querySelectorAll(
943
+ ".el-table__fixed-body-wrapper > table > tbody"
944
+ )[0];
676
945
  const _this = this;
677
946
  this.dragSort = Sortable.create(tbody, {
678
- ghostClass: 'sortable-ghost',
947
+ ghostClass: "sortable-ghost",
679
948
  setData: function (e) {
680
- e.setData('Text', '');
949
+ e.setData("Text", "");
681
950
  },
682
- onEnd({newIndex, oldIndex}) {
683
- _this.rowDropEnd(newIndex, oldIndex)
951
+ onEnd({ newIndex, oldIndex }) {
952
+ _this.rowDropEnd(newIndex, oldIndex);
684
953
  },
685
954
  });
686
955
  },
@@ -691,7 +960,7 @@ export default {
691
960
  data.forEach((item) => {
692
961
  const loop = (data) => {
693
962
  result.push({
694
- ...data
963
+ ...data,
695
964
  });
696
965
  let child = data.children;
697
966
  if (child) {
@@ -707,7 +976,9 @@ export default {
707
976
  //数组转树
708
977
  arrToTree(arr, parentId) {
709
978
  return arr
710
- .filter((item) => (!parentId ? !item.parentId : item.parentId === parentId))
979
+ .filter((item) =>
980
+ !parentId ? !item.parentId : item.parentId === parentId
981
+ )
711
982
  .map((item) => {
712
983
  item.children = this.arrToTree(arr, item.columnId);
713
984
  return item;
@@ -745,13 +1016,7 @@ export default {
745
1016
  let newRow = this.tableDataArray[newIndex];
746
1017
 
747
1018
  //判断是否把该行 拖拽到 自己的底级中
748
- if (
749
- this.isTreeBottom(
750
- this.tableData,
751
- oldRow.columnId,
752
- newRow.columnId
753
- )
754
- ) {
1019
+ if (this.isTreeBottom(this.tableData, oldRow.columnId, newRow.columnId)) {
755
1020
  this.$message({
756
1021
  type: "error",
757
1022
  message: "不能放到子节点",
@@ -797,7 +1062,7 @@ export default {
797
1062
  let isButtontCell = false;
798
1063
  let widgetType = this.columnFormatMap[formatS];
799
1064
  if (widgetType) {
800
- isButtontCell = widgetType === 'a-link' || widgetType === 'button';
1065
+ isButtontCell = widgetType === "a-link" || widgetType === "button";
801
1066
  }
802
1067
  return isButtontCell;
803
1068
  },
@@ -805,20 +1070,20 @@ export default {
805
1070
  changeFormatS(row) {
806
1071
  let isButtontCell = this.getIsButtontCell(row.formatS);
807
1072
  let columnWidgetConfig = this.getColumnWidgetConfig(row, true);
808
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1073
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
809
1074
  if (columnSelectedWidget) {
810
1075
  row.columnOption = columnSelectedWidget.options;
811
1076
  } else {
812
- row.columnOption = {}
1077
+ row.columnOption = {};
813
1078
  }
814
1079
 
815
- if (row.formatS == 'editTreeButtonGroup') {
1080
+ if (row.formatS == "editTreeButtonGroup") {
816
1081
  row.prop = null;
817
1082
  row.label = null;
818
1083
  row.sortable = false;
819
1084
  row.width = 150;
820
1085
  } else if (isButtontCell) {
821
- if (row.formatS == 'aLink' || row.formatS == 'button') {
1086
+ if (row.formatS == "aLink" || row.formatS == "button") {
822
1087
  if (!row.width || row.width == 47) row.width = 150;
823
1088
  } else {
824
1089
  row.width = 47;
@@ -827,13 +1092,13 @@ export default {
827
1092
  row.label = null;
828
1093
  row.sortable = false;
829
1094
  } else {
830
- let tmpId = 'column' + generateId();
1095
+ let tmpId = "column" + generateId();
831
1096
  if (!row.width || row.width == 47) row.width = 150;
832
1097
  if (!row.prop) row.prop = tmpId;
833
1098
  if (!row.label) row.label = tmpId;
834
1099
  row.sortable = true;
835
1100
 
836
- if (row.formatS == 'editAttachment') {
1101
+ if (row.formatS == "editAttachment") {
837
1102
  row.prop = this.designer.createAttachmentKeyName();
838
1103
  } else {
839
1104
  let attachmentPrefix = this.designer.getAttachmentPrefix();
@@ -842,7 +1107,7 @@ export default {
842
1107
  }
843
1108
  },
844
1109
  getColumnWidgetConfig(row, isChange, isEdit) {
845
- let formatS = isEdit ? row.editFormatS : row.formatS
1110
+ let formatS = isEdit ? row.editFormatS : row.formatS;
846
1111
  let columnSelectedWidget = null;
847
1112
  let columnEditFields = null;
848
1113
 
@@ -858,7 +1123,9 @@ export default {
858
1123
 
859
1124
  if (type) {
860
1125
  // columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
861
- columnSelectedWidget = this.designer.copyNewFieldWidget(this.designer.getFieldWidgetByType(type));
1126
+ columnSelectedWidget = this.designer.copyNewFieldWidget(
1127
+ this.designer.getFieldWidgetByType(type)
1128
+ );
862
1129
  /*let tmpId = generateId();
863
1130
  let idVal = row.prop ? row.prop : (type + tmpId);*/
864
1131
  /*columnSelectedWidget.id = idVal;*/
@@ -872,61 +1139,70 @@ export default {
872
1139
  if (!isChange && columnOption && Object.keys(columnOption).length) {
873
1140
  columnOption.required = row.required || false;
874
1141
  columnSelectedWidget.options = columnOption;
875
- if ('editDelete' == formatS) {
876
- columnSelectedWidget.options.hiddenByWf = columnSelectedWidget.options.hiddenByWf ?? true;
877
- columnSelectedWidget.options.prefixIcon = columnSelectedWidget.options.prefixIcon || "el-icon-delete";
878
- } else if ('editButton' == formatS) {
879
- columnSelectedWidget.options.prefixIcon = columnSelectedWidget.options.prefixIcon || "el-icon-edit";
1142
+ if ("editDelete" == formatS) {
1143
+ columnSelectedWidget.options.hiddenByWf =
1144
+ columnSelectedWidget.options.hiddenByWf ?? true;
1145
+ columnSelectedWidget.options.prefixIcon =
1146
+ columnSelectedWidget.options.prefixIcon || "el-icon-delete";
1147
+ } else if ("editButton" == formatS) {
1148
+ columnSelectedWidget.options.prefixIcon =
1149
+ columnSelectedWidget.options.prefixIcon || "el-icon-edit";
880
1150
  }
881
1151
  } else {
882
1152
  columnSelectedWidget.options.required = row.required || false;
883
1153
 
884
- if ('editDelete' == formatS) {
1154
+ if ("editDelete" == formatS) {
885
1155
  columnSelectedWidget.options.prefixIcon = "el-icon-delete";
886
1156
  columnSelectedWidget.options.label = "删除";
887
1157
  columnSelectedWidget.options.labelHidden = true;
888
1158
  columnSelectedWidget.options.hiddenByWf = true;
889
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
890
- } else if ('editButton' == formatS) {
1159
+ columnSelectedWidget.options.onClick =
1160
+ "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
1161
+ } else if ("editButton" == formatS) {
891
1162
  columnSelectedWidget.options.prefixIcon = "el-icon-edit";
892
1163
  columnSelectedWidget.options.label = "查看";
893
1164
  columnSelectedWidget.options.labelHidden = true;
894
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
895
- } else if ('addSiblingEditRow' == formatS) {
1165
+ columnSelectedWidget.options.onClick =
1166
+ "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
1167
+ } else if ("addSiblingEditRow" == formatS) {
896
1168
  columnSelectedWidget.options.prefixIcon = "el-icon-plus";
897
1169
  columnSelectedWidget.options.label = "新增兄弟节点";
898
1170
  columnSelectedWidget.options.labelHidden = false;
899
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
900
- } else if ('addChildTreeRow' == formatS) {
1171
+ columnSelectedWidget.options.onClick =
1172
+ "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
1173
+ } else if ("addChildTreeRow" == formatS) {
901
1174
  columnSelectedWidget.options.prefixIcon = "el-icon-plus";
902
1175
  columnSelectedWidget.options.label = "新增子节点";
903
1176
  columnSelectedWidget.options.labelHidden = false;
904
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
905
- } else if ('moveUpRow' == formatS) {
1177
+ columnSelectedWidget.options.onClick =
1178
+ "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
1179
+ } else if ("moveUpRow" == formatS) {
906
1180
  // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
907
1181
  columnSelectedWidget.options.label = "↑上移";
908
1182
  columnSelectedWidget.options.labelHidden = false;
909
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
910
- } else if ('moveDownRow' == formatS) {
1183
+ columnSelectedWidget.options.onClick =
1184
+ "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
1185
+ } else if ("moveDownRow" == formatS) {
911
1186
  // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
912
1187
  columnSelectedWidget.options.label = "↓下移";
913
1188
  columnSelectedWidget.options.labelHidden = false;
914
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
915
- } else if ('removeTreeRow' == formatS) {
1189
+ columnSelectedWidget.options.onClick =
1190
+ "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
1191
+ } else if ("removeTreeRow" == formatS) {
916
1192
  columnSelectedWidget.options.prefixIcon = "el-icon-delete";
917
1193
  columnSelectedWidget.options.label = "删除";
918
1194
  columnSelectedWidget.options.labelHidden = true;
919
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
1195
+ columnSelectedWidget.options.onClick =
1196
+ "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
920
1197
  }
921
1198
 
922
1199
  columnOption = columnSelectedWidget.options;
923
-
924
1200
  }
925
1201
 
926
1202
  // columnSelectedWidget.options.name = isEdit? (type + row.columnId) : row.prop;
927
1203
  // columnSelectedWidget.options.name = type + row.columnId;
928
1204
  // columnSelectedWidget.options.name = row.prop;
929
- if (columnSelectedWidget.options.hasOwnProperty('keyName')) {
1205
+ if (columnSelectedWidget.options.hasOwnProperty("keyName")) {
930
1206
  columnSelectedWidget.options.keyName = row.prop;
931
1207
  columnSelectedWidget.options.keyNameEnabled = true;
932
1208
  } else {
@@ -938,18 +1214,18 @@ export default {
938
1214
  columnSelectedWidget.options.labelHidden = true;
939
1215
  }
940
1216
  }
941
- return {columnSelectedWidget, columnEditFields};
1217
+ return { columnSelectedWidget, columnEditFields };
942
1218
  },
943
1219
  openFormatConfigDialog(row, index) {
944
1220
  let option = row.columnOption;
945
1221
  let selectedWidget;
946
1222
  let columnWidgetConfig = this.getColumnWidgetConfig(row);
947
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1223
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
948
1224
  if (columnSelectedWidget) {
949
1225
  option = columnSelectedWidget.options;
950
1226
  selectedWidget = columnSelectedWidget;
951
1227
  } else {
952
- option = {}
1228
+ option = {};
953
1229
  selectedWidget = {};
954
1230
  }
955
1231
 
@@ -963,20 +1239,16 @@ export default {
963
1239
  index: index,
964
1240
  columnEditFields: columnEditFields,
965
1241
  callback: (columnOption) => {
966
- this.confirmFormatConfigDialog(columnOption);
967
- }
968
- })
1242
+ this.confirmFormatConfigDialog(columnOption, row);
1243
+ },
1244
+ });
969
1245
  },
970
1246
  getFieldKeyNameByOptions(options) {
971
1247
  let o = options.name;
972
- return (
973
- (options.keyNameEnabled
974
- && options.keyName)
975
- || o
976
- );
1248
+ return (options.keyNameEnabled && options.keyName) || o;
977
1249
  },
978
- confirmFormatConfigDialog(columnOption) {
979
- let row = this.tableData[this.operateIndex];
1250
+ confirmFormatConfigDialog(columnOption, row) {
1251
+ // let row = this.tableData[this.operateIndex];
980
1252
  row.columnOption = columnOption;
981
1253
  let isButtontCell = this.getIsButtontCell(row.formatS);
982
1254
  if (!isButtontCell) {
@@ -989,12 +1261,12 @@ export default {
989
1261
  let option = row.columnOption;
990
1262
  let selectedWidget;
991
1263
  let columnWidgetConfig = this.getColumnWidgetConfig(row, null, true);
992
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1264
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
993
1265
  if (columnSelectedWidget) {
994
1266
  option = columnSelectedWidget.options;
995
1267
  selectedWidget = columnSelectedWidget;
996
1268
  } else {
997
- option = {}
1269
+ option = {};
998
1270
  selectedWidget = {};
999
1271
  }
1000
1272
 
@@ -1008,12 +1280,12 @@ export default {
1008
1280
  index: index,
1009
1281
  columnEditFields: columnEditFields,
1010
1282
  callback: (columnOption) => {
1011
- this.confirmEditFormatConfigDialog(columnOption);
1012
- }
1013
- })
1283
+ this.confirmEditFormatConfigDialog(columnOption, row);
1284
+ },
1285
+ });
1014
1286
  },
1015
- confirmEditFormatConfigDialog(columnOption) {
1016
- let row = this.tableData[this.operateIndex];
1287
+ confirmEditFormatConfigDialog(columnOption, row) {
1288
+ // let row = this.tableData[this.operateIndex];
1017
1289
  row.editColumnOption = columnOption;
1018
1290
  /*row.prop = columnOption.name;
1019
1291
  row.label = columnOption.label;
@@ -1021,39 +1293,50 @@ export default {
1021
1293
  },
1022
1294
  openTableColumnConfigDialog(row, index) {
1023
1295
  this.operateIndex = index;
1296
+ this.currentTableColumn = row;
1024
1297
  let eventName = "tableColumnConfig";
1025
- let eventParams = ["dataId", "formCode"]
1026
- this.tableColumnConfigHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(', ')}) {`;
1027
- this.tableColumnConfigCode = this.$baseLodash.cloneDeep(row.tableColumnConfig || '');
1298
+ let eventParams = ["dataId", "formCode"];
1299
+ this.tableColumnConfigHeader = `${
1300
+ this.optionModel.name
1301
+ }.${eventName}(${eventParams.join(", ")}) {`;
1302
+ this.tableColumnConfigCode = this.$baseLodash.cloneDeep(
1303
+ row.tableColumnConfig || ""
1304
+ );
1028
1305
 
1029
1306
  this.tableColumnConfigTitle = `自定义表格列属性配置(${row.label})`;
1030
1307
  this.showTableColumnConfigDialog = true;
1031
1308
  },
1032
1309
  saveTableColumnConfigDialog() {
1033
- let row = this.tableData[this.operateIndex];
1310
+ // let row = this.tableData[this.operateIndex];
1311
+ let row = this.currentTableColumn;
1034
1312
  const codeHints = this.$refs.ecEditor.getEditorAnnotations();
1035
1313
  let syntaxErrorFlag = false;
1036
1314
  if (!!codeHints && codeHints.length > 0) {
1037
- codeHints.forEach(chItem => {
1038
- if (chItem.type === 'error') {
1315
+ codeHints.forEach((chItem) => {
1316
+ if (chItem.type === "error") {
1039
1317
  syntaxErrorFlag = true;
1040
1318
  }
1041
1319
  });
1042
1320
 
1043
1321
  if (syntaxErrorFlag) {
1044
- this.$message.error(this.i18nt('designer.setting.syntaxCheckWarning'));
1322
+ this.$message.error(
1323
+ this.i18nt("designer.setting.syntaxCheckWarning")
1324
+ );
1045
1325
  return;
1046
1326
  }
1047
1327
  }
1048
- this.$set(row, 'tableColumnConfig', this.$baseLodash.cloneDeep(this.tableColumnConfigCode))
1328
+ this.$set(
1329
+ row,
1330
+ "tableColumnConfig",
1331
+ this.$baseLodash.cloneDeep(this.tableColumnConfigCode)
1332
+ );
1049
1333
  this.showTableColumnConfigDialog = false;
1050
-
1051
1334
  },
1052
- }
1053
- }
1335
+ },
1336
+ };
1054
1337
  </script>
1055
1338
  <style scoped lang="scss">
1056
1339
  .icon-drag:before {
1057
- content: '\e61d';
1340
+ content: "\e61d";
1058
1341
  }
1059
1342
  </style>