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

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