cloud-web-corejs 1.1.0-dev.5 → 1.1.0-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/package.json +1 -1
  2. package/src/components/VabUpload/index.vue +1 -1
  3. package/src/components/VabUpload/view.vue +27 -26
  4. package/src/components/excelImport/index.vue +156 -156
  5. package/src/components/jsonImport/index.vue +1 -1
  6. package/src/components/langImport/index.vue +1 -1
  7. package/src/components/mobile/wf/addTaskUserdialog.vue +23 -3
  8. package/src/components/mobile/wf/content.vue +110 -67
  9. package/src/components/mobile/wf/deleteTaskUserDialog.vue +22 -3
  10. package/src/components/mobile/wf/selectUserDialog.vue +122 -0
  11. package/src/components/mobile/wf/setCandidateDialog.vue +25 -4
  12. package/src/components/mobile/wf/urgingDialog.vue +26 -3
  13. package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
  14. package/src/components/obsUpload/index.vue +1 -1
  15. package/src/components/xform/form-designer/designer.js +36 -52
  16. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +185 -185
  17. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
  18. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +2 -2
  19. package/src/components/xform/form-designer/indexMixin.js +33 -1
  20. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +833 -860
  21. package/src/components/xform/form-designer/toolbar-panel/index.vue +874 -874
  22. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -0
  23. package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
  24. package/src/components/xform/form-designer/widget-panel/indexMixin.js +30 -6
  25. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +53 -1
  26. package/src/components/xform/form-render/container-item/list-h5-item.vue +154 -27
  27. package/src/components/xform/form-render/indexMixin.js +23 -3
  28. package/src/components/xform/styles/h5.scss +774 -588
  29. package/src/directive/append-to-body/index.js +48 -0
  30. package/src/index.js +4 -0
  31. package/src/layout/components/Sidebar/default.vue +1655 -1655
  32. package/src/router/index.js +48 -48
  33. package/src/utils/assetUrl.js +19 -0
  34. package/src/utils/vab.js +1283 -1279
  35. package/src/views/bd/setting/form_template/edit.vue +378 -356
  36. package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
  37. package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
  38. package/src/views/bd/setting/form_template/list.vue +304 -303
  39. package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
  40. package/src/views/bd/setting/form_template/mixins/list.js +748 -721
  41. package/src/views/user/file_view_ins/list.vue +970 -970
  42. package/src/views/user/form/vform/designer.vue +823 -821
  43. package/src/views/user/home/default.vue +1117 -1117
  44. package/src/views/user/home/index.vue +103 -103
  45. package/src/views/user/notify_message/dialog.vue +139 -139
  46. package/src/views/user/outLink/form_view.vue +202 -202
  47. package/src/views/user/outLink/index.vue +110 -110
  48. package/src/views/user/wf/iframe/index.vue +51 -51
  49. package/src/views/user/wf/iframe/index2.vue +64 -64
  50. package/src/views/user/wf/wf_manage/list2.vue +871 -871
  51. package/src/views/user/wf/wf_manage/wfContentDialog.vue +134 -134
  52. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
@@ -1,860 +1,833 @@
1
- <template>
2
- <div>
3
- <el-form-item label="查询列表">
4
- <el-switch v-model="optionModel.isQueryTable"></el-switch>
5
- </el-form-item>
6
- <el-form-item :label="i18nt('designer.setting.showPagination')">
7
- <el-switch v-model="optionModel.showPagination"></el-switch>
8
- </el-form-item>
9
- <el-form-item :label="i18nt('designer.setting.tableColEdit')">
10
- <el-button type="primary" plain="" round="" @click="openSetting">{{
11
- i18nt('designer.setting.editAction')
12
- }}
13
- </el-button>
14
- </el-form-item>
15
- <el-dialog
16
- v-if="dialogVisible"
17
- custom-class="dialog-style list-dialog"
18
- :title="i18nt('designer.setting.tableColEdit')"
19
- :visible.sync="dialogVisible"
20
- :show-close="!0"
21
- :append-to-body="false"
22
- :modal="false"
23
- :close-on-click-modal="!1"
24
- :close-on-press-escape="!1"
25
- :destroy-on-close="!0"
26
- width="1220px"
27
- v-dialog-drag
28
- >
29
- <div class="cont">
30
- <template slot="footer">
31
- <div class="dialog-footer">
32
- <el-button type="" @click="dialogVisible = !1" class="button-sty" icon="el-icon-close">
33
- {{ i18nt('designer.hint.cancel') }}
34
- </el-button>
35
- <el-button type="primary" @click="colSubmit" class="button-sty" icon="el-icon-check">
36
- {{ i18nt('designer.hint.confirm') }}
37
- </el-button>
38
-
39
- </div>
40
- </template>
41
- <el-table
42
- ref="singleTable"
43
- width="100%"
44
- :data="optionModel.tableColumns"
45
- height="500"
46
- border=""
47
- row-key="columnId"
48
- stripe=""
49
- >
50
- <el-table-column type="index" width="35" fixed="left"></el-table-column>
51
- <el-table-column label="" width="35"><i class="el-icon-s-operation drag-option"></i></el-table-column>
52
- <el-table-column :label="i18nt('designer.setting.columnLabel')" width="150" prop="label">
53
- <template slot-scope="scope">
54
- <el-input v-model="scope.row.label"></el-input>
55
- </template>
56
- </el-table-column>
57
- <el-table-column :label="i18nt('designer.setting.columnName')" width="150" prop="prop">
58
- <template slot-scope="scope">
59
- <el-input v-model="scope.row.prop"></el-input>
60
- </template>
61
- </el-table-column>
62
- <!-- 「列宽」已移除:H5 明细卡片是 dl/dt/dd 排版,不读列宽 —— 它当年是从数据表格
63
- 那套列配置沿用过来的,运行期只被塞进一个拼错的键(witdh)、无人读取。
64
- 列在卡片里占整行还是半行,由下面的「H5列宽」控制。
65
- 存量模板里残留的 width 值不用清,读不到就是了。 -->
66
- <el-table-column :label="i18nt('designer.setting.visibleColumn')" width="70" prop="show">
67
- <template slot-scope="scope">
68
- <el-switch v-model="scope.row.show"></el-switch>
69
- </template>
70
- </el-table-column>
71
- <el-table-column :label="i18nt('必填')" width="70" prop="required">
72
- <template slot-scope="scope">
73
- <el-switch v-model="scope.row.required"></el-switch>
74
- </template>
75
- </el-table-column>
76
- <el-table-column :label="i18nt('列表展示')" width="70" prop="showForRow">
77
- <template slot-scope="scope">
78
- <el-switch v-model="scope.row.showForRow"></el-switch>
79
- </template>
80
- </el-table-column>
81
- <!-- H5 明细卡片里这个字段占整行还是半行(半行=一行两个)。
82
- 不配即整行,运行期判等只认 'half'(存量列读到 undefined 就是整行),
83
- 不能写成 !== 'full'。样式见 xform/styles/h5.scss 块 I2。
84
- ★ 用 :value + $set 而不是 v-model:h5Span 是后加的键,存量列上没有,
85
- Vue 2 只给赋值那一刻已存在的属性装 getter/setter,直接 v-model
86
- 新增属性追踪不到,选完不回显。 -->
87
- <el-table-column label="H5列宽" width="110" prop="h5Span">
88
- <template slot-scope="scope">
89
- <el-select :value="scope.row.h5Span" clearable placeholder="整行"
90
- @input="v => $set(scope.row, 'h5Span', v)">
91
- <el-option value="full" label="整行"></el-option>
92
- <el-option value="half" label="半行(一行两个)"></el-option>
93
- </el-select>
94
- </template>
95
- </el-table-column>
96
- <el-table-column :label="i18nt('designer.setting.formatOfColumn')" width="200" prop="formatS">
97
- <template slot-scope="scope">
98
- <el-select v-model="scope.row.formatS" @change="changeFormatS(scope.row)" clearable>
99
- <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
100
- <el-option value="render" label="render"></el-option>
101
- </el-option-group>
102
- <el-option-group v-for="t in op" :key="t.label" :label="t.label">
103
- <el-option v-for="e in t.options" :key="e.value" :value="e.value" :label="e.label"></el-option>
104
- </el-option-group>
105
- </el-select>
106
- </template>
107
- </el-table-column>
108
- <el-table-column label="格式化配置" width="70" fixed="right" align="center">
109
- <template slot-scope="scope">
110
- <el-button size="mini" plain="" round="" icon="el-icon-edit"
111
- @click="openFormatConfigDialog(scope.row,scope.$index)"
112
- :disabled="!columnFormatMap[scope.row.formatS]"></el-button>
113
- </template>
114
- </el-table-column>
115
- <el-table-column :label="i18nt('designer.setting.renderFunction')" width="70" fixed="right" align="center">
116
- <template slot-scope="scope">
117
- <el-button :disabled="'render' !== scope.row.formatS" size="mini" plain="" round="" icon="el-icon-edit"
118
- @click="showRenderDialog(scope.row)"></el-button>
119
- </template>
120
- </el-table-column>
121
- <el-table-column :label="i18nt('designer.setting.actionColumn')" width="100" fixed="right" align="center">
122
- <template #header>
123
- <span>{{ i18nt('designer.setting.actionColumn') }}</span>
124
- <!-- <el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
125
- icon="el-icon-plus" @click="openFieldTreeDialog"></el-button>-->
126
- </template>
127
- <template slot-scope="scope">
128
- <el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
129
- icon="el-icon-plus" @click="addCol"></el-button>
130
- <el-button
131
- :title="i18nt('designer.setting.deleteTableColumn')"
132
- size="mini"
133
- type=""
134
- circle=""
135
- icon="el-icon-minus"
136
- @click="handleDelete(scope.$index, scope.row)"
137
- ></el-button>
138
- </template>
139
- </el-table-column>
140
-
141
- </el-table>
142
- </div>
143
-
144
- </el-dialog>
145
- <el-dialog
146
- v-if="showRenderDialogFlag"
147
- :title="i18nt('designer.setting.renderFunction')"
148
- :visible.sync="showRenderDialogFlag"
149
- append-to-body=""
150
- :show-close="!0"
151
- custom-class="dialog-style list-dialog"
152
- :close-on-click-modal="!1"
153
- :close-on-press-escape="!1"
154
- :destroy-on-close="!0"
155
- v-dialog-drag
156
- >
157
- <el-alert type="info" :closable="!1" title="function customRender(params,h) {"/>
158
- <code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="renderJson"></code-editor>
159
- <el-alert type="info" :closable="!1" title="}"/>
160
- <div class="dialog-footer" slot="footer">
161
- <el-button @click="showRenderDialogFlag = !1" class="button-sty" icon="el-icon-close">
162
- {{ i18nt('designer.hint.cancel') }}
163
- </el-button>
164
- <el-button type="primary" @click="saveColumnRender" class="button-sty" icon="el-icon-check">
165
- {{ i18nt('designer.hint.confirm') }}
166
- </el-button>
167
- </div>
168
- </el-dialog>
169
- <requestaccessDialog v-if="showRequestaccessDialog" :visiable.sync="showRequestaccessDialog"
170
- @confirm="confirmInsertRequestaccess" multi="false"
171
- :param="{reportCode:reportTemplate.reportCode}"/>
172
-
173
- <el-dialog
174
- v-if="dialogVisible"
175
- custom-class="dialog-style list-dialog"
176
- title="新增列表列"
177
- :visible.sync="showFieldTreeDialog"
178
- :show-close="!0"
179
- :append-to-body="false"
180
- :modal="false"
181
- :close-on-click-modal="!1"
182
- :close-on-press-escape="!1"
183
- :destroy-on-close="!0"
184
- width="500px"
185
- v-dialog-drag
186
- >
187
- <div class="cont" style="height: 500px;">
188
- <el-tree
189
- ref="tree"
190
- :data="treeData"
191
- show-checkbox
192
- node-key="name"
193
- :default-expand-all="true"
194
- :check-on-click-node="true"
195
- :expand-on-click-node="false"
196
- :default-checked-keys="defaultCheckedKeys"
197
- :props="defaultProps">
198
- </el-tree>
199
- </div>
200
- <span slot="footer" class="dialog-footer">
201
- <el-button type="primary" plain class="button-sty" @click="showFieldTreeDialog=false">
202
- <i class="el-icon-close el-icon"></i>
203
- 取 消
204
- </el-button>
205
- <el-button type="primary" @click="confirmFieldTreeDialog" class="button-sty">
206
- <i class="el-icon-check el-icon"></i>
207
- 确 定
208
- </el-button>
209
- </span>
210
- </el-dialog>
211
- <!-- <el-dialog
212
- v-if="showDateConfigDialog"
213
- :title="i18nt('日期配置编辑')"
214
- :visible.sync="showDateConfigDialog"
215
- append-to-body=""
216
- :show-close="!0"
217
- custom-class="dialog-style list-dialog"
218
- :close-on-click-modal="!1"
219
- :close-on-press-escape="!1"
220
- :destroy-on-close="!0"
221
- v-dialog-drag
222
- >
223
- <div class="cont">
224
- <el-form>
225
- <template v-for="(editorName, index) in dateFieldList">
226
- <component
227
- :is="editorName"
228
- :designer="designer"
229
- :selected-widget="selectedWidget"
230
- :option-model="columnOption"
231
- :key="index"
232
- ></component>
233
- </template>
234
- </el-form>
235
- </div>
236
- <div class="dialog-footer" slot="footer">
237
- <el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
238
- {{ i18nt('designer.hint.cancel') }}
239
- </el-button>
240
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
241
- {{ i18nt('designer.hint.confirm') }}
242
- </el-button>
243
- </div>
244
- </el-dialog>-->
245
- <!-- <el-dialog
246
- v-if="showDateConfigDialog"
247
- :title="i18nt('日期配置编辑')"
248
- :visible.sync="showDateConfigDialog"
249
- append-to-body=""
250
- :show-close="!0"
251
- custom-class="dialog-style list-dialog"
252
- :close-on-click-modal="!1"
253
- :close-on-press-escape="!1"
254
- :destroy-on-close="!0"
255
- v-dialog-drag
256
- >
257
- <div class="cont">
258
- <el-scrollbar class="setting-scrollbar">
259
- <el-form :model="columnOption" size="mini" label-position="left" label-width="120px" class="setting-form"
260
- @submit.native.prevent>
261
- <el-collapse v-model="widgetActiveCollapseNames" class="setting-collapse">
262
- <el-collapse-item name="1" v-if="showCollapse(commonProps)"
263
- :title="i18nt('designer.setting.commonSetting')">
264
- <template v-for="(editorName, propName) in commonProps">
265
- <component
266
- v-if="hasPropEditor(propName, editorName)"
267
- :is="getPropEditor(propName, editorName)"
268
- :designer="designer"
269
- :selected-widget="columnSelectedWidget"
270
- :option-model="columnOption"
271
- :key="propName"
272
- ></component>
273
- </template>
274
- </el-collapse-item>
275
-
276
- <el-collapse-item name="2" v-if="showCollapse(advProps)"
277
- :title="i18nt('designer.setting.advancedSetting')">
278
- <template v-for="(editorName, propName) in advProps">
279
- <component
280
- v-if="hasPropEditor(propName, editorName)"
281
- :is="getPropEditor(propName, editorName)"
282
- :designer="designer"
283
- :selected-widget="selectedWidget"
284
- :option-model="columnOption"
285
- :key="propName"
286
- ></component>
287
- </template>
288
- </el-collapse-item>
289
-
290
- <el-collapse-item name="3" v-if="showEventCollapse() && showCollapse(eventProps)"
291
- :title="i18nt('designer.setting.eventSetting')">
292
- <template v-for="(editorName, propName) in eventProps">
293
- <component
294
- v-if="hasPropEditor(propName, editorName)"
295
- :is="getPropEditor(propName, editorName)"
296
- :designer="designer"
297
- :selected-widget="selectedWidget"
298
- :option-model="columnOption"
299
- :key="propName"
300
- ></component>
301
- </template>
302
- </el-collapse-item>
303
- </el-collapse>
304
- </el-form>
305
- </el-scrollbar>
306
- </div>
307
- <div class="dialog-footer" slot="footer">
308
- <el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
309
- {{ i18nt('designer.hint.cancel') }}
310
- </el-button>
311
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
312
- {{ i18nt('designer.hint.confirm') }}
313
- </el-button>
314
- </div>
315
- </el-dialog>-->
316
- </div>
317
- </template>
318
-
319
- <script>
320
- import i18n from '../../../../../../components/xform/utils/i18n';
321
- // import Draggable from 'vuedraggable';
322
- import {deepClone, generateId} from '../../../../../../components/xform/utils/util';
323
- import Sortable from 'sortablejs';
324
- import requestaccessDialog from '../../../../../../views/user/form/report_requestaccess/dialog.vue'
325
-
326
- export default {
327
- name: 'list-h5-editor',
328
- componentName: 'PropertyEditor',
329
- mixins: [i18n],
330
- components: {
331
- requestaccessDialog
332
- },
333
- props: {
334
- designer: Object,
335
- selectedWidget: Object,
336
- optionModel: Object
337
- },
338
- inject: ['getReportTemplate', 'showEventCollapse', 'openWidgetPropertyDialog'],
339
- data: function () {
340
- return {
341
- dialogVisible: !1,
342
- dataDialogVisible: !1,
343
- showButtonsEditDialog: !1,
344
- oldButtonName: '',
345
- cssClassList: [],
346
- tableDataOptions: [],
347
- widgetSizes: [
348
- {
349
- label: 'default',
350
- value: ''
351
- },
352
- {
353
- label: 'large',
354
- value: 'large'
355
- },
356
- {
357
- label: 'medium',
358
- value: 'medium'
359
- },
360
- {
361
- label: 'small',
362
- value: 'small'
363
- },
364
- {
365
- label: 'mini',
366
- value: 'mini'
367
- }
368
- ],
369
- alignOptions: [
370
- {
371
- value: 'left',
372
- label: 'left'
373
- },
374
- {
375
- value: 'center',
376
- label: 'center'
377
- },
378
- {
379
- value: 'right',
380
- label: 'right'
381
- }
382
- ],
383
- fieldTypeOptions: [
384
- {
385
- value: 'text',
386
- label: 'Text'
387
- },
388
- {
389
- value: 'number',
390
- label: 'Number'
391
- },
392
- {
393
- value: 'date',
394
- label: 'Date'
395
- }
396
- ],
397
- op: [
398
- {
399
- label: 'Date Format',
400
- options: [
401
- {
402
- value: 'd1',
403
- label: 'yyyy-MM-dd'
404
- },
405
- {
406
- value: 'd2',
407
- label: 'yyyy/MM/dd'
408
- },
409
- {
410
- value: 'd3',
411
- label: 'yyyy年MM月dd日'
412
- },
413
- {
414
- value: 'd4',
415
- label: 'yyyy-MM-dd HH:mm:ss'
416
- },
417
- {
418
- value: 'd5',
419
- label: 'yyyy-MM-dd hh:mm:ss'
420
- }
421
- ]
422
- },
423
- {
424
- label: 'Number Format',
425
- options: [
426
- {
427
- value: 'n1',
428
- label: '###,###,###,##0.######'
429
- },
430
- {
431
- value: 'n2',
432
- label: '###,###,###,##0.00####'
433
- },
434
- {
435
- value: 'n3',
436
- label: '###,###,###,##0.000000'
437
- },
438
- {
439
- value: 'n4',
440
- label: '###,###,###,##0.000'
441
- },
442
- {
443
- value: 'n5',
444
- label: '###,###,###,##0.00'
445
- },
446
- {
447
- value: 'n6',
448
- label: '###,###,###,##0'
449
- },
450
- {
451
- value: 'n7',
452
- label: '###,##0.00##%'
453
- }
454
- ]
455
- },
456
- {
457
- label: 'edit Format',
458
- options: [
459
- {
460
- value: 'editInput',
461
- label: '文本输入框'
462
- },
463
- {
464
- value: 'editNumber',
465
- label: '数字输入框'
466
- },
467
- {
468
- value: 'editDate',
469
- label: '日期输入框'
470
- },
471
- {
472
- value: 'editSelect',
473
- label: '下拉框'
474
- },
475
- {
476
- value: 'editSearch',
477
- label: '搜索框'
478
- },
479
- {
480
- value: 'editDelete',
481
- label: '删除按钮'
482
- },
483
- {
484
- value: 'editButton',
485
- label: '查看按钮'
486
- },
487
- {
488
- value: 'button',
489
- label: '按钮'
490
- }
491
- ]
492
- },
493
- ],
494
- columnFormatMap: {
495
- editInput: 'input',
496
- editNumber: 'number',
497
- editDate: 'date',
498
- editSelect: 'select',
499
- editSearch: 'vabsearch',
500
- button:'button'
501
- },
502
- showRenderDialogFlag: !1,
503
- renderJson: '',
504
- currentTableColumn: null,
505
- nameRules: [
506
- {
507
- required: !0,
508
- trigger: ['blur', 'change'],
509
- message: this.i18nt('designer.setting.fieldValueRequired')
510
- }
511
- ],
512
- showSqlEditDialog: false,
513
- dataSourceSql: "",
514
- showRequestaccessDialog: false,
515
- showDateConfigDialog: false,
516
- columnOption: {},
517
- dateFieldList: [],
518
- columnSelectedWidget: {},
519
- // reportTemplate:{}
520
-
521
- showFieldTreeDialog: false,
522
- treeData: [],
523
- defaultProps: {
524
- children: 'children',
525
- label: 'label'
526
- },
527
- defaultCheckedKeys: []
528
- };
529
- },
530
- computed: {
531
- dataSourceList: function () {
532
- return this.designer.formConfig && this.designer.formConfig.dataSources ? this.designer.formConfig.dataSources : [];
533
- },
534
- reportTemplate: function () {
535
- return this.getReportTemplate();
536
- }
537
- },
538
- created: function () {
539
- // this.reportTemplate = this.getReportTemplate();
540
- var e = this;
541
- (this.cssClassList = deepClone(this.designer.getCssClassList())),
542
- this.designer.handleEvent('form-css-updated', function (t) {
543
- e.cssClassList = t;
544
- });
545
- if (this.optionModel.showExportBtn == null) this.$set(this.optionModel, 'showExportBtn', true);
546
- },
547
- mounted: function () {
548
- /*let dateFieldList = Object.keys(dateFieldComponents);
549
- this.dateFieldList = dateFieldList;*/
550
- },
551
- methods: {
552
-
553
- dragSort: function () {
554
- var e = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0],
555
- t = this.optionModel.tableColumns;
556
- this.sortable = Sortable.create(e, {
557
- ghostClass: 'sortable-ghost',
558
- setData: function (e) {
559
- e.setData('Text', '');
560
- },
561
- onEnd: function (e) {
562
- var i = t.splice(e.oldIndex, 1)[0];
563
- t.splice(e.newIndex, 0, i);
564
- t[e.newIndex].id;
565
- t[e.newIndex - 1] && t[e.newIndex - 1].id, t[e.newIndex + 1] && t[e.newIndex + 1].id;
566
- }
567
- });
568
- },
569
- openTableDataEdit: function () {
570
- (this.dataDialogVisible = !0), (this.tableDataOptions = JSON.stringify(this.optionModel.tableData, null, ' '));
571
- },
572
- saveTableData: function () {
573
- try {
574
- (this.optionModel.tableData = JSON.parse(this.tableDataOptions)), (this.dataDialogVisible = !1);
575
- } catch (e) {
576
- this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + e.message);
577
- }
578
- },
579
- openSetting: function () {
580
- var e = this;
581
- (this.dialogVisible = !0),
582
- this.$nextTick(function () {
583
- e.dragSort();
584
- });
585
- },
586
- colSubmit: function () {
587
- this.dialogVisible = !1;
588
- },
589
- addCol: function () {
590
- let tmpId = 'column' + generateId();
591
- var e = {
592
- columnId: new Date().getTime(),
593
- required: false,
594
- width: 150,
595
- prop: tmpId,
596
- label: tmpId,
597
- align: "left",
598
- show: true,
599
- showForRow: true,
600
- sortable: true
601
- };
602
- this.optionModel.tableColumns.push(e), this.designer.emitHistoryChange();
603
- },
604
- handleDelete: function (e, t) {
605
- if (1 === this.optionModel.tableColumns.length) return this.$message.warning(this.i18nt('designer.setting.onlyOneColumnCannotBeDeleted')), !1;
606
- this.optionModel.tableColumns.splice(e, 1);
607
- },
608
- showRenderDialog: function (e) {
609
- (this.currentTableColumn = e), (this.renderJson = e.render || ''), (this.showRenderDialogFlag = !0);
610
- },
611
- saveColumnRender: function () {
612
- this.$set(this.currentTableColumn, 'render', this.renderJson), (this.showRenderDialogFlag = !1);
613
- },
614
- handleShowButtonsColumnChange: function (e) {
615
- if (e) {
616
- var t = this.designer.formWidget.getSelectedWidgetRef();
617
- t &&
618
- t.refreshLayout &&
619
- this.$nextTick(function () {
620
- t.refreshLayout();
621
- });
622
- }
623
- },
624
- onButtonNameFocus: function (e) {
625
- console.log('test', e), (this.oldButtonName = e.target.value);
626
- },
627
- onButtonNameChange: function (e, t) {
628
- var i = !1;
629
- this.optionModel.operationButtons.map(function (n, o) {
630
- n.name === e && o !== t && (i = !0);
631
- }),
632
- i && (this.$message.error(this.i18nt('designer.setting.operationButtonDuplicatedNameError')), (this.optionModel.operationButtons[t].name = this.oldButtonName));
633
- },
634
- editButtonsColumn: function () {
635
- this.showButtonsEditDialog = !0;
636
- },
637
- deleteOperationButton: function (e) {
638
- var t = this;
639
- this.$confirm(this.i18nt('designer.setting.deleteOperationButtonHint'), this.i18nt('render.hint.prompt'), {
640
- confirmButtonText: this.i18nt('render.hint.confirm'),
641
- cancelButtonText: this.i18nt('render.hint.cancel')
642
- })
643
- .then(function () {
644
- t.optionModel.operationButtons.splice(e, 1);
645
- })
646
- .catch(function (e) {
647
- });
648
- },
649
- addOperationButton: function () {
650
- this.$set(this.optionModel, 'operationButtons', this.optionModel.operationButtons || []),
651
- this.optionModel.operationButtons.push({
652
- name: 'btn' + generateId(),
653
- label: 'new btn',
654
- type: 'text',
655
- size: 'small',
656
- round: !1,
657
- hidden: !1,
658
- disabled: !1
659
- });
660
- },
661
- refreshTableLayout: function () {
662
- var e = this.designer.formWidget.getSelectedWidgetRef();
663
- e &&
664
- e.refreshLayout &&
665
- this.$nextTick(function () {
666
- e.refreshLayout();
667
- });
668
- },
669
- saveDataSourceSql() {
670
- this.optionModel.dataSourceSql = this.dataSourceSql;
671
- this.showSqlEditDialog = false;
672
- },
673
- openSqlEditDialog() {
674
- this.dataSourceSql = this.optionModel.dataSourceSql ? deepClone(this.optionModel.dataSourceSql) : "";
675
- this.showSqlEditDialog = true;
676
- },
677
- confirmInsertRequestaccess(rows) {
678
- if (rows.length) {
679
- let row = rows[0];
680
- this.optionModel.accessName = row.accessName;
681
- this.optionModel.accessCode = row.accessCode;
682
- }
683
- },
684
- changeFormatS(row) {
685
- row.widget = this.designer.createColumnWidget(row, false) || null;
686
- if (row.formatS == 'editDelete' || row.formatS == 'editButton') {
687
- row.width = 47;
688
- row.prop = null;
689
- row.label = null;
690
- row.sortable = false;
691
- } else {
692
- let tmpId = 'column' + generateId();
693
- if (!row.width || row.width == 47) row.width = 150;
694
- if (!row.prop) row.prop = tmpId;
695
- if (!row.label) row.label = tmpId;
696
- row.sortable = true;
697
- }
698
- },
699
- getColumnWidgetConfig(row, isChange) {
700
- let columnSelectedWidget = null;
701
- let columnEditFields = null;
702
-
703
- let type = this.columnFormatMap[row.formatS];
704
-
705
- if (type) {
706
- if (!isChange) {
707
- const sourceWidget = this.designer.getColumnWidget(row, false);
708
- if (sourceWidget) {
709
- columnSelectedWidget = this.$baseLodash.cloneDeep(sourceWidget);
710
- columnSelectedWidget.options.required = row.required || false;
711
- } else {
712
- columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
713
- let tmpId = generateId();
714
- let idVal = row.prop ? row.prop : (type + tmpId);
715
- columnSelectedWidget.id = idVal;
716
- columnSelectedWidget.options.name = idVal;
717
- columnSelectedWidget.options.required = row.required || false;
718
- }
719
- } else {
720
- columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
721
- let tmpId = generateId();
722
- let idVal = row.prop ? row.prop : (type + tmpId);
723
- columnSelectedWidget.id = idVal;
724
- columnSelectedWidget.options.name = idVal;
725
- columnSelectedWidget.options.required = row.required || false;
726
- }
727
- columnSelectedWidget.options.name = row.prop;
728
- columnSelectedWidget.options.label = row.label;
729
- columnSelectedWidget.options.labelHidden = true;
730
-
731
- }
732
- return {columnSelectedWidget, columnEditFields};
733
- },
734
- openFormatConfigDialog(row, index) {
735
- const {columnSelectedWidget, columnEditFields} = this.getColumnWidgetConfig(row);
736
- if (!columnSelectedWidget) {
737
- return;
738
- }
739
- columnSelectedWidget.options = this.$baseLodash.cloneDeep(
740
- columnSelectedWidget.options
741
- );
742
- this.operateIndex = index;
743
-
744
- this.openWidgetPropertyDialog({
745
- row: row,
746
- columnSelectedWidget,
747
- index: index,
748
- columnEditFields: columnEditFields,
749
- callback: (confirmedWidget) => {
750
- this.confirmFormatConfigDialog(confirmedWidget);
751
- }
752
- })
753
- },
754
- confirmFormatConfigDialog(columnSelectedWidget) {
755
- const options = columnSelectedWidget.options;
756
- let row = this.optionModel.tableColumns[this.operateIndex];
757
- row.widget = columnSelectedWidget;
758
- row.prop = options.name;
759
- row.label = options.label;
760
- row.required = options.required;
761
- },
762
- openFieldTreeDialog() {
763
- this.treeData = [{
764
- "name": "Jinjilianxiren",
765
- "label": "员工-紧急联系人",
766
- children: [
767
- {
768
- "detailEntity": "Jinjilianxiren",
769
- "name": "createdOn",
770
- "label": "员工-紧急联系人.创建时间",
771
- "type": "DateTime",
772
- "required": "1"
773
- }, /*{
774
- "searchDialogWidth": "520px",
775
- "detailEntity": "Jinjilianxiren",
776
- "name": "createdBy",
777
- "label": "员工-紧急联系人.创建用户",
778
- "type": "Reference",
779
- "required": "1"
780
- },*/ {
781
- "detailEntity": "Jinjilianxiren",
782
- "name": "modifiedOn",
783
- "label": "员工-紧急联系人.最近修改时间",
784
- "type": "DateTime",
785
- "required": "0"
786
- }, /*{
787
- "searchDialogWidth": "520px",
788
- "detailEntity": "Jinjilianxiren",
789
- "name": "modifiedBy",
790
- "label": "员工-紧急联系人.修改用户",
791
- "type": "Reference",
792
- "required": "0"
793
- }, {
794
- "searchDialogWidth": "520px",
795
- "detailEntity": "Jinjilianxiren",
796
- "name": "mdYuangongdanganId",
797
- "label": "员工-紧急联系人.主从关联Id",
798
- "type": "Reference",
799
- "required": "1"
800
- },*/ {
801
- "detailEntity": "Jinjilianxiren",
802
- "name": "shouji",
803
- "label": "员工-紧急联系人.手机",
804
- "type": "Text",
805
- "required": "0",
806
- "maxLength": "200"
807
- }, {
808
- "detailEntity": "Jinjilianxiren",
809
- "name": "jinjilianxirenxingming",
810
- "label": "员工-紧急联系人.紧急联系人姓名",
811
- "type": "Text",
812
- "required": "0",
813
- "maxLength": "200"
814
- }]
815
- }];
816
-
817
- let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
818
- let defaultCheckedKeys = [];
819
- this.treeData.forEach(item1 => {
820
- item1.children.forEach(item2 => {
821
- if (fields.includes(item2.name) && !defaultCheckedKeys.includes(item2.name)) {
822
- defaultCheckedKeys.push(item2.name)
823
- }
824
- })
825
- })
826
- this.defaultCheckedKeys = defaultCheckedKeys
827
- this.showFieldTreeDialog = true;
828
- },
829
- confirmFieldTreeDialog() {
830
- // defaultCheckedKeys
831
- let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
832
- let datas = this.$refs.tree.getCheckedNodes(true, false);
833
- datas.filter(item => !fields.includes(item.name)).forEach(item => {
834
- this.addCol2(item);
835
- });
836
- this.designer.emitHistoryChange();
837
- this.showFieldTreeDialog = false;
838
- },
839
- addCol2: function (item) {
840
- let tmpId = 'column' + generateId();
841
- var e = {
842
- columnId: new Date().getTime(),
843
- required: false,
844
- width: 150,
845
- prop: item.name,
846
- label: item.label,
847
- show: true,
848
- sortable: true
849
- };
850
- this.optionModel.tableColumns.push(e)
851
- },
852
- }
853
- };
854
- </script>
855
-
856
- <style>
857
- .icon-drag:before {
858
- content: '\e61d';
859
- }
860
- </style>
1
+ <template>
2
+ <div>
3
+ <el-form-item label="查询列表">
4
+ <el-switch v-model="optionModel.isQueryTable"></el-switch>
5
+ </el-form-item>
6
+ <el-form-item :label="i18nt('designer.setting.showPagination')">
7
+ <el-switch v-model="optionModel.showPagination"></el-switch>
8
+ </el-form-item>
9
+ <el-form-item :label="i18nt('designer.setting.tableColEdit')">
10
+ <el-button type="primary" plain="" round="" @click="openSetting">{{
11
+ i18nt('designer.setting.editAction')
12
+ }}
13
+ </el-button>
14
+ </el-form-item>
15
+ <el-dialog
16
+ v-if="dialogVisible"
17
+ custom-class="dialog-style list-dialog"
18
+ :title="i18nt('designer.setting.tableColEdit')"
19
+ :visible.sync="dialogVisible"
20
+ :show-close="!0"
21
+ :append-to-body="false"
22
+ :modal="false"
23
+ :close-on-click-modal="!1"
24
+ :close-on-press-escape="!1"
25
+ :destroy-on-close="!0"
26
+ width="1220px"
27
+ v-dialog-drag
28
+ >
29
+ <div class="cont">
30
+ <template slot="footer">
31
+ <div class="dialog-footer">
32
+ <el-button type="" @click="dialogVisible = !1" class="button-sty" icon="el-icon-close">
33
+ {{ i18nt('designer.hint.cancel') }}
34
+ </el-button>
35
+ <el-button type="primary" @click="colSubmit" class="button-sty" icon="el-icon-check">
36
+ {{ i18nt('designer.hint.confirm') }}
37
+ </el-button>
38
+
39
+ </div>
40
+ </template>
41
+ <el-table
42
+ ref="singleTable"
43
+ width="100%"
44
+ :data="optionModel.tableColumns"
45
+ height="500"
46
+ border=""
47
+ row-key="columnId"
48
+ stripe=""
49
+ >
50
+ <el-table-column type="index" width="35" fixed="left"></el-table-column>
51
+ <el-table-column label="" width="35"><i class="el-icon-s-operation drag-option"></i></el-table-column>
52
+ <el-table-column :label="i18nt('designer.setting.columnLabel')" width="150" prop="label">
53
+ <template slot-scope="scope">
54
+ <el-input v-model="scope.row.label"></el-input>
55
+ </template>
56
+ </el-table-column>
57
+ <el-table-column :label="i18nt('designer.setting.columnName')" width="150" prop="prop">
58
+ <template slot-scope="scope">
59
+ <el-input v-model="scope.row.prop"></el-input>
60
+ </template>
61
+ </el-table-column>
62
+ <!-- 「列宽」已移除:H5 明细卡片是 dl/dt/dd 排版,不读列宽 —— 它当年是从数据表格
63
+ 那套列配置沿用过来的,运行期只被塞进一个拼错的键(witdh)、无人读取。
64
+ 列在卡片里占整行还是半行,由下面的「H5列宽」控制。
65
+ 存量模板里残留的 width 值不用清,读不到就是了。 -->
66
+ <el-table-column :label="i18nt('designer.setting.visibleColumn')" width="70" prop="show">
67
+ <template slot-scope="scope">
68
+ <el-switch v-model="scope.row.show"></el-switch>
69
+ </template>
70
+ </el-table-column>
71
+ <el-table-column :label="i18nt('必填')" width="70" prop="required">
72
+ <template slot-scope="scope">
73
+ <el-switch v-model="scope.row.required"></el-switch>
74
+ </template>
75
+ </el-table-column>
76
+ <el-table-column :label="i18nt('列表展示')" width="70" prop="showForRow">
77
+ <template slot-scope="scope">
78
+ <el-switch v-model="scope.row.showForRow"></el-switch>
79
+ </template>
80
+ </el-table-column>
81
+ <!-- H5 明细卡片里这个字段占整行还是半行(半行=一行两个)。
82
+ 不配即整行,运行期判等只认 'half'(存量列读到 undefined 就是整行),
83
+ 不能写成 !== 'full'。样式见 xform/styles/h5.scss 块 I2。
84
+ ★ 用 :value + $set 而不是 v-model:h5Span 是后加的键,存量列上没有,
85
+ Vue 2 只给赋值那一刻已存在的属性装 getter/setter,直接 v-model
86
+ 新增属性追踪不到,选完不回显。 -->
87
+ <el-table-column label="H5列宽" width="110" prop="h5Span">
88
+ <template slot-scope="scope">
89
+ <el-select :value="scope.row.h5Span" clearable placeholder="整行"
90
+ @input="v => $set(scope.row, 'h5Span', v)">
91
+ <el-option value="full" label="整行"></el-option>
92
+ <el-option value="half" label="半行(一行两个)"></el-option>
93
+ </el-select>
94
+ </template>
95
+ </el-table-column>
96
+ <el-table-column :label="i18nt('designer.setting.formatOfColumn')" width="200" prop="formatS">
97
+ <template slot-scope="scope">
98
+ <el-select v-model="scope.row.formatS" @change="changeFormatS(scope.row)" clearable>
99
+ <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
100
+ <el-option value="render" label="render"></el-option>
101
+ </el-option-group>
102
+ <el-option-group v-for="t in op" :key="t.label" :label="t.label">
103
+ <el-option v-for="e in t.options" :key="e.value" :value="e.value" :label="e.label"></el-option>
104
+ </el-option-group>
105
+ </el-select>
106
+ </template>
107
+ </el-table-column>
108
+ <el-table-column label="格式化配置" width="70" fixed="right" align="center">
109
+ <template slot-scope="scope">
110
+ <el-button size="mini" plain="" round="" icon="el-icon-edit"
111
+ @click="openFormatConfigDialog(scope.row,scope.$index)"
112
+ :disabled="!columnFormatMap[scope.row.formatS]"></el-button>
113
+ </template>
114
+ </el-table-column>
115
+ <el-table-column :label="i18nt('designer.setting.renderFunction')" width="70" fixed="right" align="center">
116
+ <template slot-scope="scope">
117
+ <el-button :disabled="'render' !== scope.row.formatS" size="mini" plain="" round="" icon="el-icon-edit"
118
+ @click="showRenderDialog(scope.row)"></el-button>
119
+ </template>
120
+ </el-table-column>
121
+ <el-table-column :label="i18nt('designer.setting.actionColumn')" width="100" fixed="right" align="center">
122
+ <template #header>
123
+ <span>{{ i18nt('designer.setting.actionColumn') }}</span>
124
+ <!-- <el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
125
+ icon="el-icon-plus" @click="openFieldTreeDialog"></el-button>-->
126
+ </template>
127
+ <template slot-scope="scope">
128
+ <el-button :title="i18nt('designer.setting.addTableColumn')" size="mini" type="" circle=""
129
+ icon="el-icon-plus" @click="addCol"></el-button>
130
+ <el-button
131
+ :title="i18nt('designer.setting.deleteTableColumn')"
132
+ size="mini"
133
+ type=""
134
+ circle=""
135
+ icon="el-icon-minus"
136
+ @click="handleDelete(scope.$index, scope.row)"
137
+ ></el-button>
138
+ </template>
139
+ </el-table-column>
140
+
141
+ </el-table>
142
+ </div>
143
+
144
+ </el-dialog>
145
+ <el-dialog
146
+ v-if="showRenderDialogFlag"
147
+ :title="i18nt('designer.setting.renderFunction')"
148
+ :visible.sync="showRenderDialogFlag"
149
+ append-to-body=""
150
+ :show-close="!0"
151
+ custom-class="dialog-style list-dialog"
152
+ :close-on-click-modal="!1"
153
+ :close-on-press-escape="!1"
154
+ :destroy-on-close="!0"
155
+ v-dialog-drag
156
+ >
157
+ <el-alert type="info" :closable="!1" title="function customRender(params,h) {"/>
158
+ <code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="renderJson"></code-editor>
159
+ <el-alert type="info" :closable="!1" title="}"/>
160
+ <div class="dialog-footer" slot="footer">
161
+ <el-button @click="showRenderDialogFlag = !1" class="button-sty" icon="el-icon-close">
162
+ {{ i18nt('designer.hint.cancel') }}
163
+ </el-button>
164
+ <el-button type="primary" @click="saveColumnRender" class="button-sty" icon="el-icon-check">
165
+ {{ i18nt('designer.hint.confirm') }}
166
+ </el-button>
167
+ </div>
168
+ </el-dialog>
169
+ <requestaccessDialog v-if="showRequestaccessDialog" :visiable.sync="showRequestaccessDialog"
170
+ @confirm="confirmInsertRequestaccess" multi="false"
171
+ :param="{reportCode:reportTemplate.reportCode}"/>
172
+
173
+ <el-dialog
174
+ v-if="dialogVisible"
175
+ custom-class="dialog-style list-dialog"
176
+ title="新增列表列"
177
+ :visible.sync="showFieldTreeDialog"
178
+ :show-close="!0"
179
+ :append-to-body="false"
180
+ :modal="false"
181
+ :close-on-click-modal="!1"
182
+ :close-on-press-escape="!1"
183
+ :destroy-on-close="!0"
184
+ width="500px"
185
+ v-dialog-drag
186
+ >
187
+ <div class="cont" style="height: 500px;">
188
+ <el-tree
189
+ ref="tree"
190
+ :data="treeData"
191
+ show-checkbox
192
+ node-key="name"
193
+ :default-expand-all="true"
194
+ :check-on-click-node="true"
195
+ :expand-on-click-node="false"
196
+ :default-checked-keys="defaultCheckedKeys"
197
+ :props="defaultProps">
198
+ </el-tree>
199
+ </div>
200
+ <span slot="footer" class="dialog-footer">
201
+ <el-button type="primary" plain class="button-sty" @click="showFieldTreeDialog=false">
202
+ <i class="el-icon-close el-icon"></i>
203
+ 取 消
204
+ </el-button>
205
+ <el-button type="primary" @click="confirmFieldTreeDialog" class="button-sty">
206
+ <i class="el-icon-check el-icon"></i>
207
+ 确 定
208
+ </el-button>
209
+ </span>
210
+ </el-dialog>
211
+ <!-- <el-dialog
212
+ v-if="showDateConfigDialog"
213
+ :title="i18nt('日期配置编辑')"
214
+ :visible.sync="showDateConfigDialog"
215
+ append-to-body=""
216
+ :show-close="!0"
217
+ custom-class="dialog-style list-dialog"
218
+ :close-on-click-modal="!1"
219
+ :close-on-press-escape="!1"
220
+ :destroy-on-close="!0"
221
+ v-dialog-drag
222
+ >
223
+ <div class="cont">
224
+ <el-form>
225
+ <template v-for="(editorName, index) in dateFieldList">
226
+ <component
227
+ :is="editorName"
228
+ :designer="designer"
229
+ :selected-widget="selectedWidget"
230
+ :option-model="columnOption"
231
+ :key="index"
232
+ ></component>
233
+ </template>
234
+ </el-form>
235
+ </div>
236
+ <div class="dialog-footer" slot="footer">
237
+ <el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
238
+ {{ i18nt('designer.hint.cancel') }}
239
+ </el-button>
240
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
241
+ {{ i18nt('designer.hint.confirm') }}
242
+ </el-button>
243
+ </div>
244
+ </el-dialog>-->
245
+ <!-- <el-dialog
246
+ v-if="showDateConfigDialog"
247
+ :title="i18nt('日期配置编辑')"
248
+ :visible.sync="showDateConfigDialog"
249
+ append-to-body=""
250
+ :show-close="!0"
251
+ custom-class="dialog-style list-dialog"
252
+ :close-on-click-modal="!1"
253
+ :close-on-press-escape="!1"
254
+ :destroy-on-close="!0"
255
+ v-dialog-drag
256
+ >
257
+ <div class="cont">
258
+ <el-scrollbar class="setting-scrollbar">
259
+ <el-form :model="columnOption" size="mini" label-position="left" label-width="120px" class="setting-form"
260
+ @submit.native.prevent>
261
+ <el-collapse v-model="widgetActiveCollapseNames" class="setting-collapse">
262
+ <el-collapse-item name="1" v-if="showCollapse(commonProps)"
263
+ :title="i18nt('designer.setting.commonSetting')">
264
+ <template v-for="(editorName, propName) in commonProps">
265
+ <component
266
+ v-if="hasPropEditor(propName, editorName)"
267
+ :is="getPropEditor(propName, editorName)"
268
+ :designer="designer"
269
+ :selected-widget="columnSelectedWidget"
270
+ :option-model="columnOption"
271
+ :key="propName"
272
+ ></component>
273
+ </template>
274
+ </el-collapse-item>
275
+
276
+ <el-collapse-item name="2" v-if="showCollapse(advProps)"
277
+ :title="i18nt('designer.setting.advancedSetting')">
278
+ <template v-for="(editorName, propName) in advProps">
279
+ <component
280
+ v-if="hasPropEditor(propName, editorName)"
281
+ :is="getPropEditor(propName, editorName)"
282
+ :designer="designer"
283
+ :selected-widget="selectedWidget"
284
+ :option-model="columnOption"
285
+ :key="propName"
286
+ ></component>
287
+ </template>
288
+ </el-collapse-item>
289
+
290
+ <el-collapse-item name="3" v-if="showEventCollapse() && showCollapse(eventProps)"
291
+ :title="i18nt('designer.setting.eventSetting')">
292
+ <template v-for="(editorName, propName) in eventProps">
293
+ <component
294
+ v-if="hasPropEditor(propName, editorName)"
295
+ :is="getPropEditor(propName, editorName)"
296
+ :designer="designer"
297
+ :selected-widget="selectedWidget"
298
+ :option-model="columnOption"
299
+ :key="propName"
300
+ ></component>
301
+ </template>
302
+ </el-collapse-item>
303
+ </el-collapse>
304
+ </el-form>
305
+ </el-scrollbar>
306
+ </div>
307
+ <div class="dialog-footer" slot="footer">
308
+ <el-button @click="showDateConfigDialog = !1" class="button-sty" icon="el-icon-close">
309
+ {{ i18nt('designer.hint.cancel') }}
310
+ </el-button>
311
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="confirmDateConfigDialog">
312
+ {{ i18nt('designer.hint.confirm') }}
313
+ </el-button>
314
+ </div>
315
+ </el-dialog>-->
316
+ </div>
317
+ </template>
318
+
319
+ <script>
320
+ import i18n from '../../../../../../components/xform/utils/i18n';
321
+ // import Draggable from 'vuedraggable';
322
+ import {deepClone, generateId} from '../../../../../../components/xform/utils/util';
323
+ import Sortable from 'sortablejs';
324
+ import requestaccessDialog from '../../../../../../views/user/form/report_requestaccess/dialog.vue'
325
+
326
+ export default {
327
+ name: 'list-h5-editor',
328
+ componentName: 'PropertyEditor',
329
+ mixins: [i18n],
330
+ components: {
331
+ requestaccessDialog
332
+ },
333
+ props: {
334
+ designer: Object,
335
+ selectedWidget: Object,
336
+ optionModel: Object
337
+ },
338
+ inject: ['getReportTemplate', 'showEventCollapse', 'openWidgetPropertyDialog'],
339
+ data: function () {
340
+ return {
341
+ dialogVisible: !1,
342
+ dataDialogVisible: !1,
343
+ showButtonsEditDialog: !1,
344
+ oldButtonName: '',
345
+ cssClassList: [],
346
+ tableDataOptions: [],
347
+ widgetSizes: [
348
+ {
349
+ label: 'default',
350
+ value: ''
351
+ },
352
+ {
353
+ label: 'large',
354
+ value: 'large'
355
+ },
356
+ {
357
+ label: 'medium',
358
+ value: 'medium'
359
+ },
360
+ {
361
+ label: 'small',
362
+ value: 'small'
363
+ },
364
+ {
365
+ label: 'mini',
366
+ value: 'mini'
367
+ }
368
+ ],
369
+ alignOptions: [
370
+ {
371
+ value: 'left',
372
+ label: 'left'
373
+ },
374
+ {
375
+ value: 'center',
376
+ label: 'center'
377
+ },
378
+ {
379
+ value: 'right',
380
+ label: 'right'
381
+ }
382
+ ],
383
+ fieldTypeOptions: [
384
+ {
385
+ value: 'text',
386
+ label: 'Text'
387
+ },
388
+ {
389
+ value: 'number',
390
+ label: 'Number'
391
+ },
392
+ {
393
+ value: 'date',
394
+ label: 'Date'
395
+ }
396
+ ],
397
+ op: [
398
+ {
399
+ label: 'Date Format',
400
+ options: [
401
+ {
402
+ value: 'd1',
403
+ label: 'yyyy-MM-dd'
404
+ },
405
+ {
406
+ value: 'd2',
407
+ label: 'yyyy/MM/dd'
408
+ },
409
+ {
410
+ value: 'd3',
411
+ label: 'yyyy年MM月dd日'
412
+ },
413
+ {
414
+ value: 'd4',
415
+ label: 'yyyy-MM-dd HH:mm:ss'
416
+ },
417
+ {
418
+ value: 'd5',
419
+ label: 'yyyy-MM-dd hh:mm:ss'
420
+ }
421
+ ]
422
+ },
423
+ {
424
+ label: 'Number Format',
425
+ options: [
426
+ {
427
+ value: 'n1',
428
+ label: '###,###,###,##0.######'
429
+ },
430
+ {
431
+ value: 'n2',
432
+ label: '###,###,###,##0.00####'
433
+ },
434
+ {
435
+ value: 'n3',
436
+ label: '###,###,###,##0.000000'
437
+ },
438
+ {
439
+ value: 'n4',
440
+ label: '###,###,###,##0.000'
441
+ },
442
+ {
443
+ value: 'n5',
444
+ label: '###,###,###,##0.00'
445
+ },
446
+ {
447
+ value: 'n6',
448
+ label: '###,###,###,##0'
449
+ },
450
+ {
451
+ value: 'n7',
452
+ label: '###,##0.00##%'
453
+ }
454
+ ]
455
+ },
456
+ {
457
+ label: 'edit Format',
458
+ /* H5 暂时只读:编辑格式只留下拉框,其余先不下发 */
459
+ options: [
460
+ {
461
+ value: 'editSelect',
462
+ label: '下拉框'
463
+ }
464
+ ]
465
+ },
466
+ ],
467
+ columnFormatMap: {
468
+ editInput: 'input',
469
+ editNumber: 'number',
470
+ editDate: 'date',
471
+ editSelect: 'select',
472
+ editSearch: 'vabsearch',
473
+ button:'button'
474
+ },
475
+ showRenderDialogFlag: !1,
476
+ renderJson: '',
477
+ currentTableColumn: null,
478
+ nameRules: [
479
+ {
480
+ required: !0,
481
+ trigger: ['blur', 'change'],
482
+ message: this.i18nt('designer.setting.fieldValueRequired')
483
+ }
484
+ ],
485
+ showSqlEditDialog: false,
486
+ dataSourceSql: "",
487
+ showRequestaccessDialog: false,
488
+ showDateConfigDialog: false,
489
+ columnOption: {},
490
+ dateFieldList: [],
491
+ columnSelectedWidget: {},
492
+ // reportTemplate:{}
493
+
494
+ showFieldTreeDialog: false,
495
+ treeData: [],
496
+ defaultProps: {
497
+ children: 'children',
498
+ label: 'label'
499
+ },
500
+ defaultCheckedKeys: []
501
+ };
502
+ },
503
+ computed: {
504
+ dataSourceList: function () {
505
+ return this.designer.formConfig && this.designer.formConfig.dataSources ? this.designer.formConfig.dataSources : [];
506
+ },
507
+ reportTemplate: function () {
508
+ return this.getReportTemplate();
509
+ }
510
+ },
511
+ created: function () {
512
+ // this.reportTemplate = this.getReportTemplate();
513
+ var e = this;
514
+ (this.cssClassList = deepClone(this.designer.getCssClassList())),
515
+ this.designer.handleEvent('form-css-updated', function (t) {
516
+ e.cssClassList = t;
517
+ });
518
+ if (this.optionModel.showExportBtn == null) this.$set(this.optionModel, 'showExportBtn', true);
519
+ },
520
+ mounted: function () {
521
+ /*let dateFieldList = Object.keys(dateFieldComponents);
522
+ this.dateFieldList = dateFieldList;*/
523
+ },
524
+ methods: {
525
+
526
+ dragSort: function () {
527
+ var e = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0],
528
+ t = this.optionModel.tableColumns;
529
+ this.sortable = Sortable.create(e, {
530
+ ghostClass: 'sortable-ghost',
531
+ setData: function (e) {
532
+ e.setData('Text', '');
533
+ },
534
+ onEnd: function (e) {
535
+ var i = t.splice(e.oldIndex, 1)[0];
536
+ t.splice(e.newIndex, 0, i);
537
+ t[e.newIndex].id;
538
+ t[e.newIndex - 1] && t[e.newIndex - 1].id, t[e.newIndex + 1] && t[e.newIndex + 1].id;
539
+ }
540
+ });
541
+ },
542
+ openTableDataEdit: function () {
543
+ (this.dataDialogVisible = !0), (this.tableDataOptions = JSON.stringify(this.optionModel.tableData, null, ' '));
544
+ },
545
+ saveTableData: function () {
546
+ try {
547
+ (this.optionModel.tableData = JSON.parse(this.tableDataOptions)), (this.dataDialogVisible = !1);
548
+ } catch (e) {
549
+ this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + e.message);
550
+ }
551
+ },
552
+ openSetting: function () {
553
+ var e = this;
554
+ (this.dialogVisible = !0),
555
+ this.$nextTick(function () {
556
+ e.dragSort();
557
+ });
558
+ },
559
+ colSubmit: function () {
560
+ this.dialogVisible = !1;
561
+ },
562
+ addCol: function () {
563
+ let tmpId = 'column' + generateId();
564
+ var e = {
565
+ columnId: new Date().getTime(),
566
+ required: false,
567
+ width: 150,
568
+ prop: tmpId,
569
+ label: tmpId,
570
+ align: "left",
571
+ show: true,
572
+ showForRow: true,
573
+ sortable: true
574
+ };
575
+ this.optionModel.tableColumns.push(e), this.designer.emitHistoryChange();
576
+ },
577
+ handleDelete: function (e, t) {
578
+ if (1 === this.optionModel.tableColumns.length) return this.$message.warning(this.i18nt('designer.setting.onlyOneColumnCannotBeDeleted')), !1;
579
+ this.optionModel.tableColumns.splice(e, 1);
580
+ },
581
+ showRenderDialog: function (e) {
582
+ (this.currentTableColumn = e), (this.renderJson = e.render || ''), (this.showRenderDialogFlag = !0);
583
+ },
584
+ saveColumnRender: function () {
585
+ this.$set(this.currentTableColumn, 'render', this.renderJson), (this.showRenderDialogFlag = !1);
586
+ },
587
+ handleShowButtonsColumnChange: function (e) {
588
+ if (e) {
589
+ var t = this.designer.formWidget.getSelectedWidgetRef();
590
+ t &&
591
+ t.refreshLayout &&
592
+ this.$nextTick(function () {
593
+ t.refreshLayout();
594
+ });
595
+ }
596
+ },
597
+ onButtonNameFocus: function (e) {
598
+ console.log('test', e), (this.oldButtonName = e.target.value);
599
+ },
600
+ onButtonNameChange: function (e, t) {
601
+ var i = !1;
602
+ this.optionModel.operationButtons.map(function (n, o) {
603
+ n.name === e && o !== t && (i = !0);
604
+ }),
605
+ i && (this.$message.error(this.i18nt('designer.setting.operationButtonDuplicatedNameError')), (this.optionModel.operationButtons[t].name = this.oldButtonName));
606
+ },
607
+ editButtonsColumn: function () {
608
+ this.showButtonsEditDialog = !0;
609
+ },
610
+ deleteOperationButton: function (e) {
611
+ var t = this;
612
+ this.$confirm(this.i18nt('designer.setting.deleteOperationButtonHint'), this.i18nt('render.hint.prompt'), {
613
+ confirmButtonText: this.i18nt('render.hint.confirm'),
614
+ cancelButtonText: this.i18nt('render.hint.cancel')
615
+ })
616
+ .then(function () {
617
+ t.optionModel.operationButtons.splice(e, 1);
618
+ })
619
+ .catch(function (e) {
620
+ });
621
+ },
622
+ addOperationButton: function () {
623
+ this.$set(this.optionModel, 'operationButtons', this.optionModel.operationButtons || []),
624
+ this.optionModel.operationButtons.push({
625
+ name: 'btn' + generateId(),
626
+ label: 'new btn',
627
+ type: 'text',
628
+ size: 'small',
629
+ round: !1,
630
+ hidden: !1,
631
+ disabled: !1
632
+ });
633
+ },
634
+ refreshTableLayout: function () {
635
+ var e = this.designer.formWidget.getSelectedWidgetRef();
636
+ e &&
637
+ e.refreshLayout &&
638
+ this.$nextTick(function () {
639
+ e.refreshLayout();
640
+ });
641
+ },
642
+ saveDataSourceSql() {
643
+ this.optionModel.dataSourceSql = this.dataSourceSql;
644
+ this.showSqlEditDialog = false;
645
+ },
646
+ openSqlEditDialog() {
647
+ this.dataSourceSql = this.optionModel.dataSourceSql ? deepClone(this.optionModel.dataSourceSql) : "";
648
+ this.showSqlEditDialog = true;
649
+ },
650
+ confirmInsertRequestaccess(rows) {
651
+ if (rows.length) {
652
+ let row = rows[0];
653
+ this.optionModel.accessName = row.accessName;
654
+ this.optionModel.accessCode = row.accessCode;
655
+ }
656
+ },
657
+ changeFormatS(row) {
658
+ row.widget = this.designer.createColumnWidget(row, false) || null;
659
+ if (row.formatS == 'editDelete' || row.formatS == 'editButton') {
660
+ row.width = 47;
661
+ row.prop = null;
662
+ row.label = null;
663
+ row.sortable = false;
664
+ } else {
665
+ let tmpId = 'column' + generateId();
666
+ if (!row.width || row.width == 47) row.width = 150;
667
+ if (!row.prop) row.prop = tmpId;
668
+ if (!row.label) row.label = tmpId;
669
+ row.sortable = true;
670
+ }
671
+ },
672
+ getColumnWidgetConfig(row, isChange) {
673
+ let columnSelectedWidget = null;
674
+ let columnEditFields = null;
675
+
676
+ let type = this.columnFormatMap[row.formatS];
677
+
678
+ if (type) {
679
+ if (!isChange) {
680
+ const sourceWidget = this.designer.getColumnWidget(row, false);
681
+ if (sourceWidget) {
682
+ columnSelectedWidget = this.$baseLodash.cloneDeep(sourceWidget);
683
+ columnSelectedWidget.options.required = row.required || false;
684
+ } else {
685
+ columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
686
+ let tmpId = generateId();
687
+ let idVal = row.prop ? row.prop : (type + tmpId);
688
+ columnSelectedWidget.id = idVal;
689
+ columnSelectedWidget.options.name = idVal;
690
+ columnSelectedWidget.options.required = row.required || false;
691
+ }
692
+ } else {
693
+ columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
694
+ let tmpId = generateId();
695
+ let idVal = row.prop ? row.prop : (type + tmpId);
696
+ columnSelectedWidget.id = idVal;
697
+ columnSelectedWidget.options.name = idVal;
698
+ columnSelectedWidget.options.required = row.required || false;
699
+ }
700
+ columnSelectedWidget.options.name = row.prop;
701
+ columnSelectedWidget.options.label = row.label;
702
+ columnSelectedWidget.options.labelHidden = true;
703
+
704
+ }
705
+ return {columnSelectedWidget, columnEditFields};
706
+ },
707
+ openFormatConfigDialog(row, index) {
708
+ const {columnSelectedWidget, columnEditFields} = this.getColumnWidgetConfig(row);
709
+ if (!columnSelectedWidget) {
710
+ return;
711
+ }
712
+ columnSelectedWidget.options = this.$baseLodash.cloneDeep(
713
+ columnSelectedWidget.options
714
+ );
715
+ this.operateIndex = index;
716
+
717
+ this.openWidgetPropertyDialog({
718
+ row: row,
719
+ columnSelectedWidget,
720
+ index: index,
721
+ columnEditFields: columnEditFields,
722
+ callback: (confirmedWidget) => {
723
+ this.confirmFormatConfigDialog(confirmedWidget);
724
+ }
725
+ })
726
+ },
727
+ confirmFormatConfigDialog(columnSelectedWidget) {
728
+ const options = columnSelectedWidget.options;
729
+ let row = this.optionModel.tableColumns[this.operateIndex];
730
+ row.widget = columnSelectedWidget;
731
+ row.prop = options.name;
732
+ row.label = options.label;
733
+ row.required = options.required;
734
+ },
735
+ openFieldTreeDialog() {
736
+ this.treeData = [{
737
+ "name": "Jinjilianxiren",
738
+ "label": "员工-紧急联系人",
739
+ children: [
740
+ {
741
+ "detailEntity": "Jinjilianxiren",
742
+ "name": "createdOn",
743
+ "label": "员工-紧急联系人.创建时间",
744
+ "type": "DateTime",
745
+ "required": "1"
746
+ }, /*{
747
+ "searchDialogWidth": "520px",
748
+ "detailEntity": "Jinjilianxiren",
749
+ "name": "createdBy",
750
+ "label": "员工-紧急联系人.创建用户",
751
+ "type": "Reference",
752
+ "required": "1"
753
+ },*/ {
754
+ "detailEntity": "Jinjilianxiren",
755
+ "name": "modifiedOn",
756
+ "label": "员工-紧急联系人.最近修改时间",
757
+ "type": "DateTime",
758
+ "required": "0"
759
+ }, /*{
760
+ "searchDialogWidth": "520px",
761
+ "detailEntity": "Jinjilianxiren",
762
+ "name": "modifiedBy",
763
+ "label": "员工-紧急联系人.修改用户",
764
+ "type": "Reference",
765
+ "required": "0"
766
+ }, {
767
+ "searchDialogWidth": "520px",
768
+ "detailEntity": "Jinjilianxiren",
769
+ "name": "mdYuangongdanganId",
770
+ "label": "员工-紧急联系人.主从关联Id",
771
+ "type": "Reference",
772
+ "required": "1"
773
+ },*/ {
774
+ "detailEntity": "Jinjilianxiren",
775
+ "name": "shouji",
776
+ "label": "员工-紧急联系人.手机",
777
+ "type": "Text",
778
+ "required": "0",
779
+ "maxLength": "200"
780
+ }, {
781
+ "detailEntity": "Jinjilianxiren",
782
+ "name": "jinjilianxirenxingming",
783
+ "label": "员工-紧急联系人.紧急联系人姓名",
784
+ "type": "Text",
785
+ "required": "0",
786
+ "maxLength": "200"
787
+ }]
788
+ }];
789
+
790
+ let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
791
+ let defaultCheckedKeys = [];
792
+ this.treeData.forEach(item1 => {
793
+ item1.children.forEach(item2 => {
794
+ if (fields.includes(item2.name) && !defaultCheckedKeys.includes(item2.name)) {
795
+ defaultCheckedKeys.push(item2.name)
796
+ }
797
+ })
798
+ })
799
+ this.defaultCheckedKeys = defaultCheckedKeys
800
+ this.showFieldTreeDialog = true;
801
+ },
802
+ confirmFieldTreeDialog() {
803
+ // defaultCheckedKeys
804
+ let fields = this.optionModel.tableColumns.filter(item => !!item.prop).map(item => item.prop);
805
+ let datas = this.$refs.tree.getCheckedNodes(true, false);
806
+ datas.filter(item => !fields.includes(item.name)).forEach(item => {
807
+ this.addCol2(item);
808
+ });
809
+ this.designer.emitHistoryChange();
810
+ this.showFieldTreeDialog = false;
811
+ },
812
+ addCol2: function (item) {
813
+ let tmpId = 'column' + generateId();
814
+ var e = {
815
+ columnId: new Date().getTime(),
816
+ required: false,
817
+ width: 150,
818
+ prop: item.name,
819
+ label: item.label,
820
+ show: true,
821
+ sortable: true
822
+ };
823
+ this.optionModel.tableColumns.push(e)
824
+ },
825
+ }
826
+ };
827
+ </script>
828
+
829
+ <style>
830
+ .icon-drag:before {
831
+ content: '\e61d';
832
+ }
833
+ </style>