cloud-web-corejs 1.0.54-dev.810 → 1.0.54-dev.811

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 (83) hide show
  1. package/package.json +1 -1
  2. package/src/components/VabUpload/image-viewer.vue +442 -442
  3. package/src/components/VabUpload/index.vue +44 -2
  4. package/src/components/VabUpload/mixins.js +126 -19
  5. package/src/components/VabUpload/view.vue +247 -209
  6. package/src/components/baseTabs/mixins.js +181 -181
  7. package/src/components/mobile/wf/content.vue +1665 -1556
  8. package/src/components/table/config.js +78 -78
  9. package/src/components/table/index.js +1276 -1276
  10. package/src/components/table/tableForm.vue +330 -330
  11. package/src/components/table/tableFormMixin.js +318 -318
  12. package/src/components/table/vxeFilter/index.js +163 -163
  13. package/src/components/table/vxeFilter/mixin.js +316 -316
  14. package/src/components/wf/content.vue +1188 -1188
  15. package/src/components/wf/wf.js +29 -12
  16. package/src/components/wf/wfActionDropdown.vue +1 -1
  17. package/src/components/wf/wfActionItems.js +1 -1
  18. package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +528 -0
  19. package/src/components/xform/docs/2026-08 xform H5 P1 /345/256/236/347/216/260/350/247/204/346/240/274.md" +412 -0
  20. package/src/components/xform/docs/2026-08 xform H5 P2 /345/256/236/347/216/260/350/247/204/346/240/274.md" +287 -0
  21. package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +400 -0
  22. package/src/components/xform/form-designer/designer.js +15 -0
  23. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +269 -269
  24. package/src/components/xform/form-designer/form-widget/container-widget/detail-temp-widget.vue +132 -0
  25. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +250 -250
  26. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +319 -320
  27. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +365 -365
  28. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +554 -555
  29. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +409 -409
  30. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +150 -132
  31. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +114 -114
  32. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +154 -154
  33. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +29 -1
  34. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +178 -178
  35. package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -77
  36. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +139 -139
  37. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +106 -106
  38. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +134 -134
  39. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -0
  40. package/src/components/xform/form-designer/setting-panel/form-setting.vue +39 -39
  41. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +438 -438
  42. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +2103 -2103
  43. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +90 -0
  44. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +82 -82
  45. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +8 -8
  46. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +137 -137
  47. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  48. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +43 -43
  49. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +43 -43
  50. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -96
  51. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +42 -42
  52. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +43 -43
  53. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +158 -158
  54. package/src/components/xform/form-designer/setting-panel/property-editor/h5Span-editor.vue +51 -0
  55. package/src/components/xform/form-designer/setting-panel/property-editor/itemStyle-editor.vue +39 -0
  56. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +188 -188
  57. package/src/components/xform/form-designer/setting-panel/property-editor/styleTempClass-editor.vue +51 -0
  58. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +347 -347
  59. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +4 -0
  60. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +55 -3
  61. package/src/components/xform/form-render/container-item/data-table-mixin.js +33 -12
  62. package/src/components/xform/form-render/container-item/detail-h5-item.vue +183 -32
  63. package/src/components/xform/form-render/container-item/detail-temp-item.vue +110 -0
  64. package/src/components/xform/form-render/container-item/h5-card-pane-item.vue +160 -140
  65. package/src/components/xform/form-render/container-item/list-h5-item.vue +1642 -1700
  66. package/src/components/xform/form-render/index.vue +153 -147
  67. package/src/components/xform/form-render/indexMixin.js +12 -0
  68. package/src/components/xform/lang/en-US.js +10 -0
  69. package/src/components/xform/lang/zh-CN.js +12 -0
  70. package/src/components/xform/mixins/defaultHandle.js +707 -707
  71. package/src/components/xform/styles/h5.scss +1633 -0
  72. package/src/components/xform/utils/textMaskUtil.js +182 -182
  73. package/src/components/xform/utils/treeTableUtil.js +1292 -1265
  74. package/src/components/xform/utils/util.js +56 -11
  75. package/src/utils/pdfUtil.js +429 -429
  76. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  77. package/src/views/bd/setting/table_model/edit.vue +1066 -1066
  78. package/src/views/bd/setting/table_model/mixins/edit.js +1455 -1455
  79. package/src/views/bd/setting/table_model/mixins/zdDialog.js +148 -148
  80. package/src/views/user/home/wjl/content.vue +394 -31
  81. package/src/views/user/role/edit.vue +632 -632
  82. package/src/views/user/role/list.vue +260 -260
  83. package/src/views/user/wf/wf_manage/list.vue +1116 -1116
@@ -1,1700 +1,1642 @@
1
- <template>
2
- <container-item-wrapper
3
- :widget="widget"
4
- :class="widget.options.isFullscreen ? 'full-height' : ''"
5
- >
6
- <div class="h5-header">{{ widget.options.label }}</div>
7
- <div class="h5-search-box">
8
- <el-input v-model="keyword" placeholder="请选择" class="txt">
9
- <i slot="suffix" class="el-input__icon el-icon-search"></i>
10
- <el-button slot="append" class="btn" @click="searchEvent"
11
- >搜索</el-button
12
- >
13
- </el-input>
14
- <div class="icon-screen" @click="openAdvancedSearchDialog">
15
- <i class="iconfont icon-chaxuntiaojianshezhi"></i>筛选
16
- </div>
17
- </div>
18
- <div
19
- v-if="widget.options.isQueryTable"
20
- class="h5-fixed-top-btns"
21
- title-width="92px"
22
- title-align="right"
23
- >
24
- <el-form label-position="top">
25
- <template v-if="!!widget.buttons && widget.buttons.length > 0">
26
- <template v-for="(subWidget, swIdx) in widget.buttons">
27
- <template v-if="'container' === subWidget.category">
28
- <component
29
- :is="subWidget.type + '-item'"
30
- :widget="subWidget"
31
- :key="swIdx"
32
- :parent-list="widget.buttons"
33
- :index-of-parent-list="swIdx"
34
- :parent-widget="widget"
35
- >
36
- <!-- 递归传递插槽!!! -->
37
- <template
38
- v-for="slot in Object.keys($scopedSlots)"
39
- v-slot:[slot]="scope"
40
- >
41
- <slot :name="slot" v-bind="scope" />
42
- </template>
43
- </component>
44
- </template>
45
- <template v-else>
46
- <component
47
- :is="subWidget.type + '-widget'"
48
- :field="subWidget"
49
- :designer="null"
50
- :key="swIdx"
51
- :parent-list="widget.buttons"
52
- :index-of-parent-list="swIdx"
53
- :parent-widget="widget"
54
- >
55
- <!-- 递归传递插槽!!! -->
56
- <template
57
- v-for="slot in Object.keys($scopedSlots)"
58
- v-slot:[slot]="scope"
59
- >
60
- <slot :name="slot" v-bind="scope" />
61
- </template>
62
- </component>
63
- </template>
64
- </template>
65
- </template>
66
- </el-form>
67
- </div>
68
- <div class="h5-list-box">
69
- <div
70
- v-for="(row, rowIndex) in fieldModel"
71
- :key="rowIndex"
72
- class="item"
73
- @click="itemCheck(row)"
74
- :class="{ checked: checkItemIds.includes(row.id) }"
75
- >
76
- <div
77
- v-if="!widget.options.isQueryTable"
78
- class="del-btn"
79
- @click.stop="deleteRow(row, rowIndex)"
80
- >
81
- <i class="el-icon-delete"></i>
82
- </div>
83
- <template v-if="vxeOption.columns.length > 0">
84
- <div class="t1" v-if="widget.options.isQueryTable">
85
- <template
86
- v-for="(column, columnIndex) in vxeOption.columns.filter(
87
- (item, index) => item.isMainFiled
88
- )"
89
- >
90
- <b :key="'1-' + columnIndex">{{ column.title }}:</b>
91
- <span :key="'2-' + columnIndex">
92
- <template v-if="!column.params.formatS">
93
- {{ row[column.field] }}
94
- </template>
95
- <template v-else-if="column.params.formatS == 'render'">
96
- {{
97
- column.slots.default({
98
- column: column,
99
- rowIndex: rowIndex,
100
- row: row,
101
- items: fieldModel,
102
- })
103
- }}
104
- </template>
105
- <template
106
- v-else-if="column.slots && column.slots.default == 'widget'"
107
- >
108
- <component
109
- :is="getColumnWidgetName(column.params.widget)"
110
- :field="column.params.widget"
111
- :form-model="globalModel.formModel"
112
- :designer="null"
113
- :key="rowIndex"
114
- :parent-widget="widget"
115
- :columnConfig="column.params.columnConfig"
116
- :subFormRowIndex="rowIndex"
117
- :formItemProp="
118
- getColumnProp(widget, {
119
- column: column,
120
- rowIndex: rowIndex,
121
- row: row,
122
- items: fieldModel,
123
- })
124
- "
125
- :tableParam="{
126
- column: column,
127
- rowIndex: rowIndex,
128
- row: row,
129
- items: fieldModel,
130
- }"
131
- ></component>
132
- </template>
133
- <template v-else-if="column.params.formatS == 'editDelete'">
134
- <a
135
- href="javascript:void(0);"
136
- class="a-link"
137
- @click="deleteRow(row, rowIndex)"
138
- >
139
- <el-tooltip
140
- :enterable="false"
141
- effect="dark"
142
- content="删除"
143
- placement="top"
144
- popper-class="tooltip-skin"
145
- >
146
- <i class="el-icon-delete" />
147
- </el-tooltip>
148
- </a>
149
- </template>
150
- <template v-else-if="column.params.formatS == 'editButton'">
151
- <a
152
- href="javascript:void(0);"
153
- class="a-link"
154
- @click.stop="openEditDialog(obj.row)"
155
- >
156
- <el-tooltip
157
- :enterable="false"
158
- effect="dark"
159
- content="查看"
160
- placement="top"
161
- popper-class="tooltip-skin"
162
- >
163
- <i class="el-icon-edit" />
164
- </el-tooltip>
165
- </a>
166
- </template>
167
- <template v-else>
168
- {{
169
- column.formatter({
170
- cellValue: row[column.field],
171
- column: column,
172
- rowIndex: rowIndex,
173
- row: row,
174
- items: fieldModel,
175
- })
176
- }}
177
- </template>
178
- </span>
179
- <!-- <div class="status">未审核</div>-->
180
- </template>
181
- </div>
182
- <div class="t2">
183
- <template
184
- v-if="
185
- !widget.options.isQueryTable || vxeOption.columns.length > 1
186
- "
187
- >
188
- <template v-for="(column, columnIndex) in vxeOption.columns">
189
- <template
190
- v-if="
191
- (!widget.options.isQueryTable || !column.isMainFiled) &&
192
- column.showForRow
193
- "
194
- >
195
- <dl :key="columnIndex">
196
- <div>
197
- <dt>{{ column.title }}:</dt>
198
- <dd>
199
- <template v-if="!column.params.formatS">
200
- {{ row[column.field] }}
201
- </template>
202
- <template v-else-if="column.params.formatS == 'render'">
203
- {{
204
- column.slots.default({
205
- column: column,
206
- rowIndex: rowIndex,
207
- row: row,
208
- items: fieldModel,
209
- })
210
- }}
211
- </template>
212
-
213
- <template
214
- v-else-if="
215
- column.slots && column.slots.default == 'widget'
216
- "
217
- >
218
- <component
219
- :is="getColumnWidgetName(column.params.widget)"
220
- :field="column.params.widget"
221
- :form-model="globalModel.formModel"
222
- :designer="null"
223
- :key="rowIndex + '-' + columnIndex"
224
- :parent-widget="widget"
225
- :columnConfig="column.params.columnConfig"
226
- :subFormRowIndex="rowIndex"
227
- :formItemProp="
228
- getColumnProp(widget, {
229
- column: column,
230
- rowIndex: rowIndex,
231
- row: row,
232
- items: fieldModel,
233
- })
234
- "
235
- :tableParam="{
236
- column: column,
237
- rowIndex: rowIndex,
238
- row: row,
239
- items: fieldModel,
240
- }"
241
- ></component>
242
- </template>
243
- <template
244
- v-else-if="column.params.formatS == 'editDelete'"
245
- >
246
- <a
247
- href="javascript:void(0);"
248
- class="a-link"
249
- @click.stop="deleteRow(row, rowIndex)"
250
- >
251
- <el-tooltip
252
- :enterable="false"
253
- effect="dark"
254
- content="删除"
255
- placement="top"
256
- popper-class="tooltip-skin"
257
- >
258
- <i class="el-icon-delete" />
259
- </el-tooltip>
260
- </a>
261
- </template>
262
- <template
263
- v-else-if="column.params.formatS == 'editButton'"
264
- >
265
- <a
266
- href="javascript:void(0);"
267
- class="a-link"
268
- @click.stop="openEditDialog(row)"
269
- >
270
- <el-tooltip
271
- :enterable="false"
272
- effect="dark"
273
- content="查看"
274
- placement="top"
275
- popper-class="tooltip-skin"
276
- >
277
- <i class="el-icon-edit" />
278
- </el-tooltip>
279
- </a>
280
- </template>
281
- <template v-else>
282
- {{
283
- column.formatter({
284
- cellValue: row[column.field],
285
- column: column,
286
- rowIndex: rowIndex,
287
- row: row,
288
- items: fieldModel,
289
- })
290
- }}
291
- </template>
292
- </dd>
293
- </div>
294
- </dl>
295
- </template>
296
- </template>
297
- </template>
298
- </div>
299
- <div class="btns">
300
- <!-- <div class="checkbox_fl">
301
- <el-checkbox></el-checkbox>
302
- </div> -->
303
- <!-- <a class="btn"><i class="el-icon-delete"/><span>删除</span></a>
304
- <a class="btn"><i class="el-icon-edit"/><span>查看</span></a>-->
305
- <template
306
- v-if="!!widget.lineButtons && widget.lineButtons.length > 0"
307
- >
308
- <template v-for="(subWidget, swIdx) in widget.lineButtons">
309
- <template v-if="'container' === subWidget.category">
310
- <component
311
- :is="subWidget.type + '-item'"
312
- :widget="subWidget"
313
- :key="swIdx"
314
- :parent-list="widget.lineButtons"
315
- :index-of-parent-list="swIdx"
316
- :parent-widget="widget"
317
- :subFormRowIndex="rowIndex"
318
- :tableParam="{
319
- rowIndex: rowIndex,
320
- row: row,
321
- items: fieldModel,
322
- }"
323
- >
324
- <!-- 递归传递插槽!!! -->
325
- <template
326
- v-for="slot in Object.keys($scopedSlots)"
327
- v-slot:[slot]="scope"
328
- >
329
- <slot :name="slot" v-bind="scope" />
330
- </template>
331
- </component>
332
- </template>
333
- <template v-else>
334
- <component
335
- :is="subWidget.type + '-widget'"
336
- :field="subWidget"
337
- :designer="null"
338
- :key="swIdx"
339
- :parent-list="widget.lineButtons"
340
- :index-of-parent-list="swIdx"
341
- :parent-widget="widget"
342
- :subFormRowIndex="rowIndex"
343
- :tableParam="{
344
- rowIndex: rowIndex,
345
- row: row,
346
- items: fieldModel,
347
- }"
348
- >
349
- <!-- 递归传递插槽!!! -->
350
- <template
351
- v-for="slot in Object.keys($scopedSlots)"
352
- v-slot:[slot]="scope"
353
- >
354
- <slot :name="slot" v-bind="scope" />
355
- </template>
356
- </component>
357
- </template>
358
- </template>
359
- </template>
360
- </div>
361
- </template>
362
-
363
- <!-- <div class="t1">
364
- <b>订单号:21533666</b>
365
- <div class="status">未审核</div>
366
- </div>
367
- <div class="t2">
368
- <p>产地:广东佛山</p>
369
- <p>产地:广东佛山</p>
370
- <p>产地:广东佛山</p>
371
- </div>-->
372
- </div>
373
- </div>
374
- <div class="vxe-grid" v-if="widget.options.isQueryTable">
375
- <div class="vxe-grid&#45;&#45;pager-wrapper">
376
- <vxe-pager
377
- class="pages-box"
378
- :current-page.sync="page.current"
379
- :page-size.sync="page.size"
380
- :total="page.total"
381
- :layouts="['PrevPage', 'Number', 'NextPage']"
382
- @page-change="changePageNew"
383
- >
384
- <template #right>
385
- <span>
386
- <span>当前记录</span>
387
- <span class="f-red"> {{ page.records.length }} </span>
388
- <span>/</span>
389
- <span class="f-red"> {{ page.total }}</span>
390
- </span>
391
- </template>
392
- </vxe-pager>
393
- </div>
394
- </div>
395
-
396
- <advancedSearchDialog
397
- v-if="showAdvancedSearch"
398
- :visiable.sync="showAdvancedSearch"
399
- class="adSearchForm_all"
400
- :formData="advancedFormData"
401
- @confirm="confirmAdvancedSearchDialog"
402
- @clear="advancedClear"
403
- >
404
- <template #form>
405
- <vxe-form
406
- :model="formModel"
407
- title-width="102px"
408
- :inline="true"
409
- class="adSearchForm"
410
- >
411
- <template v-for="(searchColumn, index) in vxeOption.searchColumns">
412
- <vxe-form-item>
413
- <component
414
- :is="getColumnWidgetName(searchColumn.widget)"
415
- :field="searchColumn.widget"
416
- :form-model="globalModel.formModel"
417
- :designer="null"
418
- :key="index"
419
- :parent-widget="widget"
420
- ></component>
421
- </vxe-form-item>
422
- </template>
423
- </vxe-form>
424
- </template>
425
- </advancedSearchDialog>
426
- <el-dialog
427
- title="明细详情"
428
- :modal-append-to-body="false"
429
- :close-on-click-modal="false"
430
- :visible.sync="showRowDetailDialog"
431
- :modal="false"
432
- custom-class="dialog-style h5view-dialog"
433
- width="100%"
434
- top="0px"
435
- v-el-drag-dialog
436
- v-el-dialog-center
437
- :destroy-on-close="true"
438
- >
439
- <div class="cont" style="height: calc(100vh - 73px)">
440
- <div class="h5-list-box">
441
- <div
442
- v-for="(row, rowIndex) in [editRow]"
443
- :key="rowIndex"
444
- class="item"
445
- >
446
- <!-- <div class="del-btn"><i class="el-icon-delete"></i></div>-->
447
- <template v-if="vxeOption.columns.length > 0">
448
- <div class="t1" v-if="widget.options.isQueryTable">
449
- <template
450
- v-for="(column, columnIndex) in vxeOption.columns.filter(
451
- (item, index) => item.isMainFiled
452
- )"
453
- >
454
- <b>{{ column.title }}:</b>
455
- <span>
456
- <template v-if="!column.params.formatS">
457
- {{ row[column.field] }}
458
- </template>
459
- <template v-else-if="column.params.formatS == 'render'">
460
- {{
461
- column.slots.default({
462
- column: column,
463
- rowIndex: rowIndex,
464
- row: row,
465
- items: fieldModel,
466
- })
467
- }}
468
- </template>
469
- <template
470
- v-else-if="
471
- column.slots && column.slots.default == 'widget'
472
- "
473
- >
474
- <component
475
- :is="getColumnWidgetName(column.params.widget)"
476
- :field="column.params.widget"
477
- :form-model="globalModel.formModel"
478
- :designer="null"
479
- :key="rowIndex"
480
- :parent-widget="widget"
481
- :columnConfig="column.params.columnConfig"
482
- :subFormRowIndex="rowIndex"
483
- :formItemProp="
484
- getColumnProp(widget, {
485
- column: column,
486
- rowIndex: rowIndex,
487
- row: row,
488
- items: fieldModel,
489
- })
490
- "
491
- :tableParam="{
492
- column: column,
493
- rowIndex: rowIndex,
494
- row: row,
495
- items: fieldModel,
496
- }"
497
- ></component>
498
- </template>
499
- <template v-else-if="column.params.formatS == 'editDelete'">
500
- <a
501
- href="javascript:void(0);"
502
- class="a-link"
503
- @click.stop="deleteRow(row, rowIndex)"
504
- >
505
- <el-tooltip
506
- :enterable="false"
507
- effect="dark"
508
- content="删除"
509
- placement="top"
510
- popper-class="tooltip-skin"
511
- >
512
- <i class="el-icon-delete" />
513
- </el-tooltip>
514
- </a>
515
- </template>
516
- <template v-else-if="column.params.formatS == 'editButton'">
517
- <a
518
- href="javascript:void(0);"
519
- class="a-link"
520
- @click.stop="openEditDialog(obj.row)"
521
- >
522
- <el-tooltip
523
- :enterable="false"
524
- effect="dark"
525
- content="查看"
526
- placement="top"
527
- popper-class="tooltip-skin"
528
- >
529
- <i class="el-icon-edit" />
530
- </el-tooltip>
531
- </a>
532
- </template>
533
- <template v-else>
534
- {{
535
- column.formatter({
536
- cellValue: row[column.field],
537
- column: column,
538
- rowIndex: rowIndex,
539
- row: row,
540
- items: fieldModel,
541
- })
542
- }}
543
- </template>
544
- </span>
545
- <!-- <div class="status">未审核</div>-->
546
- </template>
547
- </div>
548
- <div class="t2">
549
- <template
550
- v-if="
551
- !widget.options.isQueryTable || vxeOption.columns.length > 1
552
- "
553
- >
554
- <template v-for="(column, columnIndex) in vxeOption.columns">
555
- <template
556
- v-if="!widget.options.isQueryTable || !column.isMainFiled"
557
- >
558
- <dl>
559
- <div>
560
- <dt>{{ column.title }}:</dt>
561
- <dd>
562
- <template v-if="!column.params.formatS">
563
- {{ row[column.field] }}
564
- </template>
565
- <template
566
- v-else-if="column.params.formatS == 'render'"
567
- >
568
- {{
569
- column.slots.default({
570
- column: column,
571
- rowIndex: rowIndex,
572
- row: row,
573
- items: fieldModel,
574
- })
575
- }}
576
- </template>
577
-
578
- <template
579
- v-else-if="
580
- column.slots && column.slots.default == 'widget'
581
- "
582
- >
583
- <component
584
- :is="getColumnWidgetName(column.params.widget)"
585
- :field="column.params.widget"
586
- :form-model="globalModel.formModel"
587
- :designer="null"
588
- :key="rowIndex + '-' + columnIndex"
589
- :parent-widget="widget"
590
- :columnConfig="column.params.columnConfig"
591
- :subFormRowIndex="rowIndex"
592
- :formItemProp="
593
- getColumnProp(widget, {
594
- column: column,
595
- rowIndex: rowIndex,
596
- row: row,
597
- items: fieldModel,
598
- })
599
- "
600
- :tableParam="{
601
- column: column,
602
- rowIndex: rowIndex,
603
- row: row,
604
- items: fieldModel,
605
- }"
606
- ></component>
607
- </template>
608
- <template
609
- v-else-if="column.params.formatS == 'editDelete'"
610
- >
611
- <a
612
- href="javascript:void(0);"
613
- class="a-link"
614
- @click="deleteRow(row, rowIndex)"
615
- >
616
- <el-tooltip
617
- :enterable="false"
618
- effect="dark"
619
- content="删除"
620
- placement="top"
621
- popper-class="tooltip-skin"
622
- >
623
- <i class="el-icon-delete" />
624
- </el-tooltip>
625
- </a>
626
- </template>
627
- <template
628
- v-else-if="column.params.formatS == 'editButton'"
629
- >
630
- <a
631
- href="javascript:void(0);"
632
- class="a-link"
633
- @click="openEditDialog(obj.row)"
634
- >
635
- <el-tooltip
636
- :enterable="false"
637
- effect="dark"
638
- content="查看"
639
- placement="top"
640
- popper-class="tooltip-skin"
641
- >
642
- <i class="el-icon-edit" />
643
- </el-tooltip>
644
- </a>
645
- </template>
646
- <template v-else>
647
- {{
648
- column.formatter({
649
- cellValue: row[column.field],
650
- column: column,
651
- rowIndex: rowIndex,
652
- row: row,
653
- items: fieldModel,
654
- })
655
- }}
656
- </template>
657
- </dd>
658
- </div>
659
- </dl>
660
- </template>
661
- </template>
662
- </template>
663
- </div>
664
- <div class="btns">
665
- <template
666
- v-if="!!widget.lineButtons && widget.lineButtons.length > 0"
667
- >
668
- <template v-for="(subWidget, swIdx) in widget.lineButtons">
669
- <template v-if="'container' === subWidget.category">
670
- <component
671
- :is="subWidget.type + '-item'"
672
- :widget="subWidget"
673
- :key="swIdx"
674
- :parent-list="widget.lineButtons"
675
- :index-of-parent-list="swIdx"
676
- :parent-widget="widget"
677
- :subFormRowIndex="rowIndex"
678
- :tableParam="{
679
- rowIndex: rowIndex,
680
- row: row,
681
- items: fieldModel,
682
- }"
683
- >
684
- <!-- 递归传递插槽!!! -->
685
- <template
686
- v-for="slot in Object.keys($scopedSlots)"
687
- v-slot:[slot]="scope"
688
- >
689
- <slot :name="slot" v-bind="scope" />
690
- </template>
691
- </component>
692
- </template>
693
- <template v-else>
694
- <component
695
- :is="subWidget.type + '-widget'"
696
- :field="subWidget"
697
- :designer="null"
698
- :key="swIdx"
699
- :parent-list="widget.lineButtons"
700
- :index-of-parent-list="swIdx"
701
- :parent-widget="widget"
702
- :subFormRowIndex="rowIndex"
703
- :tableParam="{
704
- rowIndex: rowIndex,
705
- row: row,
706
- items: fieldModel,
707
- }"
708
- >
709
- <!-- 递归传递插槽!!! -->
710
- <template
711
- v-for="slot in Object.keys($scopedSlots)"
712
- v-slot:[slot]="scope"
713
- >
714
- <slot :name="slot" v-bind="scope" />
715
- </template>
716
- </component>
717
- </template>
718
- </template>
719
- </template>
720
- </div>
721
- </template>
722
-
723
- <!-- <div class="t1">
724
- <b>订单号:21533666</b>
725
- <div class="status">未审核</div>
726
- </div>
727
- <div class="t2">
728
- <p>产地:广东佛山</p>
729
- <p>产地:广东佛山</p>
730
- <p>产地:广东佛山</p>
731
- </div>-->
732
- </div>
733
- </div>
734
- </div>
735
- </el-dialog>
736
- </container-item-wrapper>
737
- </template>
738
-
739
- <script>
740
- import emitter from "../../../../components/xform/utils/emitter";
741
- import i18n from "../../../../components/xform/utils/i18n";
742
- import refMixin from "../../../../components/xform/form-render/refMixin";
743
- import containerItemMixin from "./containerItemMixin";
744
- import FieldComponents from "../../../../components/xform/form-designer/form-widget/field-widget/index";
745
- import {
746
- assembleAxiosConfig,
747
- generateId,
748
- getReportGlobalMap,
749
- isVabsearchMultiWidget,
750
- } from "../../../../components/xform/utils/util";
751
- import * as formatUtil from "../../../../components/xform/utils/format";
752
- import {
753
- buildTextMaskContext,
754
- markMaskedExportColumns,
755
- } from "../../../../components/xform/utils/textMaskUtil";
756
- import { extendDeeply } from "../../../../utils/index.js";
757
- import { mergeQueryParam } from "../../../../components/xform/utils/queryParamUtil";
758
- import render from "../../../../views/user/bill_setting/render.vue";
759
-
760
- const baseRefUtil = {
761
- emitter,
762
- i18n,
763
- refMixin,
764
- containerItemMixin,
765
- formatUtil,
766
- assembleAxiosConfig,
767
- getReportGlobalMap,
768
- };
769
-
770
- const defaultPageSize = 2;
771
- export default {
772
- name: "list-h5-item",
773
- components: {
774
- ...FieldComponents,
775
- },
776
- mixins: [emitter, i18n, refMixin, containerItemMixin],
777
- componentName: "ContainerItem",
778
- props: {
779
- widget: Object,
780
- parentWidget: Object,
781
- parentList: Array,
782
- indexOfParentList: Number,
783
- subFormRowIndex: {
784
- type: Number,
785
- default: -1,
786
- },
787
- subFormColIndex: {
788
- type: Number,
789
- default: -1,
790
- },
791
- subFormRowId: {
792
- type: String,
793
- default: "",
794
- },
795
- },
796
- inject: [
797
- "refList",
798
- "sfRefList",
799
- "globalModel",
800
- "getFormConfig",
801
- "getGlobalDsv",
802
- ],
803
- data: function () {
804
- let that = this;
805
- let pageSize = defaultPageSize;
806
- return {
807
- showAdvancedSearch: false,
808
- showRowDetailDialog: false,
809
- editRow: {},
810
- fieldModel: [],
811
- selectedIndices: [],
812
- /*pageSize: this.widget.options.pagination.pageSize,
813
- pageSizes: this.widget.options.pagination.pageSizes,
814
- currentPage: this.widget.options.pagination.currentPage,
815
- total: this.widget.options.pagination.total,*/
816
- formData: {
817
- saleOrgName: "",
818
- loginAccount: "",
819
- mobile: "",
820
- enabled: 1,
821
- },
822
- vxeOption: { columns: [] },
823
- requestAccess: null,
824
- columnFormatMap: {
825
- editInput: "input",
826
- editNumber: "number",
827
- editDate: "date",
828
- editSelect: "select",
829
- editSearch: "vabsearch",
830
- button: "button",
831
- },
832
- dataTableConfig: {},
833
- advancedFormData: {},
834
-
835
- pageSize: pageSize,
836
- page: {
837
- current: 1,
838
- size: pageSize,
839
- total: 0,
840
- records: [],
841
- },
842
- keyword: null,
843
-
844
- checkItemIds: [],
845
- };
846
- },
847
- watch: {
848
- fieldModel(val) {
849
- this.formModel[this.fieldKeyName] = val || [];
850
- },
851
- },
852
- computed: {
853
- formConfig: function () {
854
- return this.getFormConfig();
855
- },
856
- paginationLayout: function () {
857
- return this.widget.options.smallPagination
858
- ? "prev, pager, next"
859
- : "total, sizes, prev, pager, next, jumper";
860
- },
861
- customClass: function () {
862
- return this.widget.options.customClass || "";
863
- },
864
- singleRowSelectFlag: function () {
865
- return !this.widget.options.showCheckBox;
866
- },
867
- buttonsColumnFixed: function () {
868
- return void 0 === this.widget.options.buttonsColumnFixed
869
- ? "right"
870
- : !!this.widget.options.buttonsColumnFixed &&
871
- this.widget.options.buttonsColumnFixed;
872
- },
873
- columns() {
874
- let tableColumns = this.widget.options.tableColumns;
875
- let newColumns = [];
876
- /*newColumns.push({
877
- type: 'checkbox',
878
- width: 48,
879
- resizable: false,
880
- fixed: 'left'
881
- });*/
882
-
883
- let firstColumn = tableColumns.find((column) => {
884
- return !!column.prop && !!column.showForRow;
885
- });
886
- let mainFiled = firstColumn?.prop;
887
-
888
- let formRef = this.getFormRef();
889
- let dateConfig = this.$baseLodash.cloneDeep(
890
- formRef.getFieldWidgetByType("date").options
891
- );
892
- tableColumns.forEach((t) => {
893
- let columnOption;
894
- let widget;
895
- let columnWidgetConfig = this.getColumnWidgetConfig(t);
896
- let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
897
- if (columnSelectedWidget) {
898
- widget = columnSelectedWidget;
899
- columnOption = widget.options;
900
- } else {
901
- columnOption = {};
902
- }
903
-
904
- let col = {
905
- fixed: !!t.fixed && t.fixed,
906
- field: t.prop,
907
- title: t.label,
908
- witdh: t.width,
909
- sortable: t.sortable,
910
- align: t.align ? t.align : "center",
911
- formatter: this.formatterValue,
912
- isMainFiled: mainFiled == t.prop,
913
- showForRow: t.showForRow,
914
- params: {
915
- ...columnOption,
916
- widget: widget,
917
- formatS: t.formatS,
918
- required: t.required || false,
919
- columnConfig: t,
920
- utcTransformEnabled: widget
921
- ? !!columnOption.utcTransformEnabled
922
- : !t.formatS ||
923
- [
924
- "d1",
925
- "d2",
926
- "d3",
927
- "d4",
928
- "d5",
929
- "render",
930
- "create_date",
931
- "modify_date",
932
- ].includes(t.formatS)
933
- ? !!t.utcTransformEnabled
934
- : false,
935
- },
936
- visible: t.show,
937
- };
938
-
939
- if (t.formatS == "render") {
940
- let r = t.render ? new Function("params", "h", t.render) : null;
941
- col.slots = {
942
- default: (params, h) => {
943
- return r ? r.call(this, params, h) : "";
944
- },
945
- };
946
- } else if (columnSelectedWidget) {
947
- col.slots = {
948
- default: "widget",
949
- };
950
- } else if (["editDelete", "editButton"].includes(t.formatS)) {
951
- col.slots = {
952
- default: t.formatS,
953
- };
954
- }
955
-
956
- newColumns.push(col);
957
- });
958
-
959
- /*if (baseRefUtil.tableConfig && baseRefUtil.tableConfig.className == "list-table") {
960
- if (tableColumns.length) {
961
- let tableColumn = [tableColumns.length - 1];
962
- if (tableColumn.fixed != "right") {
963
- newColumns.push({
964
- width: 47,
965
- title: '',
966
- fixed: 'right',
967
- sortable: false,
968
- });
969
- }
970
- }
971
- }*/
972
- return newColumns;
973
- },
974
- formModel: {
975
- cache: !1,
976
- get: function () {
977
- return this.globalModel.formModel;
978
- },
979
- },
980
- formDataId() {
981
- let formRef = this.getFormRef();
982
- return formRef.dataId;
983
- },
984
- },
985
- created: function () {
986
- if (!this.formModel[this.fieldKeyName])
987
- this.formModel[this.fieldKeyName] = [];
988
- this.initRefList();
989
- this.handleOnCreated();
990
- },
991
- mounted: async function () {
992
- this.handleOnMounted();
993
- this.initTableList();
994
- },
995
- beforeDestroy: function () {
996
- this.unregisterFromRefList();
997
- },
998
- methods: {
999
- openAdvancedSearchDialog() {
1000
- /*let formData = this.formModel;
1001
- let advancedFormData = {};
1002
- this.vxeOption.searchColumns.forEach(form1Field => {
1003
- let value = formData[form1Field.field];
1004
- if (value !== null && value !== undefined) {
1005
- advancedFormData[form1Field.field] = value
1006
- } else {
1007
- advancedFormData[form1Field.field] = null
1008
- }
1009
- });
1010
- this.advancedFormData = advancedFormData;*/
1011
- this.showAdvancedSearch = true;
1012
- },
1013
- confirmAdvancedSearchDialog() {
1014
- let formModel = this.formModel;
1015
- let advancedFormData = this.advancedFormData;
1016
- this.vxeOption.searchColumns.forEach((form1Field) => {
1017
- let value = formModel[form1Field.field];
1018
- if (value !== null && value !== undefined) {
1019
- advancedFormData[form1Field.field] = value;
1020
- } else {
1021
- advancedFormData[form1Field.field] = null;
1022
- }
1023
- });
1024
- this.searchEvent();
1025
- },
1026
- advancedClear() {
1027
- this.vxeOption.searchColumns.forEach((form1Field) => {
1028
- let widgetRef = this.getWidgetRef(form1Field.widget.options.name);
1029
- if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
1030
- });
1031
- },
1032
- setValue(val) {
1033
- let rows = val || [];
1034
- this.formModel[this.fieldKeyName] = rows;
1035
- this.fieldModel = rows;
1036
- },
1037
- getValue() {
1038
- return this.formModel[this.fieldKeyName];
1039
- },
1040
- getFieldKeyName(widget) {
1041
- let o = widget.options.name;
1042
- return (widget.options.keyNameEnabled && widget.options.keyName) || o;
1043
- },
1044
- formatterValue: function ({ cellValue, row, column }) {
1045
- if (cellValue === null || cellValue === undefined) return cellValue;
1046
- if (!column.params) return cellValue;
1047
-
1048
- let value = cellValue;
1049
- const formatS = column.params.formatS;
1050
- const dateFormats = [
1051
- "d1",
1052
- "d2",
1053
- "d3",
1054
- "d4",
1055
- "d5",
1056
- "render",
1057
- "create_date",
1058
- "modify_date",
1059
- ];
1060
- const isColumnLevelUtc =
1061
- !formatS || dateFormats.includes(formatS);
1062
- const utcTransformEnabled = isColumnLevelUtc
1063
- ? !!(
1064
- column.params.utcTransformEnabled ||
1065
- column.params.columnConfig?.utcTransformEnabled
1066
- )
1067
- : false;
1068
-
1069
- if (utcTransformEnabled && value != null && value !== "") {
1070
- value = this.$utcToLocal(value);
1071
- }
1072
-
1073
- if (!formatS) {
1074
- return value;
1075
- }
1076
-
1077
- switch (formatS) {
1078
- case "d1":
1079
- return baseRefUtil.formatUtil.formatDate1(value);
1080
- case "d2":
1081
- return baseRefUtil.formatUtil.formatDate2(value);
1082
- case "d3":
1083
- return baseRefUtil.formatUtil.formatDate3(value);
1084
- case "d4":
1085
- return baseRefUtil.formatUtil.formatDate4(value);
1086
- case "d5":
1087
- return baseRefUtil.formatUtil.formatDate4(value);
1088
- case "n1":
1089
- return baseRefUtil.formatUtil.formatNumber1(value);
1090
- case "n2":
1091
- return baseRefUtil.formatUtil.formatNumber2(value);
1092
- case "n3":
1093
- return baseRefUtil.formatUtil.formatNumber3(value);
1094
- case "n4":
1095
- return baseRefUtil.formatUtil.formatNumber4(value);
1096
- case "n5":
1097
- return baseRefUtil.formatUtil.formatNumber5(value);
1098
- case "n6":
1099
- return baseRefUtil.formatUtil.formatNumber6(value);
1100
- case "n7":
1101
- return baseRefUtil.formatUtil.formatNumber7(value);
1102
- }
1103
- return value;
1104
- },
1105
- searchEvent() {
1106
- // this.getGridTable().commitProxy('reload');
1107
- this.loadAccessData();
1108
- },
1109
- async resetEvent() {
1110
- let formData = this.formModel;
1111
- this.keyword = null;
1112
- this.widget.widgetList &&
1113
- this.widget.widgetList.forEach((subWidget) => {
1114
- let widgetRef = this.getWidgetRef(subWidget.options.name);
1115
- let fieldKeyName = this.getFieldKeyName(subWidget);
1116
- formData[fieldKeyName] = null;
1117
- this.advancedFormData[fieldKeyName] = null;
1118
- if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
1119
- });
1120
- // this.getGridTable().commitProxy('reload');
1121
- this.loadAccessData();
1122
- },
1123
- openEditDialog(row) {
1124
- let formRef = this.getFormRef();
1125
- let parentTarget = formRef.$attrs["parent-target"];
1126
- parentTarget &&
1127
- parentTarget.$attrs.openEditDialog &&
1128
- parentTarget.$attrs.openEditDialog(row);
1129
- },
1130
- initTableList() {
1131
- let that = this;
1132
- let path = null;
1133
- let paramFun = null;
1134
- let tableRef = this.getTableRef();
1135
- let isQueryTable = this.widget.options.isQueryTable || false;
1136
- let isDataPage = this.widget.options.accessReturnType === "2";
1137
- let isQueryAllPage = !this.widget.options.isNotQueryAllPage;
1138
- let searchColumns = null;
1139
- if (isQueryTable) {
1140
- path = "#";
1141
- paramFun = () => {
1142
- let conditions = this.getSearchCondition();
1143
- if (this.widget.options.showPagination) {
1144
- let searchCount = true;
1145
- if (isQueryAllPage === false) {
1146
- searchCount = false;
1147
- }
1148
- conditions.current = this.page.current;
1149
- conditions.size = this.page.size;
1150
- conditions.searchCount = searchCount;
1151
- }
1152
- return conditions;
1153
- };
1154
-
1155
- searchColumns = [];
1156
- let widgetList = this.widget.widgetList;
1157
- let typeMap = {
1158
- input: "input",
1159
- number: "number",
1160
- inputBatch: "inputBatch",
1161
- date: "date",
1162
- };
1163
-
1164
- widgetList.forEach((widget) => {
1165
- if ("container" !== widget.category) {
1166
- let options = widget.options;
1167
- let type = typeMap[widget.type] || null;
1168
- searchColumns.push({
1169
- title: options.label,
1170
- field: this.getFieldKeyName(widget),
1171
- type: type,
1172
- common: true,
1173
- disabled: options.disabled,
1174
- defaultValueEnabled: !!type,
1175
- slot: options.name,
1176
- widget: widget,
1177
- formItem: false,
1178
- });
1179
- }
1180
- });
1181
- }
1182
-
1183
- let formRef = this.getFormRef();
1184
- let dataTableConfig = formRef.$attrs.dataTableOption || {};
1185
- this.dataTableConfig = dataTableConfig;
1186
-
1187
- let tableOption = {
1188
- vue: this,
1189
- tableRef: tableRef,
1190
- tableName: this.widget.options.name,
1191
- param: paramFun,
1192
- columns: this.columns,
1193
- searchColumns: searchColumns,
1194
- vform: true,
1195
- config: {
1196
- height: isQueryTable ? "550px" : this.widget.options.tableHeight,
1197
- /*pagerConfig: {
1198
- autoHidden: !this.widget.options.showPagination
1199
- },*/
1200
- ...dataTableConfig.config,
1201
- },
1202
- exportAjax: (param) => {
1203
- let $grid = this.getGridTable();
1204
- let pageSize = param.size;
1205
- let currentPage = param.current;
1206
- let page = { pageSize, currentPage };
1207
- return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
1208
- page,
1209
- param,
1210
- });
1211
- },
1212
- };
1213
-
1214
- if (isQueryTable) {
1215
- tableOption.path = path;
1216
- tableOption.config.proxyConfig = {
1217
- props: {
1218
- result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
1219
- total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
1220
- },
1221
- ajax: {
1222
- // 接收 Promise 对象
1223
- query: ({ page, sorts, filters, form, param }) => {
1224
- let scriptCode = this.getScriptCode();
1225
- let formData = tableOption.param ? tableOption.param() || {} : {};
1226
- const queryParams = Object.assign({}, formData);
1227
-
1228
- if (filters) {
1229
- filters.forEach(({ property, values }) => {
1230
- queryParams[property] = values.join(",");
1231
- });
1232
- }
1233
-
1234
- if (page.pageSize !== undefined) {
1235
- queryParams.size = page.pageSize;
1236
- queryParams.current = page.currentPage;
1237
- }
1238
-
1239
- queryParams.searchCount = isQueryAllPage !== false;
1240
- Object.assign(queryParams, param);
1241
-
1242
- // 与 PC 链路同规则:condition 追加合并,其余键平铺覆盖
1243
- if (that.dataTableConfig.queryParam) {
1244
- mergeQueryParam(queryParams, that.dataTableConfig.queryParam);
1245
- }
1246
-
1247
- return new Promise((resolve, reject) => {
1248
- let reqData = {
1249
- ...queryParams,
1250
- };
1251
- if (scriptCode) {
1252
- let done = (res) => {
1253
- resolve(res);
1254
- if (res.type === "success") {
1255
- let rows = res.objx
1256
- ? res.objx.records || res.objx || []
1257
- : [];
1258
- this.setValue(rows);
1259
- if (res.objx && res.objx.records !== undefined) {
1260
- this.page = {
1261
- current: res.objx.current ?? this.page.current,
1262
- size: res.objx.size ?? this.page.size,
1263
- total: res.objx.total ?? 0,
1264
- records: rows,
1265
- };
1266
- }
1267
- that.$nextTick(() => {
1268
- setTimeout(function () {
1269
- dataTableConfig.callback &&
1270
- dataTableConfig.callback(rows);
1271
- tableOption.callback && tableOption.callback(rows);
1272
- that.handleCustomEvent(
1273
- that.widget.options.formScriptCallback,
1274
- ["rows"],
1275
- [rows]
1276
- );
1277
- }, 0);
1278
- });
1279
- } else {
1280
- this.page = {
1281
- current: 1,
1282
- size: this.pageSize,
1283
- total: 0,
1284
- records: [],
1285
- };
1286
- this.setValue([]);
1287
- }
1288
- };
1289
- this.loadDefaultQueryList(reqData, done).catch((error) => {
1290
- reject(error);
1291
- });
1292
- } else {
1293
- resolve();
1294
- }
1295
- });
1296
- },
1297
- },
1298
- };
1299
- tableOption.callback = (rows) => {
1300
- // this.fieldModel = rows;
1301
- this.formModel[this.fieldKeyName] = rows;
1302
- };
1303
- }
1304
- this.vxeOption = tableOption;
1305
- this.loadAccessData();
1306
-
1307
- /*this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
1308
- this.vxeOption = opts;
1309
- /!*if (!isQueryTable) {
1310
- this.$nextTick(() => {
1311
- this.loadAccessData();
1312
- });
1313
- }*!/
1314
- });
1315
- if (!isQueryTable) {
1316
- this.loadAccessData();
1317
- }*/
1318
- },
1319
- getTableCondition() {
1320
- if (this.widget.options.tableCondition) {
1321
- let e = new Function(this.widget.options.tableCondition);
1322
- return e.call(this);
1323
- }
1324
- },
1325
- getSearchCondition() {
1326
- // let extraAccessData = this.extraAccessData || {};
1327
- let searchFormData = this.getSearchFormData();
1328
- let conditions = {
1329
- // ...this.getTableCondition(),
1330
- ...searchFormData,
1331
- // ...this.advancedFormData,
1332
- // ...extraAccessData,
1333
- };
1334
- if (this.keyword) {
1335
- conditions.keyword = this.keyword;
1336
- }
1337
- return conditions;
1338
- },
1339
- getSearchFormData() {
1340
- let map = { condition: [] };
1341
- let formData = this.globalModel.formModel;
1342
- let widgetList = this.widget.widgetList;
1343
- if (!!widgetList && widgetList.length > 0) {
1344
- let loop = (wItem) => {
1345
- if (wItem.category === "container") {
1346
- loop(wItem);
1347
- } else {
1348
- let formField = this.getFieldKeyName(wItem);
1349
- let vaule = formData[formField];
1350
- if (vaule !== null && vaule !== undefined && vaule !== "") {
1351
- if (!Array.isArray(vaule) || vaule.length > 0) {
1352
- let item = {
1353
- value: vaule,
1354
- field: formField,
1355
- filter: null,
1356
- };
1357
- let wType = wItem.type;
1358
- if (["date-range", "time-range"].includes(wType)) {
1359
- item.filter = "between";
1360
- } else if (
1361
- ["input-batch", "checkbox"].includes(wType) ||
1362
- (wType === "select" && wItem.options.multiple)
1363
- ) {
1364
- item.filter = "in";
1365
- } else if (
1366
- ["radio", "time", "date"].includes(wType) ||
1367
- (wType === "select" && !wItem.options.multiple)
1368
- ) {
1369
- item.filter = "eq";
1370
- } else {
1371
- item.filter = "like";
1372
- }
1373
- map.condition.push(item);
1374
- }
1375
- }
1376
- }
1377
- };
1378
- widgetList.forEach((wItem) => {
1379
- loop(wItem);
1380
- });
1381
- }
1382
- return map;
1383
- },
1384
- loadTableData(param) {
1385
- if (this.dataTableConfig?.queryFormDialog !== true) {
1386
- this.checkItemIds = [];
1387
- }
1388
- param = param || {};
1389
- let pageSize = param.size || this.pageSize;
1390
- let currentPage = param.current || 1;
1391
- let page = { pageSize, currentPage };
1392
- return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
1393
- page,
1394
- param,
1395
- });
1396
- },
1397
- loadAccessData() {
1398
- let isQueryTable = this.widget.options.isQueryTable || false;
1399
- if (isQueryTable) {
1400
- this.loadTableData({});
1401
- return;
1402
- }
1403
- if (!isQueryTable && !this.formDataId) return;
1404
-
1405
- let scriptCode = this.getScriptCode();
1406
- if (scriptCode) {
1407
- this.loadDefaultViewList();
1408
- }
1409
- },
1410
- getAccessParam() {
1411
- if (!this.widget.options.formScriptParam) return;
1412
- return this.handleCustomEvent(this.widget.options.formScriptParam);
1413
- },
1414
- getScriptCode() {
1415
- let accessReturnType = this.widget.options.accessReturnType;
1416
- let defaultScriptCode = "getList";
1417
- if (accessReturnType === "1") {
1418
- defaultScriptCode = "getList";
1419
- } else if (accessReturnType === "2") {
1420
- defaultScriptCode = "getPage";
1421
- }
1422
- return this.widget.options.formScriptCode || defaultScriptCode;
1423
- },
1424
- getAttachmentType() {
1425
- let result = [];
1426
- let tableColumns = this.widget.options.tableColumns || [];
1427
- tableColumns.forEach((item) => {
1428
- if (item.prop && item.label && item.formatS === "editAttachment") {
1429
- result.push(item.prop);
1430
- }
1431
- });
1432
- return result;
1433
- },
1434
- getHttpConfigForUser() {
1435
- return {
1436
- addCreateInfo: true,
1437
- queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
1438
- };
1439
- },
1440
- /**
1441
- * 构造表单脚本请求的 data 参数(通用)。
1442
- * 勾选"请求去掉data层"(removeDataLevel)时,内层参数平铺到外层,不再包一层 data。
1443
- */
1444
- buildFormScriptData(reportTemplate, innerData, taBm) {
1445
- let base = {
1446
- formCode: reportTemplate.formCode,
1447
- formVersion: reportTemplate.formVersion,
1448
- taBm: taBm || this.fieldKeyName,
1449
- };
1450
- return this.widget.options.removeDataLevel
1451
- ? { ...base, ...(innerData || {}) }
1452
- : { ...base, data: innerData || {} };
1453
- },
1454
- loadDefaultQueryList(reqData, done) {
1455
- let reportTemplate = this.getFormRef().reportTemplate;
1456
- let scriptCode = this.getScriptCode();
1457
- let accessParam = this.getAccessParam() || {};
1458
- let otherParam = {};
1459
- let attachmentType = this.getAttachmentType();
1460
- if (attachmentType.length) {
1461
- otherParam.attachmentType = attachmentType;
1462
- }
1463
- let defaultOption = this.getHttpConfigForUser();
1464
- let requestData = {
1465
- ...reqData,
1466
- ...otherParam,
1467
- };
1468
- requestData = extendDeeply(requestData, accessParam);
1469
- return this.formHttp({
1470
- scriptCode: scriptCode,
1471
- data: this.buildFormScriptData(reportTemplate, requestData),
1472
- isLoading: false,
1473
- ...defaultOption,
1474
- callback: (res) => {
1475
- done(res);
1476
- },
1477
- });
1478
- },
1479
- loadDefaultViewList() {
1480
- let dataId = this.formDataId;
1481
- let reportTemplate = this.getFormRef().reportTemplate;
1482
- let accessParam = this.getAccessParam() || {};
1483
- let otherParam = {};
1484
- let attachmentType = this.getAttachmentType();
1485
- if (attachmentType.length) {
1486
- otherParam.attachmentType = attachmentType;
1487
- }
1488
- let scriptCode = this.getScriptCode();
1489
- return this.formHttp({
1490
- scriptCode: scriptCode,
1491
- data: this.buildFormScriptData(reportTemplate, {
1492
- id: dataId,
1493
- ...otherParam,
1494
- ...accessParam,
1495
- }),
1496
- callback: (res) => {
1497
- let rows = res.objx ? res.objx.records || res.objx || [] : [];
1498
- this.setValue(rows);
1499
- this.handleCustomEvent(
1500
- this.widget.options.formScriptCallback,
1501
- ["rows"],
1502
- [rows]
1503
- );
1504
- },
1505
- });
1506
- },
1507
- getReqParam(item, dataId, billData) {
1508
- let param = {};
1509
- if (item.accessParam) {
1510
- if (typeof item.accessParam === "string") {
1511
- let n = new Function("billData", item.accessParam);
1512
- param = n.call(this, billData);
1513
- } else {
1514
- param = item.accessParam;
1515
- }
1516
- } else {
1517
- param = { id: dataId };
1518
- }
1519
- return param;
1520
- },
1521
- async deleteRow(row, rowIndex) {
1522
- this.fieldModel.splice(rowIndex, 1);
1523
- },
1524
- createNewTableData() {
1525
- let vailColumns = this.widget.options.tableColumns.filter(
1526
- (item) => item.prop && item.label
1527
- );
1528
- let newData = {};
1529
- vailColumns.forEach((item) => {
1530
- if (item.formatS == "editSearch") {
1531
- newData[item.prop] = null;
1532
- let vabSearchName = item?.columnOption?.vabSearchName;
1533
- if (vabSearchName) newData[vabSearchName] = null;
1534
- } else {
1535
- newData[item.prop] = null;
1536
- }
1537
- });
1538
- return newData;
1539
- },
1540
- addTableData(rows, field) {
1541
- let formDataModel = this.formModel;
1542
- let tableRows = this.fieldModel;
1543
- let fullData = this.fieldModel;
1544
- let items;
1545
- if (field) {
1546
- let keys = fullData.map((item) => {
1547
- return item[field] + "";
1548
- });
1549
- items = rows.filter((item) => {
1550
- let value = item[field] + "";
1551
- return !keys.includes(value);
1552
- });
1553
- } else {
1554
- items = rows;
1555
- }
1556
- if (items) {
1557
- if (items.length) {
1558
- items.forEach((row) => {
1559
- let newData = this.createNewTableData();
1560
- Object.assign(newData, row);
1561
-
1562
- tableRows.push(newData);
1563
- });
1564
- }
1565
- } else {
1566
- let newData = this.createNewTableData();
1567
- tableRows.push(newData);
1568
- }
1569
- // this.formModel[this.fieldKeyName] = this.$baseLodash(this.fieldModel)
1570
- // this.fieldModel = tableRows
1571
- // $grid.loadData(tableRows);
1572
- },
1573
- getColumnWidgetConfig(row) {
1574
- let formRef = this.getFormRef();
1575
- let formatS = row.formatS;
1576
- let columnSelectedWidget = null;
1577
- let columnEditFields = null;
1578
-
1579
- let type = this.columnFormatMap[row.formatS];
1580
-
1581
- if (type) {
1582
- columnSelectedWidget = this.$baseLodash.cloneDeep(
1583
- formRef.getFieldWidgetByType(type)
1584
- );
1585
- let tmpId = generateId();
1586
- let idVal = row.prop ? row.prop : type + tmpId;
1587
- columnSelectedWidget.id = idVal;
1588
- columnSelectedWidget.options.name = idVal;
1589
- if (row.columnOption && Object.keys(row.columnOption).length) {
1590
- row.columnOption.required = row.required || false;
1591
- columnSelectedWidget.options = row.columnOption;
1592
- } else {
1593
- columnSelectedWidget.options.required = row.required || false;
1594
- row.columnOption = columnSelectedWidget.options;
1595
- }
1596
- columnSelectedWidget.options.name = row.prop;
1597
- columnSelectedWidget.options.label = row.label;
1598
- columnSelectedWidget.options.labelHidden = true;
1599
- }
1600
- return { columnSelectedWidget, columnEditFields };
1601
- },
1602
- getColumnProp(widget, obj) {
1603
- let isQueryTable = this.widget.options.isQueryTable || false;
1604
- if (isQueryTable) {
1605
- return "false";
1606
- } else {
1607
- let propName =
1608
- this.getFieldKeyName(widget) +
1609
- "." +
1610
- obj.rowIndex +
1611
- "." +
1612
- obj.column.field;
1613
- if (
1614
- this.isVabsearchFlagWidget(widget) &&
1615
- !isVabsearchMultiWidget(widget)
1616
- ) {
1617
- let vabSearchName = obj.column.params.widget.options.vabSearchName;
1618
- propName =
1619
- this.getFieldKeyName(widget) +
1620
- "." +
1621
- obj.rowIndex +
1622
- "." +
1623
- vabSearchName;
1624
- }
1625
- return propName;
1626
- }
1627
- },
1628
- isVabsearchFlagWidget(widget) {
1629
- let type = widget?.type;
1630
- return (
1631
- type === "vabsearch" ||
1632
- type === "singerSearch" ||
1633
- type === "multiSearch"
1634
- );
1635
- },
1636
- getColumnWidgetName(e) {
1637
- if (e && e.type) {
1638
- return e.type + "-widget";
1639
- }
1640
- },
1641
- getGridTable() {
1642
- let $grid = this.$refs[this.getTableRef()];
1643
- return $grid;
1644
- },
1645
- getTableRef() {
1646
- let tableRef = this.widget.id;
1647
- return tableRef;
1648
- },
1649
- getUrl() {
1650
- let accessUrl = this.widget.options.accessUrl;
1651
- return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
1652
- },
1653
- openRowDetailDialog(row) {
1654
- /*let isQueryTable = this.widget.options.isQueryTable || false;
1655
- if(isQueryTable)return;*/
1656
- this.editRow = row;
1657
- this.showRowDetailDialog = true;
1658
- },
1659
- changePageNew({ type, currentPage, pageSize, $event }) {
1660
- this.loadTableData({
1661
- size: pageSize + "",
1662
- current: currentPage + "",
1663
- });
1664
- },
1665
- /** 导出前按脱敏规则剔除列,实现见 textMaskUtil.markMaskedExportColumns。 */
1666
- markMaskedColumnsForExport() {
1667
- markMaskedExportColumns(
1668
- this.getGridTable(),
1669
- buildTextMaskContext(this.getFormRef(), this.$store.getters.companyCode)
1670
- );
1671
- },
1672
- exportData(option) {
1673
- this.markMaskedColumnsForExport();
1674
- let tableRef = this.getTableRef();
1675
- let serverName = this.getFormRef().reportTemplate.serverName;
1676
- option.prefix = option.prefix || serverName;
1677
- this.$excelExport({ targetRef: tableRef, ...option });
1678
- },
1679
- itemCheck(row) {
1680
- let dataTableConfig = this.dataTableConfig;
1681
- if (dataTableConfig) {
1682
- let checkItemIds = this.checkItemIds;
1683
- let checked;
1684
- if (checkItemIds.includes(row.id)) {
1685
- checked = false;
1686
- checkItemIds.splice(checkItemIds.indexOf(row.id), 1);
1687
- } else {
1688
- checked = true;
1689
- checkItemIds.push(row.id);
1690
- }
1691
- let param = { row, checked };
1692
- dataTableConfig.onCheckboxChange &&
1693
- dataTableConfig.onCheckboxChange(param);
1694
- }
1695
- },
1696
- },
1697
- };
1698
- </script>
1699
-
1700
- <style lang="scss" scoped></style>
1
+ <template>
2
+ <container-item-wrapper
3
+ :widget="widget"
4
+ :class="widget.options.isFullscreen ? 'full-height' : ''"
5
+ >
6
+ <div class="h5-header">{{ widget.options.label }}</div>
7
+ <div class="h5-search-box">
8
+ <el-input v-model="keyword" placeholder="请选择" class="txt">
9
+ <i slot="suffix" class="el-input__icon el-icon-search"></i>
10
+ <el-button slot="append" class="btn" @click="searchEvent"
11
+ >搜索</el-button
12
+ >
13
+ </el-input>
14
+ <div class="icon-screen" @click="openAdvancedSearchDialog">
15
+ <i class="iconfont icon-chaxuntiaojianshezhi"></i>筛选
16
+ </div>
17
+ </div>
18
+ <div
19
+ v-if="widget.options.isQueryTable"
20
+ class="h5-fixed-top-btns"
21
+ title-width="92px"
22
+ title-align="right"
23
+ >
24
+ <el-form label-position="top">
25
+ <template v-if="!!widget.buttons && widget.buttons.length > 0">
26
+ <template v-for="(subWidget, swIdx) in widget.buttons">
27
+ <template v-if="'container' === subWidget.category">
28
+ <component
29
+ :is="subWidget.type + '-item'"
30
+ :widget="subWidget"
31
+ :key="swIdx"
32
+ :parent-list="widget.buttons"
33
+ :index-of-parent-list="swIdx"
34
+ :parent-widget="widget"
35
+ >
36
+ <!-- 递归传递插槽!!! -->
37
+ <template
38
+ v-for="slot in Object.keys($scopedSlots)"
39
+ v-slot:[slot]="scope"
40
+ >
41
+ <slot :name="slot" v-bind="scope" />
42
+ </template>
43
+ </component>
44
+ </template>
45
+ <template v-else>
46
+ <component
47
+ :is="subWidget.type + '-widget'"
48
+ :field="subWidget"
49
+ :designer="null"
50
+ :key="swIdx"
51
+ :parent-list="widget.buttons"
52
+ :index-of-parent-list="swIdx"
53
+ :parent-widget="widget"
54
+ >
55
+ <!-- 递归传递插槽!!! -->
56
+ <template
57
+ v-for="slot in Object.keys($scopedSlots)"
58
+ v-slot:[slot]="scope"
59
+ >
60
+ <slot :name="slot" v-bind="scope" />
61
+ </template>
62
+ </component>
63
+ </template>
64
+ </template>
65
+ </template>
66
+ </el-form>
67
+ </div>
68
+ <div class="h5-list-box">
69
+ <div
70
+ v-for="(row, rowIndex) in fieldModel"
71
+ :key="rowIndex"
72
+ class="item"
73
+ @click="onRowClick(row)"
74
+ :class="[
75
+ { checked: checkItemIds.includes(row.id) },
76
+ itemCardClass,
77
+ getRowCompareClass(row),
78
+ ]"
79
+ >
80
+ <!-- 右上角查看角标(对齐 bill_setting 的 .pro-item .t::after)。
81
+ 与 itemStyle 解绑:点整行进详情是明细行的统一行为,
82
+ 这个角标是它的视觉提示,不该藏在选项后面。
83
+ 查询选择场景点行是勾选、不进详情,故不显示。 -->
84
+ <i class="h5-item-arrow" v-if="!widget.options.isQueryTable"></i>
85
+ <!-- 明细行不放删除按钮:点击整行进详情即可。
86
+ 要恢复的话,除了放回这个 div,还得给它补流程判断
87
+ (有流程且当前节点不可编辑时要藏掉),它不是 widget,
88
+ 拿不到 hiddenByWf / widgetShowRule 那两套。 -->
89
+ <template v-if="vxeOption.columns.length > 0">
90
+ <div class="t1" v-if="widget.options.isQueryTable">
91
+ <template
92
+ v-for="(column, columnIndex) in vxeOption.columns.filter(
93
+ (item, index) => item.isMainFiled
94
+ )"
95
+ >
96
+ <b :key="'1-' + columnIndex">{{ column.title }}:</b>
97
+ <span :key="'2-' + columnIndex">
98
+ <template v-if="!column.params.formatS">
99
+ {{ row[column.field] }}
100
+ </template>
101
+ <template v-else-if="column.params.formatS == 'render'">
102
+ {{
103
+ column.slots.default({
104
+ column: column,
105
+ rowIndex: rowIndex,
106
+ row: row,
107
+ items: fieldModel,
108
+ })
109
+ }}
110
+ </template>
111
+ <template
112
+ v-else-if="column.slots && column.slots.default == 'widget'"
113
+ >
114
+ <component
115
+ :is="getColumnWidgetName(column.params.widget)"
116
+ :field="column.params.widget"
117
+ :form-model="globalModel.formModel"
118
+ :designer="null"
119
+ :key="rowIndex"
120
+ :parent-widget="widget"
121
+ :columnConfig="column.params.columnConfig"
122
+ :subFormRowIndex="rowIndex"
123
+ :formItemProp="
124
+ getColumnProp(widget, {
125
+ column: column,
126
+ rowIndex: rowIndex,
127
+ row: row,
128
+ items: fieldModel,
129
+ })
130
+ "
131
+ :tableParam="{
132
+ column: column,
133
+ rowIndex: rowIndex,
134
+ row: row,
135
+ items: fieldModel,
136
+ }"
137
+ ></component>
138
+ </template>
139
+ <template v-else-if="column.params.formatS == 'editDelete'">
140
+ <a
141
+ href="javascript:void(0);"
142
+ class="a-link"
143
+ @click="deleteRow(row, rowIndex)"
144
+ >
145
+ <el-tooltip
146
+ :enterable="false"
147
+ effect="dark"
148
+ content="删除"
149
+ placement="top"
150
+ popper-class="tooltip-skin"
151
+ >
152
+ <i class="el-icon-delete" />
153
+ </el-tooltip>
154
+ </a>
155
+ </template>
156
+ <template v-else-if="column.params.formatS == 'editButton'">
157
+ <a
158
+ href="javascript:void(0);"
159
+ class="a-link"
160
+ @click.stop="openEditDialog(obj.row)"
161
+ >
162
+ <el-tooltip
163
+ :enterable="false"
164
+ effect="dark"
165
+ content="查看"
166
+ placement="top"
167
+ popper-class="tooltip-skin"
168
+ >
169
+ <i class="el-icon-edit" />
170
+ </el-tooltip>
171
+ </a>
172
+ </template>
173
+ <template v-else>
174
+ {{
175
+ column.formatter({
176
+ cellValue: row[column.field],
177
+ column: column,
178
+ rowIndex: rowIndex,
179
+ row: row,
180
+ items: fieldModel,
181
+ })
182
+ }}
183
+ </template>
184
+ </span>
185
+ <!-- <div class="status">未审核</div>-->
186
+ </template>
187
+ </div>
188
+ <div class="t2">
189
+ <template
190
+ v-if="
191
+ !widget.options.isQueryTable || vxeOption.columns.length > 1
192
+ "
193
+ >
194
+ <template v-for="(column, columnIndex) in vxeOption.columns">
195
+ <template
196
+ v-if="
197
+ (!widget.options.isQueryTable || !column.isMainFiled) &&
198
+ column.showForRow
199
+ "
200
+ >
201
+ <dl :key="columnIndex">
202
+ <div>
203
+ <dt>{{ column.title }}:</dt>
204
+ <dd>
205
+ <template v-if="!column.params.formatS">
206
+ {{ row[column.field] }}
207
+ </template>
208
+ <template v-else-if="column.params.formatS == 'render'">
209
+ {{
210
+ column.slots.default({
211
+ column: column,
212
+ rowIndex: rowIndex,
213
+ row: row,
214
+ items: fieldModel,
215
+ })
216
+ }}
217
+ </template>
218
+
219
+ <!-- 明细行只出纯文本:编辑控件(widget)与操作链接
220
+ (editDelete/editButton)都不在行上渲染,点整行进详情,
221
+ 详情弹框里才是可编辑的控件。 -->
222
+ <template v-else>
223
+ {{ getColumnDisplayText(column, row, rowIndex) }}
224
+ </template>
225
+ </dd>
226
+ </div>
227
+ </dl>
228
+ </template>
229
+ </template>
230
+ </template>
231
+ </div>
232
+ <!-- 明细行不摆操作按钮区:点整行进详情。查询选择场景(isQueryTable)
233
+ 仍保留行按钮,那边点行是勾选、按钮另有用途。 -->
234
+ <div class="btns" v-if="widget.options.isQueryTable">
235
+ <template
236
+ v-if="!!widget.lineButtons && widget.lineButtons.length > 0"
237
+ >
238
+ <template v-for="(subWidget, swIdx) in widget.lineButtons">
239
+ <template v-if="'container' === subWidget.category">
240
+ <component
241
+ :is="subWidget.type + '-item'"
242
+ :widget="subWidget"
243
+ :key="swIdx"
244
+ :parent-list="widget.lineButtons"
245
+ :index-of-parent-list="swIdx"
246
+ :parent-widget="widget"
247
+ :subFormRowIndex="rowIndex"
248
+ :tableParam="{
249
+ rowIndex: rowIndex,
250
+ row: row,
251
+ items: fieldModel,
252
+ }"
253
+ >
254
+ <!-- 递归传递插槽!!! -->
255
+ <template
256
+ v-for="slot in Object.keys($scopedSlots)"
257
+ v-slot:[slot]="scope"
258
+ >
259
+ <slot :name="slot" v-bind="scope" />
260
+ </template>
261
+ </component>
262
+ </template>
263
+ <template v-else>
264
+ <component
265
+ :is="subWidget.type + '-widget'"
266
+ :field="subWidget"
267
+ :designer="null"
268
+ :key="swIdx"
269
+ :parent-list="widget.lineButtons"
270
+ :index-of-parent-list="swIdx"
271
+ :parent-widget="widget"
272
+ :subFormRowIndex="rowIndex"
273
+ :tableParam="{
274
+ rowIndex: rowIndex,
275
+ row: row,
276
+ items: fieldModel,
277
+ }"
278
+ >
279
+ <!-- 递归传递插槽!!! -->
280
+ <template
281
+ v-for="slot in Object.keys($scopedSlots)"
282
+ v-slot:[slot]="scope"
283
+ >
284
+ <slot :name="slot" v-bind="scope" />
285
+ </template>
286
+ </component>
287
+ </template>
288
+ </template>
289
+ </template>
290
+ </div>
291
+ </template>
292
+
293
+ <!-- <div class="t1">
294
+ <b>订单号:21533666</b>
295
+ <div class="status">未审核</div>
296
+ </div>
297
+ <div class="t2">
298
+ <p>产地:广东佛山</p>
299
+ <p>产地:广东佛山</p>
300
+ <p>产地:广东佛山</p>
301
+ </div>-->
302
+ </div>
303
+ </div>
304
+ <div class="vxe-grid" v-if="widget.options.isQueryTable">
305
+ <div class="vxe-grid&#45;&#45;pager-wrapper">
306
+ <vxe-pager
307
+ class="pages-box"
308
+ :current-page.sync="page.current"
309
+ :page-size.sync="page.size"
310
+ :total="page.total"
311
+ :layouts="['PrevPage', 'Number', 'NextPage']"
312
+ @page-change="changePageNew"
313
+ >
314
+ <template #right>
315
+ <span>
316
+ <span>当前记录</span>
317
+ <span class="f-red"> {{ page.records.length }} </span>
318
+ <span>/</span>
319
+ <span class="f-red"> {{ page.total }}</span>
320
+ </span>
321
+ </template>
322
+ </vxe-pager>
323
+ </div>
324
+ </div>
325
+
326
+ <advancedSearchDialog
327
+ v-if="showAdvancedSearch"
328
+ :visiable.sync="showAdvancedSearch"
329
+ class="adSearchForm_all"
330
+ :formData="advancedFormData"
331
+ @confirm="confirmAdvancedSearchDialog"
332
+ @clear="advancedClear"
333
+ >
334
+ <template #form>
335
+ <vxe-form
336
+ :model="formModel"
337
+ title-width="102px"
338
+ :inline="true"
339
+ class="adSearchForm"
340
+ >
341
+ <template v-for="(searchColumn, index) in vxeOption.searchColumns">
342
+ <vxe-form-item>
343
+ <component
344
+ :is="getColumnWidgetName(searchColumn.widget)"
345
+ :field="searchColumn.widget"
346
+ :form-model="globalModel.formModel"
347
+ :designer="null"
348
+ :key="index"
349
+ :parent-widget="widget"
350
+ ></component>
351
+ </vxe-form-item>
352
+ </template>
353
+ </vxe-form>
354
+ </template>
355
+ </advancedSearchDialog>
356
+ <el-dialog
357
+ title="明细详情"
358
+ :modal-append-to-body="false"
359
+ :close-on-click-modal="false"
360
+ :visible.sync="showRowDetailDialog"
361
+ :modal="false"
362
+ custom-class="dialog-style h5view-dialog"
363
+ width="100%"
364
+ top="0px"
365
+ v-el-drag-dialog
366
+ v-el-dialog-center
367
+ :destroy-on-close="true"
368
+ >
369
+ <div class="cont" style="height: calc(100vh - 73px)">
370
+ <div class="h5-list-box">
371
+ <div
372
+ v-for="(row, rowIndex) in [editRow]"
373
+ :key="rowIndex"
374
+ class="item"
375
+ >
376
+ <!-- <div class="del-btn"><i class="el-icon-delete"></i></div>-->
377
+ <template v-if="vxeOption.columns.length > 0">
378
+ <div class="t1" v-if="widget.options.isQueryTable">
379
+ <template
380
+ v-for="(column, columnIndex) in vxeOption.columns.filter(
381
+ (item, index) => item.isMainFiled
382
+ )"
383
+ >
384
+ <b>{{ column.title }}:</b>
385
+ <span>
386
+ <template v-if="!column.params.formatS">
387
+ {{ row[column.field] }}
388
+ </template>
389
+ <template v-else-if="column.params.formatS == 'render'">
390
+ {{
391
+ column.slots.default({
392
+ column: column,
393
+ rowIndex: rowIndex,
394
+ row: row,
395
+ items: fieldModel,
396
+ })
397
+ }}
398
+ </template>
399
+ <template
400
+ v-else-if="
401
+ column.slots && column.slots.default == 'widget'
402
+ "
403
+ >
404
+ <component
405
+ :is="getColumnWidgetName(column.params.widget)"
406
+ :field="column.params.widget"
407
+ :form-model="globalModel.formModel"
408
+ :designer="null"
409
+ :key="rowIndex"
410
+ :parent-widget="widget"
411
+ :columnConfig="column.params.columnConfig"
412
+ :subFormRowIndex="rowIndex"
413
+ :formItemProp="
414
+ getColumnProp(widget, {
415
+ column: column,
416
+ rowIndex: rowIndex,
417
+ row: row,
418
+ items: fieldModel,
419
+ })
420
+ "
421
+ :tableParam="{
422
+ column: column,
423
+ rowIndex: rowIndex,
424
+ row: row,
425
+ items: fieldModel,
426
+ }"
427
+ ></component>
428
+ </template>
429
+ <template v-else-if="column.params.formatS == 'editDelete'">
430
+ <a
431
+ href="javascript:void(0);"
432
+ class="a-link"
433
+ @click.stop="deleteRow(row, rowIndex)"
434
+ >
435
+ <el-tooltip
436
+ :enterable="false"
437
+ effect="dark"
438
+ content="删除"
439
+ placement="top"
440
+ popper-class="tooltip-skin"
441
+ >
442
+ <i class="el-icon-delete" />
443
+ </el-tooltip>
444
+ </a>
445
+ </template>
446
+ <template v-else-if="column.params.formatS == 'editButton'">
447
+ <a
448
+ href="javascript:void(0);"
449
+ class="a-link"
450
+ @click.stop="openEditDialog(obj.row)"
451
+ >
452
+ <el-tooltip
453
+ :enterable="false"
454
+ effect="dark"
455
+ content="查看"
456
+ placement="top"
457
+ popper-class="tooltip-skin"
458
+ >
459
+ <i class="el-icon-edit" />
460
+ </el-tooltip>
461
+ </a>
462
+ </template>
463
+ <template v-else>
464
+ {{
465
+ column.formatter({
466
+ cellValue: row[column.field],
467
+ column: column,
468
+ rowIndex: rowIndex,
469
+ row: row,
470
+ items: fieldModel,
471
+ })
472
+ }}
473
+ </template>
474
+ </span>
475
+ <!-- <div class="status">未审核</div>-->
476
+ </template>
477
+ </div>
478
+ <div class="t2">
479
+ <template
480
+ v-if="
481
+ !widget.options.isQueryTable || vxeOption.columns.length > 1
482
+ "
483
+ >
484
+ <template v-for="(column, columnIndex) in vxeOption.columns">
485
+ <template
486
+ v-if="!widget.options.isQueryTable || !column.isMainFiled"
487
+ >
488
+ <dl>
489
+ <div>
490
+ <dt>{{ column.title }}:</dt>
491
+ <dd>
492
+ <template v-if="!column.params.formatS">
493
+ {{ row[column.field] }}
494
+ </template>
495
+ <template
496
+ v-else-if="column.params.formatS == 'render'"
497
+ >
498
+ {{
499
+ column.slots.default({
500
+ column: column,
501
+ rowIndex: rowIndex,
502
+ row: row,
503
+ items: fieldModel,
504
+ })
505
+ }}
506
+ </template>
507
+
508
+ <template
509
+ v-else-if="
510
+ column.slots && column.slots.default == 'widget'
511
+ "
512
+ >
513
+ <component
514
+ :is="getColumnWidgetName(column.params.widget)"
515
+ :field="column.params.widget"
516
+ :form-model="globalModel.formModel"
517
+ :designer="null"
518
+ :key="rowIndex + '-' + columnIndex"
519
+ :parent-widget="widget"
520
+ :columnConfig="column.params.columnConfig"
521
+ :subFormRowIndex="rowIndex"
522
+ :formItemProp="
523
+ getColumnProp(widget, {
524
+ column: column,
525
+ rowIndex: rowIndex,
526
+ row: row,
527
+ items: fieldModel,
528
+ })
529
+ "
530
+ :tableParam="{
531
+ column: column,
532
+ rowIndex: rowIndex,
533
+ row: row,
534
+ items: fieldModel,
535
+ }"
536
+ ></component>
537
+ </template>
538
+ <template
539
+ v-else-if="column.params.formatS == 'editDelete'"
540
+ >
541
+ <a
542
+ href="javascript:void(0);"
543
+ class="a-link"
544
+ @click="deleteRow(row, rowIndex)"
545
+ >
546
+ <el-tooltip
547
+ :enterable="false"
548
+ effect="dark"
549
+ content="删除"
550
+ placement="top"
551
+ popper-class="tooltip-skin"
552
+ >
553
+ <i class="el-icon-delete" />
554
+ </el-tooltip>
555
+ </a>
556
+ </template>
557
+ <template
558
+ v-else-if="column.params.formatS == 'editButton'"
559
+ >
560
+ <a
561
+ href="javascript:void(0);"
562
+ class="a-link"
563
+ @click="openEditDialog(obj.row)"
564
+ >
565
+ <el-tooltip
566
+ :enterable="false"
567
+ effect="dark"
568
+ content="查看"
569
+ placement="top"
570
+ popper-class="tooltip-skin"
571
+ >
572
+ <i class="el-icon-edit" />
573
+ </el-tooltip>
574
+ </a>
575
+ </template>
576
+ <template v-else>
577
+ {{
578
+ column.formatter({
579
+ cellValue: row[column.field],
580
+ column: column,
581
+ rowIndex: rowIndex,
582
+ row: row,
583
+ items: fieldModel,
584
+ })
585
+ }}
586
+ </template>
587
+ </dd>
588
+ </div>
589
+ </dl>
590
+ </template>
591
+ </template>
592
+ </template>
593
+ </div>
594
+ <!-- 明细详情弹框里不摆行操作按钮区:行按钮(lineButtons)属于列表行的
595
+ 操作,详情里用不上;容器本身带 border-top 和 padding,即使按钮被
596
+ wf 联动隐藏了也会留下一条空白横条。关闭走右上角的 X。 -->
597
+ </template>
598
+
599
+ <!-- <div class="t1">
600
+ <b>订单号:21533666</b>
601
+ <div class="status">未审核</div>
602
+ </div>
603
+ <div class="t2">
604
+ <p>产地:广东佛山</p>
605
+ <p>产地:广东佛山</p>
606
+ <p>产地:广东佛山</p>
607
+ </div>-->
608
+ </div>
609
+ </div>
610
+ </div>
611
+ <span slot="footer" class="dialog-footer">
612
+ <el-button
613
+ type="primary"
614
+ plain
615
+ class="button-sty"
616
+ icon="el-icon-close"
617
+ @click="showRowDetailDialog = false"
618
+ >{{ $t1("关闭") }}</el-button
619
+ >
620
+ </span>
621
+ </el-dialog>
622
+ </container-item-wrapper>
623
+ </template>
624
+
625
+ <script>
626
+ import emitter from "../../../../components/xform/utils/emitter";
627
+ import i18n from "../../../../components/xform/utils/i18n";
628
+ import refMixin from "../../../../components/xform/form-render/refMixin";
629
+ import containerItemMixin from "./containerItemMixin";
630
+ import FieldComponents from "../../../../components/xform/form-designer/form-widget/field-widget/index";
631
+ import {
632
+ assembleAxiosConfig,
633
+ generateId,
634
+ getReportGlobalMap,
635
+ isVabsearchMultiWidget,
636
+ } from "../../../../components/xform/utils/util";
637
+ import * as formatUtil from "../../../../components/xform/utils/format";
638
+ import {
639
+ buildTextMaskContext,
640
+ markMaskedExportColumns,
641
+ } from "../../../../components/xform/utils/textMaskUtil";
642
+ import { extendDeeply } from "../../../../utils/index.js";
643
+ import { mergeQueryParam } from "../../../../components/xform/utils/queryParamUtil";
644
+ import render from "../../../../views/user/bill_setting/render.vue";
645
+
646
+ const baseRefUtil = {
647
+ emitter,
648
+ i18n,
649
+ refMixin,
650
+ containerItemMixin,
651
+ formatUtil,
652
+ assembleAxiosConfig,
653
+ getReportGlobalMap,
654
+ };
655
+
656
+ const defaultPageSize = 2;
657
+ export default {
658
+ name: "list-h5-item",
659
+ components: {
660
+ ...FieldComponents,
661
+ },
662
+ mixins: [emitter, i18n, refMixin, containerItemMixin],
663
+ componentName: "ContainerItem",
664
+ props: {
665
+ widget: Object,
666
+ parentWidget: Object,
667
+ parentList: Array,
668
+ indexOfParentList: Number,
669
+ subFormRowIndex: {
670
+ type: Number,
671
+ default: -1,
672
+ },
673
+ subFormColIndex: {
674
+ type: Number,
675
+ default: -1,
676
+ },
677
+ subFormRowId: {
678
+ type: String,
679
+ default: "",
680
+ },
681
+ },
682
+ inject: [
683
+ "refList",
684
+ "sfRefList",
685
+ "globalModel",
686
+ "getFormConfig",
687
+ "getGlobalDsv",
688
+ ],
689
+ data: function () {
690
+ let that = this;
691
+ let pageSize = defaultPageSize;
692
+ return {
693
+ showAdvancedSearch: false,
694
+ showRowDetailDialog: false,
695
+ editRow: {},
696
+ fieldModel: [],
697
+ selectedIndices: [],
698
+ /*pageSize: this.widget.options.pagination.pageSize,
699
+ pageSizes: this.widget.options.pagination.pageSizes,
700
+ currentPage: this.widget.options.pagination.currentPage,
701
+ total: this.widget.options.pagination.total,*/
702
+ formData: {
703
+ saleOrgName: "",
704
+ loginAccount: "",
705
+ mobile: "",
706
+ enabled: 1,
707
+ },
708
+ vxeOption: { columns: [] },
709
+ requestAccess: null,
710
+ columnFormatMap: {
711
+ editInput: "input",
712
+ editNumber: "number",
713
+ editDate: "date",
714
+ editSelect: "select",
715
+ editSearch: "vabsearch",
716
+ button: "button",
717
+ },
718
+ dataTableConfig: {},
719
+ advancedFormData: {},
720
+
721
+ pageSize: pageSize,
722
+ page: {
723
+ current: 1,
724
+ size: pageSize,
725
+ total: 0,
726
+ records: [],
727
+ },
728
+ keyword: null,
729
+
730
+ checkItemIds: [],
731
+ };
732
+ },
733
+ watch: {
734
+ fieldModel(val) {
735
+ this.formModel[this.fieldKeyName] = val || [];
736
+ },
737
+ },
738
+ computed: {
739
+ formConfig: function () {
740
+ return this.getFormConfig();
741
+ },
742
+ /**
743
+ * 明细行卡片样式开关。只判 === 'card':老表单该 option 为 null/undefined
744
+ * (upgradeWidgetConfig 补的是 null,运行时读不到这个键),必须退回朴素列表。
745
+ */
746
+ itemCardClass: function () {
747
+ return this.widget.options.itemStyle === "card" ? "h5-item-card" : "";
748
+ },
749
+ paginationLayout: function () {
750
+ return this.widget.options.smallPagination
751
+ ? "prev, pager, next"
752
+ : "total, sizes, prev, pager, next, jumper";
753
+ },
754
+ customClass: function () {
755
+ return this.widget.options.customClass || "";
756
+ },
757
+ singleRowSelectFlag: function () {
758
+ return !this.widget.options.showCheckBox;
759
+ },
760
+ buttonsColumnFixed: function () {
761
+ return void 0 === this.widget.options.buttonsColumnFixed
762
+ ? "right"
763
+ : !!this.widget.options.buttonsColumnFixed &&
764
+ this.widget.options.buttonsColumnFixed;
765
+ },
766
+ columns() {
767
+ let tableColumns = this.widget.options.tableColumns;
768
+ let newColumns = [];
769
+ /*newColumns.push({
770
+ type: 'checkbox',
771
+ width: 48,
772
+ resizable: false,
773
+ fixed: 'left'
774
+ });*/
775
+
776
+ let firstColumn = tableColumns.find((column) => {
777
+ return !!column.prop && !!column.showForRow;
778
+ });
779
+ let mainFiled = firstColumn?.prop;
780
+
781
+ let formRef = this.getFormRef();
782
+ let dateConfig = this.$baseLodash.cloneDeep(
783
+ formRef.getFieldWidgetByType("date").options
784
+ );
785
+ tableColumns.forEach((t) => {
786
+ let columnOption;
787
+ let widget;
788
+ let columnWidgetConfig = this.getColumnWidgetConfig(t);
789
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
790
+ if (columnSelectedWidget) {
791
+ widget = columnSelectedWidget;
792
+ columnOption = widget.options;
793
+ } else {
794
+ columnOption = {};
795
+ }
796
+
797
+ let col = {
798
+ fixed: !!t.fixed && t.fixed,
799
+ field: t.prop,
800
+ title: t.label,
801
+ witdh: t.width,
802
+ sortable: t.sortable,
803
+ align: t.align ? t.align : "center",
804
+ formatter: this.formatterValue,
805
+ isMainFiled: mainFiled == t.prop,
806
+ showForRow: t.showForRow,
807
+ params: {
808
+ ...columnOption,
809
+ widget: widget,
810
+ formatS: t.formatS,
811
+ required: t.required || false,
812
+ columnConfig: t,
813
+ utcTransformEnabled: widget
814
+ ? !!columnOption.utcTransformEnabled
815
+ : !t.formatS ||
816
+ [
817
+ "d1",
818
+ "d2",
819
+ "d3",
820
+ "d4",
821
+ "d5",
822
+ "render",
823
+ "create_date",
824
+ "modify_date",
825
+ ].includes(t.formatS)
826
+ ? !!t.utcTransformEnabled
827
+ : false,
828
+ },
829
+ visible: t.show,
830
+ };
831
+
832
+ if (t.formatS == "render") {
833
+ let r = t.render ? new Function("params", "h", t.render) : null;
834
+ col.slots = {
835
+ default: (params, h) => {
836
+ return r ? r.call(this, params, h) : "";
837
+ },
838
+ };
839
+ } else if (columnSelectedWidget) {
840
+ col.slots = {
841
+ default: "widget",
842
+ };
843
+ } else if (["editDelete", "editButton"].includes(t.formatS)) {
844
+ col.slots = {
845
+ default: t.formatS,
846
+ };
847
+ }
848
+
849
+ newColumns.push(col);
850
+ });
851
+
852
+ /*if (baseRefUtil.tableConfig && baseRefUtil.tableConfig.className == "list-table") {
853
+ if (tableColumns.length) {
854
+ let tableColumn = [tableColumns.length - 1];
855
+ if (tableColumn.fixed != "right") {
856
+ newColumns.push({
857
+ width: 47,
858
+ title: '',
859
+ fixed: 'right',
860
+ sortable: false,
861
+ });
862
+ }
863
+ }
864
+ }*/
865
+ return newColumns;
866
+ },
867
+ formModel: {
868
+ cache: !1,
869
+ get: function () {
870
+ return this.globalModel.formModel;
871
+ },
872
+ },
873
+ formDataId() {
874
+ let formRef = this.getFormRef();
875
+ return formRef.dataId;
876
+ },
877
+ },
878
+ created: function () {
879
+ if (!this.formModel[this.fieldKeyName])
880
+ this.formModel[this.fieldKeyName] = [];
881
+ this.initRefList();
882
+ this.handleOnCreated();
883
+ },
884
+ mounted: async function () {
885
+ this.handleOnMounted();
886
+ this.initTableList();
887
+ },
888
+ beforeDestroy: function () {
889
+ this.unregisterFromRefList();
890
+ },
891
+ methods: {
892
+ openAdvancedSearchDialog() {
893
+ /*let formData = this.formModel;
894
+ let advancedFormData = {};
895
+ this.vxeOption.searchColumns.forEach(form1Field => {
896
+ let value = formData[form1Field.field];
897
+ if (value !== null && value !== undefined) {
898
+ advancedFormData[form1Field.field] = value
899
+ } else {
900
+ advancedFormData[form1Field.field] = null
901
+ }
902
+ });
903
+ this.advancedFormData = advancedFormData;*/
904
+ this.showAdvancedSearch = true;
905
+ },
906
+ confirmAdvancedSearchDialog() {
907
+ let formModel = this.formModel;
908
+ let advancedFormData = this.advancedFormData;
909
+ this.vxeOption.searchColumns.forEach((form1Field) => {
910
+ let value = formModel[form1Field.field];
911
+ if (value !== null && value !== undefined) {
912
+ advancedFormData[form1Field.field] = value;
913
+ } else {
914
+ advancedFormData[form1Field.field] = null;
915
+ }
916
+ });
917
+ this.searchEvent();
918
+ },
919
+ advancedClear() {
920
+ this.vxeOption.searchColumns.forEach((form1Field) => {
921
+ let widgetRef = this.getWidgetRef(form1Field.widget.options.name);
922
+ if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
923
+ });
924
+ },
925
+ setValue(val) {
926
+ let rows = val || [];
927
+ this.formModel[this.fieldKeyName] = rows;
928
+ this.fieldModel = rows;
929
+ },
930
+ getValue() {
931
+ return this.formModel[this.fieldKeyName];
932
+ },
933
+ getFieldKeyName(widget) {
934
+ let o = widget.options.name;
935
+ return (widget.options.keyNameEnabled && widget.options.keyName) || o;
936
+ },
937
+ formatterValue: function ({ cellValue, row, column }) {
938
+ if (cellValue === null || cellValue === undefined) return cellValue;
939
+ if (!column.params) return cellValue;
940
+
941
+ let value = cellValue;
942
+ const formatS = column.params.formatS;
943
+ const dateFormats = [
944
+ "d1",
945
+ "d2",
946
+ "d3",
947
+ "d4",
948
+ "d5",
949
+ "render",
950
+ "create_date",
951
+ "modify_date",
952
+ ];
953
+ const isColumnLevelUtc =
954
+ !formatS || dateFormats.includes(formatS);
955
+ const utcTransformEnabled = isColumnLevelUtc
956
+ ? !!(
957
+ column.params.utcTransformEnabled ||
958
+ column.params.columnConfig?.utcTransformEnabled
959
+ )
960
+ : false;
961
+
962
+ if (utcTransformEnabled && value != null && value !== "") {
963
+ value = this.$utcToLocal(value);
964
+ }
965
+
966
+ if (!formatS) {
967
+ return value;
968
+ }
969
+
970
+ switch (formatS) {
971
+ case "d1":
972
+ return baseRefUtil.formatUtil.formatDate1(value);
973
+ case "d2":
974
+ return baseRefUtil.formatUtil.formatDate2(value);
975
+ case "d3":
976
+ return baseRefUtil.formatUtil.formatDate3(value);
977
+ case "d4":
978
+ return baseRefUtil.formatUtil.formatDate4(value);
979
+ case "d5":
980
+ return baseRefUtil.formatUtil.formatDate4(value);
981
+ case "n1":
982
+ return baseRefUtil.formatUtil.formatNumber1(value);
983
+ case "n2":
984
+ return baseRefUtil.formatUtil.formatNumber2(value);
985
+ case "n3":
986
+ return baseRefUtil.formatUtil.formatNumber3(value);
987
+ case "n4":
988
+ return baseRefUtil.formatUtil.formatNumber4(value);
989
+ case "n5":
990
+ return baseRefUtil.formatUtil.formatNumber5(value);
991
+ case "n6":
992
+ return baseRefUtil.formatUtil.formatNumber6(value);
993
+ case "n7":
994
+ return baseRefUtil.formatUtil.formatNumber7(value);
995
+ }
996
+ return value;
997
+ },
998
+ searchEvent() {
999
+ // this.getGridTable().commitProxy('reload');
1000
+ this.loadAccessData();
1001
+ },
1002
+ async resetEvent() {
1003
+ let formData = this.formModel;
1004
+ this.keyword = null;
1005
+ this.widget.widgetList &&
1006
+ this.widget.widgetList.forEach((subWidget) => {
1007
+ let widgetRef = this.getWidgetRef(subWidget.options.name);
1008
+ let fieldKeyName = this.getFieldKeyName(subWidget);
1009
+ formData[fieldKeyName] = null;
1010
+ this.advancedFormData[fieldKeyName] = null;
1011
+ if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
1012
+ });
1013
+ // this.getGridTable().commitProxy('reload');
1014
+ this.loadAccessData();
1015
+ },
1016
+ openEditDialog(row) {
1017
+ let formRef = this.getFormRef();
1018
+ let parentTarget = formRef.$attrs["parent-target"];
1019
+ parentTarget &&
1020
+ parentTarget.$attrs.openEditDialog &&
1021
+ parentTarget.$attrs.openEditDialog(row);
1022
+ },
1023
+ initTableList() {
1024
+ let that = this;
1025
+ let path = null;
1026
+ let paramFun = null;
1027
+ let tableRef = this.getTableRef();
1028
+ let isQueryTable = this.widget.options.isQueryTable || false;
1029
+ let isDataPage = this.widget.options.accessReturnType === "2";
1030
+ let isQueryAllPage = !this.widget.options.isNotQueryAllPage;
1031
+ let searchColumns = null;
1032
+ if (isQueryTable) {
1033
+ path = "#";
1034
+ paramFun = () => {
1035
+ let conditions = this.getSearchCondition();
1036
+ if (this.widget.options.showPagination) {
1037
+ let searchCount = true;
1038
+ if (isQueryAllPage === false) {
1039
+ searchCount = false;
1040
+ }
1041
+ conditions.current = this.page.current;
1042
+ conditions.size = this.page.size;
1043
+ conditions.searchCount = searchCount;
1044
+ }
1045
+ return conditions;
1046
+ };
1047
+
1048
+ searchColumns = [];
1049
+ let widgetList = this.widget.widgetList;
1050
+ let typeMap = {
1051
+ input: "input",
1052
+ number: "number",
1053
+ inputBatch: "inputBatch",
1054
+ date: "date",
1055
+ };
1056
+
1057
+ widgetList.forEach((widget) => {
1058
+ if ("container" !== widget.category) {
1059
+ let options = widget.options;
1060
+ let type = typeMap[widget.type] || null;
1061
+ searchColumns.push({
1062
+ title: options.label,
1063
+ field: this.getFieldKeyName(widget),
1064
+ type: type,
1065
+ common: true,
1066
+ disabled: options.disabled,
1067
+ defaultValueEnabled: !!type,
1068
+ slot: options.name,
1069
+ widget: widget,
1070
+ formItem: false,
1071
+ });
1072
+ }
1073
+ });
1074
+ }
1075
+
1076
+ let formRef = this.getFormRef();
1077
+ let dataTableConfig = formRef.$attrs.dataTableOption || {};
1078
+ this.dataTableConfig = dataTableConfig;
1079
+
1080
+ let tableOption = {
1081
+ vue: this,
1082
+ tableRef: tableRef,
1083
+ tableName: this.widget.options.name,
1084
+ param: paramFun,
1085
+ columns: this.columns,
1086
+ searchColumns: searchColumns,
1087
+ vform: true,
1088
+ config: {
1089
+ height: isQueryTable ? "550px" : this.widget.options.tableHeight,
1090
+ /*pagerConfig: {
1091
+ autoHidden: !this.widget.options.showPagination
1092
+ },*/
1093
+ ...dataTableConfig.config,
1094
+ },
1095
+ exportAjax: (param) => {
1096
+ let $grid = this.getGridTable();
1097
+ let pageSize = param.size;
1098
+ let currentPage = param.current;
1099
+ let page = { pageSize, currentPage };
1100
+ return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
1101
+ page,
1102
+ param,
1103
+ });
1104
+ },
1105
+ };
1106
+
1107
+ if (isQueryTable) {
1108
+ tableOption.path = path;
1109
+ tableOption.config.proxyConfig = {
1110
+ props: {
1111
+ result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
1112
+ total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
1113
+ },
1114
+ ajax: {
1115
+ // 接收 Promise 对象
1116
+ query: ({ page, sorts, filters, form, param }) => {
1117
+ let scriptCode = this.getScriptCode();
1118
+ let formData = tableOption.param ? tableOption.param() || {} : {};
1119
+ const queryParams = Object.assign({}, formData);
1120
+
1121
+ if (filters) {
1122
+ filters.forEach(({ property, values }) => {
1123
+ queryParams[property] = values.join(",");
1124
+ });
1125
+ }
1126
+
1127
+ if (page.pageSize !== undefined) {
1128
+ queryParams.size = page.pageSize;
1129
+ queryParams.current = page.currentPage;
1130
+ }
1131
+
1132
+ queryParams.searchCount = isQueryAllPage !== false;
1133
+ Object.assign(queryParams, param);
1134
+
1135
+ // 与 PC 链路同规则:condition 追加合并,其余键平铺覆盖
1136
+ if (that.dataTableConfig.queryParam) {
1137
+ mergeQueryParam(queryParams, that.dataTableConfig.queryParam);
1138
+ }
1139
+
1140
+ return new Promise((resolve, reject) => {
1141
+ let reqData = {
1142
+ ...queryParams,
1143
+ };
1144
+ if (scriptCode) {
1145
+ let done = (res) => {
1146
+ resolve(res);
1147
+ if (res.type === "success") {
1148
+ let rows = res.objx
1149
+ ? res.objx.records || res.objx || []
1150
+ : [];
1151
+ this.setValue(rows);
1152
+ if (res.objx && res.objx.records !== undefined) {
1153
+ this.page = {
1154
+ current: res.objx.current ?? this.page.current,
1155
+ size: res.objx.size ?? this.page.size,
1156
+ total: res.objx.total ?? 0,
1157
+ records: rows,
1158
+ };
1159
+ }
1160
+ that.$nextTick(() => {
1161
+ setTimeout(function () {
1162
+ dataTableConfig.callback &&
1163
+ dataTableConfig.callback(rows);
1164
+ tableOption.callback && tableOption.callback(rows);
1165
+ that.handleCustomEvent(
1166
+ that.widget.options.formScriptCallback,
1167
+ ["rows"],
1168
+ [rows]
1169
+ );
1170
+ }, 0);
1171
+ });
1172
+ } else {
1173
+ this.page = {
1174
+ current: 1,
1175
+ size: this.pageSize,
1176
+ total: 0,
1177
+ records: [],
1178
+ };
1179
+ this.setValue([]);
1180
+ }
1181
+ };
1182
+ this.loadDefaultQueryList(reqData, done).catch((error) => {
1183
+ reject(error);
1184
+ });
1185
+ } else {
1186
+ resolve();
1187
+ }
1188
+ });
1189
+ },
1190
+ },
1191
+ };
1192
+ tableOption.callback = (rows) => {
1193
+ // this.fieldModel = rows;
1194
+ this.formModel[this.fieldKeyName] = rows;
1195
+ };
1196
+ }
1197
+ this.vxeOption = tableOption;
1198
+ this.loadAccessData();
1199
+
1200
+ /*this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
1201
+ this.vxeOption = opts;
1202
+ /!*if (!isQueryTable) {
1203
+ this.$nextTick(() => {
1204
+ this.loadAccessData();
1205
+ });
1206
+ }*!/
1207
+ });
1208
+ if (!isQueryTable) {
1209
+ this.loadAccessData();
1210
+ }*/
1211
+ },
1212
+ getTableCondition() {
1213
+ if (this.widget.options.tableCondition) {
1214
+ let e = new Function(this.widget.options.tableCondition);
1215
+ return e.call(this);
1216
+ }
1217
+ },
1218
+ getSearchCondition() {
1219
+ // let extraAccessData = this.extraAccessData || {};
1220
+ let searchFormData = this.getSearchFormData();
1221
+ let conditions = {
1222
+ // ...this.getTableCondition(),
1223
+ ...searchFormData,
1224
+ // ...this.advancedFormData,
1225
+ // ...extraAccessData,
1226
+ };
1227
+ if (this.keyword) {
1228
+ conditions.keyword = this.keyword;
1229
+ }
1230
+ return conditions;
1231
+ },
1232
+ getSearchFormData() {
1233
+ let map = { condition: [] };
1234
+ let formData = this.globalModel.formModel;
1235
+ let widgetList = this.widget.widgetList;
1236
+ if (!!widgetList && widgetList.length > 0) {
1237
+ let loop = (wItem) => {
1238
+ if (wItem.category === "container") {
1239
+ loop(wItem);
1240
+ } else {
1241
+ let formField = this.getFieldKeyName(wItem);
1242
+ let vaule = formData[formField];
1243
+ if (vaule !== null && vaule !== undefined && vaule !== "") {
1244
+ if (!Array.isArray(vaule) || vaule.length > 0) {
1245
+ let item = {
1246
+ value: vaule,
1247
+ field: formField,
1248
+ filter: null,
1249
+ };
1250
+ let wType = wItem.type;
1251
+ if (["date-range", "time-range"].includes(wType)) {
1252
+ item.filter = "between";
1253
+ } else if (
1254
+ ["input-batch", "checkbox"].includes(wType) ||
1255
+ (wType === "select" && wItem.options.multiple)
1256
+ ) {
1257
+ item.filter = "in";
1258
+ } else if (
1259
+ ["radio", "time", "date"].includes(wType) ||
1260
+ (wType === "select" && !wItem.options.multiple)
1261
+ ) {
1262
+ item.filter = "eq";
1263
+ } else {
1264
+ item.filter = "like";
1265
+ }
1266
+ map.condition.push(item);
1267
+ }
1268
+ }
1269
+ }
1270
+ };
1271
+ widgetList.forEach((wItem) => {
1272
+ loop(wItem);
1273
+ });
1274
+ }
1275
+ return map;
1276
+ },
1277
+ loadTableData(param) {
1278
+ if (this.dataTableConfig?.queryFormDialog !== true) {
1279
+ this.checkItemIds = [];
1280
+ }
1281
+ param = param || {};
1282
+ let pageSize = param.size || this.pageSize;
1283
+ let currentPage = param.current || 1;
1284
+ let page = { pageSize, currentPage };
1285
+ return this.vxeOption.config.proxyConfig.ajax.query.call(this, {
1286
+ page,
1287
+ param,
1288
+ });
1289
+ },
1290
+ loadAccessData() {
1291
+ let isQueryTable = this.widget.options.isQueryTable || false;
1292
+ if (isQueryTable) {
1293
+ this.loadTableData({});
1294
+ return;
1295
+ }
1296
+ if (!isQueryTable && !this.formDataId) return;
1297
+
1298
+ let scriptCode = this.getScriptCode();
1299
+ if (scriptCode) {
1300
+ this.loadDefaultViewList();
1301
+ }
1302
+ },
1303
+ getAccessParam() {
1304
+ if (!this.widget.options.formScriptParam) return;
1305
+ return this.handleCustomEvent(this.widget.options.formScriptParam);
1306
+ },
1307
+ getScriptCode() {
1308
+ let accessReturnType = this.widget.options.accessReturnType;
1309
+ let defaultScriptCode = "getList";
1310
+ if (accessReturnType === "1") {
1311
+ defaultScriptCode = "getList";
1312
+ } else if (accessReturnType === "2") {
1313
+ defaultScriptCode = "getPage";
1314
+ }
1315
+ return this.widget.options.formScriptCode || defaultScriptCode;
1316
+ },
1317
+ getAttachmentType() {
1318
+ let result = [];
1319
+ let tableColumns = this.widget.options.tableColumns || [];
1320
+ tableColumns.forEach((item) => {
1321
+ if (item.prop && item.label && item.formatS === "editAttachment") {
1322
+ result.push(item.prop);
1323
+ }
1324
+ });
1325
+ return result;
1326
+ },
1327
+ getHttpConfigForUser() {
1328
+ return {
1329
+ addCreateInfo: true,
1330
+ queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
1331
+ };
1332
+ },
1333
+ /**
1334
+ * 构造表单脚本请求的 data 参数(通用)。
1335
+ * 勾选"请求去掉data层"(removeDataLevel)时,内层参数平铺到外层,不再包一层 data。
1336
+ */
1337
+ buildFormScriptData(reportTemplate, innerData, taBm) {
1338
+ let base = {
1339
+ formCode: reportTemplate.formCode,
1340
+ formVersion: reportTemplate.formVersion,
1341
+ taBm: taBm || this.fieldKeyName,
1342
+ };
1343
+ return this.widget.options.removeDataLevel
1344
+ ? { ...base, ...(innerData || {}) }
1345
+ : { ...base, data: innerData || {} };
1346
+ },
1347
+ loadDefaultQueryList(reqData, done) {
1348
+ let reportTemplate = this.getFormRef().reportTemplate;
1349
+ let scriptCode = this.getScriptCode();
1350
+ let accessParam = this.getAccessParam() || {};
1351
+ let otherParam = {};
1352
+ let attachmentType = this.getAttachmentType();
1353
+ if (attachmentType.length) {
1354
+ otherParam.attachmentType = attachmentType;
1355
+ }
1356
+ let defaultOption = this.getHttpConfigForUser();
1357
+ let requestData = {
1358
+ ...reqData,
1359
+ ...otherParam,
1360
+ };
1361
+ requestData = extendDeeply(requestData, accessParam);
1362
+ return this.formHttp({
1363
+ scriptCode: scriptCode,
1364
+ data: this.buildFormScriptData(reportTemplate, requestData),
1365
+ isLoading: false,
1366
+ ...defaultOption,
1367
+ callback: (res) => {
1368
+ done(res);
1369
+ },
1370
+ });
1371
+ },
1372
+ loadDefaultViewList() {
1373
+ let dataId = this.formDataId;
1374
+ let reportTemplate = this.getFormRef().reportTemplate;
1375
+ let accessParam = this.getAccessParam() || {};
1376
+ let otherParam = {};
1377
+ let attachmentType = this.getAttachmentType();
1378
+ if (attachmentType.length) {
1379
+ otherParam.attachmentType = attachmentType;
1380
+ }
1381
+ let scriptCode = this.getScriptCode();
1382
+ return this.formHttp({
1383
+ scriptCode: scriptCode,
1384
+ data: this.buildFormScriptData(reportTemplate, {
1385
+ id: dataId,
1386
+ ...otherParam,
1387
+ ...accessParam,
1388
+ }),
1389
+ callback: (res) => {
1390
+ let rows = res.objx ? res.objx.records || res.objx || [] : [];
1391
+ this.setValue(rows);
1392
+ this.handleCustomEvent(
1393
+ this.widget.options.formScriptCallback,
1394
+ ["rows"],
1395
+ [rows]
1396
+ );
1397
+ },
1398
+ });
1399
+ },
1400
+ getReqParam(item, dataId, billData) {
1401
+ let param = {};
1402
+ if (item.accessParam) {
1403
+ if (typeof item.accessParam === "string") {
1404
+ let n = new Function("billData", item.accessParam);
1405
+ param = n.call(this, billData);
1406
+ } else {
1407
+ param = item.accessParam;
1408
+ }
1409
+ } else {
1410
+ param = { id: dataId };
1411
+ }
1412
+ return param;
1413
+ },
1414
+ async deleteRow(row, rowIndex) {
1415
+ this.fieldModel.splice(rowIndex, 1);
1416
+ },
1417
+ createNewTableData() {
1418
+ let vailColumns = this.widget.options.tableColumns.filter(
1419
+ (item) => item.prop && item.label
1420
+ );
1421
+ let newData = {};
1422
+ vailColumns.forEach((item) => {
1423
+ if (item.formatS == "editSearch") {
1424
+ newData[item.prop] = null;
1425
+ let vabSearchName = item?.columnOption?.vabSearchName;
1426
+ if (vabSearchName) newData[vabSearchName] = null;
1427
+ } else {
1428
+ newData[item.prop] = null;
1429
+ }
1430
+ });
1431
+ return newData;
1432
+ },
1433
+ addTableData(rows, field) {
1434
+ let formDataModel = this.formModel;
1435
+ let tableRows = this.fieldModel;
1436
+ let fullData = this.fieldModel;
1437
+ let items;
1438
+ if (field) {
1439
+ let keys = fullData.map((item) => {
1440
+ return item[field] + "";
1441
+ });
1442
+ items = rows.filter((item) => {
1443
+ let value = item[field] + "";
1444
+ return !keys.includes(value);
1445
+ });
1446
+ } else {
1447
+ items = rows;
1448
+ }
1449
+ if (items) {
1450
+ if (items.length) {
1451
+ items.forEach((row) => {
1452
+ let newData = this.createNewTableData();
1453
+ Object.assign(newData, row);
1454
+
1455
+ tableRows.push(newData);
1456
+ });
1457
+ }
1458
+ } else {
1459
+ let newData = this.createNewTableData();
1460
+ tableRows.push(newData);
1461
+ }
1462
+ // this.formModel[this.fieldKeyName] = this.$baseLodash(this.fieldModel)
1463
+ // this.fieldModel = tableRows
1464
+ // $grid.loadData(tableRows);
1465
+ },
1466
+ getColumnWidgetConfig(row) {
1467
+ let formRef = this.getFormRef();
1468
+ let formatS = row.formatS;
1469
+ let columnSelectedWidget = null;
1470
+ let columnEditFields = null;
1471
+
1472
+ let type = this.columnFormatMap[row.formatS];
1473
+
1474
+ if (type) {
1475
+ columnSelectedWidget = this.$baseLodash.cloneDeep(
1476
+ formRef.getFieldWidgetByType(type)
1477
+ );
1478
+ let tmpId = generateId();
1479
+ let idVal = row.prop ? row.prop : type + tmpId;
1480
+ columnSelectedWidget.id = idVal;
1481
+ columnSelectedWidget.options.name = idVal;
1482
+ if (row.columnOption && Object.keys(row.columnOption).length) {
1483
+ row.columnOption.required = row.required || false;
1484
+ columnSelectedWidget.options = row.columnOption;
1485
+ } else {
1486
+ columnSelectedWidget.options.required = row.required || false;
1487
+ row.columnOption = columnSelectedWidget.options;
1488
+ }
1489
+ columnSelectedWidget.options.name = row.prop;
1490
+ columnSelectedWidget.options.label = row.label;
1491
+ columnSelectedWidget.options.labelHidden = true;
1492
+ }
1493
+ return { columnSelectedWidget, columnEditFields };
1494
+ },
1495
+ getColumnProp(widget, obj) {
1496
+ let isQueryTable = this.widget.options.isQueryTable || false;
1497
+ if (isQueryTable) {
1498
+ return "false";
1499
+ } else {
1500
+ let propName =
1501
+ this.getFieldKeyName(widget) +
1502
+ "." +
1503
+ obj.rowIndex +
1504
+ "." +
1505
+ obj.column.field;
1506
+ if (
1507
+ this.isVabsearchFlagWidget(widget) &&
1508
+ !isVabsearchMultiWidget(widget)
1509
+ ) {
1510
+ let vabSearchName = obj.column.params.widget.options.vabSearchName;
1511
+ propName =
1512
+ this.getFieldKeyName(widget) +
1513
+ "." +
1514
+ obj.rowIndex +
1515
+ "." +
1516
+ vabSearchName;
1517
+ }
1518
+ return propName;
1519
+ }
1520
+ },
1521
+ isVabsearchFlagWidget(widget) {
1522
+ let type = widget?.type;
1523
+ return (
1524
+ type === "vabsearch" ||
1525
+ type === "singerSearch" ||
1526
+ type === "multiSearch"
1527
+ );
1528
+ },
1529
+ getColumnWidgetName(e) {
1530
+ if (e && e.type) {
1531
+ return e.type + "-widget";
1532
+ }
1533
+ },
1534
+ getGridTable() {
1535
+ let $grid = this.$refs[this.getTableRef()];
1536
+ return $grid;
1537
+ },
1538
+ getTableRef() {
1539
+ let tableRef = this.widget.id;
1540
+ return tableRef;
1541
+ },
1542
+ getUrl() {
1543
+ let accessUrl = this.widget.options.accessUrl;
1544
+ return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
1545
+ },
1546
+ openRowDetailDialog(row) {
1547
+ /*let isQueryTable = this.widget.options.isQueryTable || false;
1548
+ if(isQueryTable)return;*/
1549
+ this.editRow = row;
1550
+ this.showRowDetailDialog = true;
1551
+ },
1552
+ changePageNew({ type, currentPage, pageSize, $event }) {
1553
+ this.loadTableData({
1554
+ size: pageSize + "",
1555
+ current: currentPage + "",
1556
+ });
1557
+ },
1558
+ /** 导出前按脱敏规则剔除列,实现见 textMaskUtil.markMaskedExportColumns。 */
1559
+ markMaskedColumnsForExport() {
1560
+ markMaskedExportColumns(
1561
+ this.getGridTable(),
1562
+ buildTextMaskContext(this.getFormRef(), this.$store.getters.companyCode)
1563
+ );
1564
+ },
1565
+ exportData(option) {
1566
+ this.markMaskedColumnsForExport();
1567
+ let tableRef = this.getTableRef();
1568
+ let serverName = this.getFormRef().reportTemplate.serverName;
1569
+ option.prefix = option.prefix || serverName;
1570
+ this.$excelExport({ targetRef: tableRef, ...option });
1571
+ },
1572
+ /**
1573
+ * 行级对比标记,复用 indexMixin 的 getCompareRowClass(data-table 也在用,
1574
+ * 见 data-table-mixin.js 的 rowClassName)。返回
1575
+ * xform-compare-row-new / xform-compare-row-changed / ""。
1576
+ * 未参与对比的子表由 getCompareRowClass 内部的 isCompareSubTable 拦掉,
1577
+ * 不会满屏高亮,这里无需重复判断。
1578
+ */
1579
+ getRowCompareClass(row) {
1580
+ let formRef = this.getFormRef();
1581
+ if (!formRef || !formRef.isCompare || !formRef.getCompareRowClass)
1582
+ return "";
1583
+ return formRef.getCompareRowClass(this.fieldKeyName, row);
1584
+ },
1585
+ /**
1586
+ * 明细行的显示文本。
1587
+ *
1588
+ * 行上不渲染编辑控件,所以有选项的列(下拉/状态/单选/多选)必须自己把
1589
+ * value 换成 label —— 否则状态列会显示成 1 而不是「审核中」,
1590
+ * 因为 formatterValue 只做日期与数字格式化,不查选项表。
1591
+ */
1592
+ getColumnDisplayText(column, row, rowIndex) {
1593
+ let value = row[column.field];
1594
+ let columnWidget = column.params ? column.params.widget : null;
1595
+ let widgetOptions = (columnWidget && columnWidget.options) || {};
1596
+ let optionList = widgetOptions.optionItems || widgetOptions.statusParam;
1597
+ if (optionList && optionList.length) {
1598
+ let hit = optionList.filter((o) => String(o.value) === String(value))[0];
1599
+ if (hit) return hit.label;
1600
+ }
1601
+ return column.formatter({
1602
+ cellValue: value,
1603
+ column: column,
1604
+ rowIndex: rowIndex,
1605
+ row: row,
1606
+ items: this.fieldModel,
1607
+ });
1608
+ },
1609
+ /**
1610
+ * 行点击:
1611
+ * - 查询选择场景(isQueryTable):点行是勾选,保持原行为;
1612
+ * - 明细行:点整行打开明细详情(行上不再摆删除/操作按钮)。
1613
+ */
1614
+ onRowClick(row) {
1615
+ if (this.widget.options.isQueryTable) {
1616
+ this.itemCheck(row);
1617
+ return
1618
+ }
1619
+ this.openRowDetailDialog(row);
1620
+ },
1621
+ itemCheck(row) {
1622
+ let dataTableConfig = this.dataTableConfig;
1623
+ if (dataTableConfig) {
1624
+ let checkItemIds = this.checkItemIds;
1625
+ let checked;
1626
+ if (checkItemIds.includes(row.id)) {
1627
+ checked = false;
1628
+ checkItemIds.splice(checkItemIds.indexOf(row.id), 1);
1629
+ } else {
1630
+ checked = true;
1631
+ checkItemIds.push(row.id);
1632
+ }
1633
+ let param = { row, checked };
1634
+ dataTableConfig.onCheckboxChange &&
1635
+ dataTableConfig.onCheckboxChange(param);
1636
+ }
1637
+ },
1638
+ },
1639
+ };
1640
+ </script>
1641
+
1642
+ <style lang="scss" scoped></style>