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