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

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