vue2-client 1.8.310 → 1.8.312

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 (222) hide show
  1. package/.env +19 -19
  2. package/.eslintrc.js +90 -90
  3. package/CHANGELOG.md +824 -824
  4. package/Components.md +60 -60
  5. package/babel.config.js +21 -21
  6. package/docs/LowCode/lowcode.md +155 -155
  7. package/docs/LowCode/lowcodeForDeveloper.md +230 -230
  8. package/docs/index.md +30 -30
  9. package/index.js +31 -31
  10. package/jest-transform-stub.js +8 -8
  11. package/jest.config.js +21 -21
  12. package/jest.setup.js +7 -7
  13. package/package.json +97 -97
  14. package/public/index.html +27 -27
  15. package/src/App.vue +188 -188
  16. package/src/ReportView.js +19 -19
  17. package/src/assets/img/querySlotDemo.svg +15 -15
  18. package/src/assets/svg/badtwo.svg +1 -1
  19. package/src/assets/svg/goodtwo.svg +1 -1
  20. package/src/base-client/components/common/AMisRender/index.js +3 -3
  21. package/src/base-client/components/common/AMisRender/index.vue +263 -263
  22. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +438 -416
  23. package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
  24. package/src/base-client/components/common/AddressSearchCombobox/ic_map.svg +6 -6
  25. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
  26. package/src/base-client/components/common/CitySelect/CitySelect.vue +342 -342
  27. package/src/base-client/components/common/CitySelect/index.js +3 -3
  28. package/src/base-client/components/common/CitySelect/index.md +109 -109
  29. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
  30. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
  31. package/src/base-client/components/common/CreateQuery/index.js +3 -3
  32. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  33. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
  34. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
  35. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
  36. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  37. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  38. package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
  39. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  40. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
  41. package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
  42. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  43. package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
  44. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorPanel.vue +413 -350
  45. package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +502 -502
  46. package/src/base-client/components/common/LowCodeComponent/LowCodeRender.vue +728 -699
  47. package/src/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue +29 -29
  48. package/src/base-client/components/common/LowCodeComponent/LowCodeUIStore.vue +219 -162
  49. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
  50. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  51. package/src/base-client/components/common/Tree/Tree.vue +149 -149
  52. package/src/base-client/components/common/Tree/index.js +2 -2
  53. package/src/base-client/components/common/Upload/Upload.vue +239 -239
  54. package/src/base-client/components/common/Upload/index.js +3 -3
  55. package/src/base-client/components/common/XAddForm/XAddForm.vue +105 -105
  56. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +807 -807
  57. package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
  58. package/src/base-client/components/common/XAddNativeForm/lowcodeEditorRegister.js +16 -16
  59. package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
  60. package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
  61. package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
  62. package/src/base-client/components/common/XBadge/XBadge.vue +78 -78
  63. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  64. package/src/base-client/components/common/XDataCard/XDataCard.vue +355 -0
  65. package/src/base-client/components/common/XDataCard/index.js +3 -0
  66. package/src/base-client/components/common/XDataCard/index.md +1 -0
  67. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
  68. package/src/base-client/components/common/XDataDrawer/index.js +3 -3
  69. package/src/base-client/components/common/XDataDrawer/index.md +41 -41
  70. package/src/base-client/components/common/XDescriptions/XDescriptions.vue +188 -187
  71. package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +306 -306
  72. package/src/base-client/components/common/XDescriptions/demo.vue +50 -50
  73. package/src/base-client/components/common/XDescriptions/index.js +3 -3
  74. package/src/base-client/components/common/XDescriptions/index.md +83 -83
  75. package/src/base-client/components/common/XDetailsView/XDetailsView.vue +214 -214
  76. package/src/base-client/components/common/XDetailsView/index.js +3 -3
  77. package/src/base-client/components/common/XForm/XForm.vue +294 -294
  78. package/src/base-client/components/common/XForm/XFormItem.vue +911 -911
  79. package/src/base-client/components/common/XForm/XTreeSelect.vue +207 -207
  80. package/src/base-client/components/common/XForm/index.md +178 -178
  81. package/src/base-client/components/common/XFormCol/XFormCol.vue +36 -36
  82. package/src/base-client/components/common/XFormGroup/XFormGroup.vue +241 -241
  83. package/src/base-client/components/common/XFormGroup/demo.vue +40 -40
  84. package/src/base-client/components/common/XFormGroup/index.js +3 -3
  85. package/src/base-client/components/common/XFormGroup/index.md +38 -38
  86. package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
  87. package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
  88. package/src/base-client/components/common/XFormTable/XFormTable.vue +545 -539
  89. package/src/base-client/components/common/XFormTable/demo.vue +72 -72
  90. package/src/base-client/components/common/XFormTable/index.md +98 -98
  91. package/src/base-client/components/common/XFormTable/lowcodeEditorRegister.js +30 -30
  92. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +147 -147
  93. package/src/base-client/components/common/XReport/XReport.vue +858 -858
  94. package/src/base-client/components/common/XReport/XReportDemo.vue +266 -266
  95. package/src/base-client/components/common/XReport/XReportDesign.vue +509 -509
  96. package/src/base-client/components/common/XReport/XReportJsonRender.vue +295 -295
  97. package/src/base-client/components/common/XReport/XReportTrGroup.vue +801 -801
  98. package/src/base-client/components/common/XReport/index.js +3 -3
  99. package/src/base-client/components/common/XReport/index.md +44 -44
  100. package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
  101. package/src/base-client/components/common/XReportSlot/index.js +3 -3
  102. package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +137 -0
  103. package/src/base-client/components/common/XSimpleDescriptions/index.js +3 -0
  104. package/src/base-client/components/common/XSimpleDescriptions/index.md +7 -0
  105. package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
  106. package/src/base-client/components/common/XStepView/index.js +3 -3
  107. package/src/base-client/components/common/XStepView/index.md +31 -31
  108. package/src/base-client/components/common/XTable/XTable.vue +715 -676
  109. package/src/base-client/components/common/XTable/index.md +255 -255
  110. package/src/base-client/components/common/XTree/XTree.vue +423 -423
  111. package/src/base-client/components/common/XTree/index.js +3 -3
  112. package/src/base-client/components/common/XTree/index.md +36 -36
  113. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +114 -114
  114. package/src/base-client/components/common/XTreeOne/lowcodeEditorRegister.js +11 -11
  115. package/src/base-client/components/index.js +51 -51
  116. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  117. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  118. package/src/base-client/plugins/AppData.js +121 -121
  119. package/src/base-client/plugins/Config.js +19 -19
  120. package/src/base-client/plugins/GetLoginInfoService.js +183 -183
  121. package/src/base-client/plugins/tabs-page-plugin.js +39 -39
  122. package/src/bootstrap.js +39 -39
  123. package/src/components/CodeMirror/inedx.vue +118 -118
  124. package/src/components/CodeMirror/setting.js +40 -40
  125. package/src/components/FilePreview/FilePreview.vue +166 -166
  126. package/src/components/NumberInfo/NumberInfo.vue +54 -54
  127. package/src/components/STable/index.js +361 -361
  128. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  129. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  130. package/src/components/menu/SideMenu.vue +75 -75
  131. package/src/components/menu/menu.js +273 -273
  132. package/src/components/tool/AStepItem.vue +60 -60
  133. package/src/config/CreateQueryConfig.js +322 -322
  134. package/src/config/default/antd.config.js +89 -89
  135. package/src/config/default/setting.config.js +55 -55
  136. package/src/font-style/font.css +4 -4
  137. package/src/layouts/CommonLayout.vue +56 -56
  138. package/src/layouts/PageLayout.vue +151 -151
  139. package/src/layouts/SinglePageView.vue +138 -138
  140. package/src/layouts/header/AdminHeader.vue +132 -132
  141. package/src/layouts/header/HeaderNotice.vue +177 -177
  142. package/src/layouts/tabs/TabsHead.vue +189 -189
  143. package/src/layouts/tabs/TabsView.vue +387 -387
  144. package/src/lib.js +1 -1
  145. package/src/main.js +26 -26
  146. package/src/mock/extend/index.js +84 -84
  147. package/src/mock/goods/index.js +108 -108
  148. package/src/pages/AMisDemo/AMisDemo.vue +325 -325
  149. package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
  150. package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
  151. package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
  152. package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
  153. package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
  154. package/src/pages/DynamicStatistics/FavoriteList.vue +51 -51
  155. package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
  156. package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
  157. package/src/pages/DynamicStatistics/index.vue +282 -282
  158. package/src/pages/Example/index.vue +193 -33
  159. package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
  160. package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
  161. package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
  162. package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
  163. package/src/pages/NewDynamicStatistics/FavoriteList.vue +51 -51
  164. package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
  165. package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
  166. package/src/pages/NewDynamicStatistics/index.vue +258 -258
  167. package/src/pages/ServiceReview/index.vue +284 -284
  168. package/src/pages/XReportView/index.vue +62 -62
  169. package/src/pages/login/Login.vue +378 -378
  170. package/src/pages/login/LoginV3.vue +389 -389
  171. package/src/pages/lowCode/lowCodeEditor.vue +1219 -1030
  172. package/src/pages/lowCode/lowCodeRenderPage.vue +43 -43
  173. package/src/pages/resourceManage/orgListManage.vue +98 -98
  174. package/src/pages/system/dictionary/index.vue +44 -44
  175. package/src/pages/system/monitor/loginInfor/index.vue +37 -37
  176. package/src/pages/system/monitor/operLog/index.vue +37 -37
  177. package/src/pages/system/settings/modifyPassword.vue +117 -117
  178. package/src/pages/system/ticket/index.vue +480 -480
  179. package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
  180. package/src/router/async/config.async.js +34 -34
  181. package/src/router/async/router.map.js +104 -104
  182. package/src/router/guards.js +223 -223
  183. package/src/router/index.js +27 -27
  184. package/src/router.js +19 -19
  185. package/src/services/api/TicketDetailsViewApi.js +46 -46
  186. package/src/services/api/cas.js +79 -79
  187. package/src/services/api/common.js +307 -307
  188. package/src/services/api/entity.js +18 -18
  189. package/src/services/api/index.js +17 -17
  190. package/src/services/api/restTools.js +46 -46
  191. package/src/services/apiService.js +14 -14
  192. package/src/services/user.js +71 -71
  193. package/src/services/v3Api.js +81 -81
  194. package/src/store/modules/index.js +5 -5
  195. package/src/store/modules/lowCode.js +33 -33
  196. package/src/store/modules/setting.js +119 -119
  197. package/src/theme/default/style.less +58 -58
  198. package/src/theme/global.less +139 -139
  199. package/src/utils/authority-utils.js +85 -85
  200. package/src/utils/errorCode.js +6 -6
  201. package/src/utils/formatter.js +80 -80
  202. package/src/utils/htmlToPDF.js +108 -108
  203. package/src/utils/htmlToPDFApi.js +5 -5
  204. package/src/utils/indexedDB.js +258 -258
  205. package/src/utils/login.js +188 -188
  206. package/src/utils/lowcode/lowcodeComponentMixin.js +120 -120
  207. package/src/utils/lowcode/lowcodeLog.js +29 -29
  208. package/src/utils/lowcode/lowcodeUtils.js +373 -373
  209. package/src/utils/lowcode/registerComponentForEditor.js +11 -11
  210. package/src/utils/lowcode/registerComponentForRender.js +11 -11
  211. package/src/utils/map-utils.js +47 -47
  212. package/src/utils/reg.js +95 -95
  213. package/src/utils/request.js +347 -347
  214. package/src/utils/routerUtil.js +435 -435
  215. package/src/utils/runEvalFunction.js +6 -6
  216. package/src/utils/util.js +241 -241
  217. package/src/utils/waterMark.js +31 -31
  218. package/test/Amis.spec.js +163 -163
  219. package/test/Tree.spec.js +167 -167
  220. package/test/myDialog.spec.js +46 -46
  221. package/vue.config.js +181 -181
  222. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,539 +1,545 @@
1
- <template>
2
- <a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
3
- <a-col
4
- :xs="14"
5
- :sm="14"
6
- :md="12"
7
- :lg="9"
8
- :xl="6"
9
- :xxl="5"
10
- v-if="xTreeConfigName"
11
- :style="{ maxWidth: '400px'}">
12
- <x-tree
13
- :config-name="xTreeConfigName"
14
- :env="env"
15
- @action="action"
16
- @btnFuncClick="treeBtnFuncClick"
17
- @treeOnChecked="treeOnChecked"
18
- ref="xtree"
19
- ></x-tree>
20
- </a-col>
21
- <a-col
22
- :xs="xTreeConfigName ? 10 : 24"
23
- :sm="xTreeConfigName ? 10 : 24"
24
- :md="xTreeConfigName ? 12 : 24"
25
- :lg="xTreeConfigName ? 15 : 24"
26
- :xl="xTreeConfigName ? 18 : 24"
27
- :xxl="xTreeConfigName ? 19 : 24">
28
- <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
29
- <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
30
- <div v-show="!loading">
31
- <template v-if="!loadError">
32
- <x-add-form
33
- ref="xAddForm"
34
- @afterSubmit="onAddOrEditSubmitAfterSubmit"
35
- >
36
- <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
37
- <slot
38
- name="groupFormItems"
39
- :form="form"
40
- :model="model"
41
- :rules="rules"
42
- :modifyModelData="modifyModelData"></slot>
43
- </template>
44
- </x-add-form>
45
- <div v-if="crudTitle" class="crud_title">
46
- {{ crudTitle }}
47
- </div>
48
- <x-form
49
- ref="xForm"
50
- @toggleAdvanced="toggleAdvanced"
51
- @onSubmit="onSearchSubmit">
52
- <slot name="formBtnExpand"></slot>
53
- </x-form>
54
- <x-table
55
- ref="xTable"
56
- :fixedQueryForm="fixedQueryForm"
57
- :queryParamsName="queryParamsName"
58
- :query-params-json="queryParamsJson"
59
- :show-pagination="showPagination"
60
- :customDelete="customDelete"
61
- :extraHeight="extraHeight"
62
- @add="add"
63
- @edit="edit"
64
- @del="del"
65
- @afterDelete="afterDelete"
66
- @action="action"
67
- @selectRow="selectRow"
68
- @afterQuery="afterQuery"
69
- @tempTableEdit="tempTableEdit">
70
- <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
71
- <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
72
- </template>
73
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
74
- <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
75
- </template>
76
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
77
- <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
78
- <a-tooltip title="收起查询条件" placement="bottom">
79
- <a-button @click="toggleIsFormShow">
80
- <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
81
- </a-button>
82
- </a-tooltip>
83
- </template>
84
- <!-- 底部插槽 -->
85
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
86
- <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
87
- </template>
88
- <!-- excel导入说明插槽 -->
89
- <template #importExcelSlot>
90
- <slot name="importExcelSlot"></slot>
91
- </template>
92
- </x-table>
93
- </template>
94
- <template v-else>
95
- <a-empty>
96
- <span slot="description"> 页面配置不存在请联系系统管理员, </span>
97
- </a-empty>
98
- </template>
99
- </div>
100
- </a-col>
101
- </a-row>
102
- </template>
103
- <script>
104
- import XForm from '@vue2-client/base-client/components/common/XForm'
105
- import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
106
- import XTable from '@vue2-client/base-client/components/common/XTable'
107
- import XTree from '@vue2-client/base-client/components/common/XTree'
108
- import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
109
- import {
110
- getConfigByName,
111
- getConfigByLogic,
112
- parseConfig,
113
- } from '@vue2-client/services/api/common'
114
- import { mapState } from 'vuex'
115
- import lowcodeComponentMixin from '@vue2-client/utils/lowcode/lowcodeComponentMixin'
116
-
117
- export default {
118
- name: 'XFormTable',
119
- components: {
120
- XTable,
121
- XForm,
122
- XTree,
123
- XAddForm,
124
- XImportExcel
125
- },
126
- data () {
127
- return {
128
- // 加载状态
129
- loading: false,
130
- // 图标样式
131
- iconStyle: {
132
- position: 'relative',
133
- top: '1px'
134
- },
135
- loadError: false,
136
- // 实际查询配置内容
137
- realQueryConfig: {},
138
- toggleIsFormIcon: 'vertical-align-top',
139
- table_selectedRowKeys: [],
140
- table_selectedRows: []
141
- }
142
- },
143
- computed: {
144
- ...mapState('setting', ['isMobile'])
145
- },
146
- mixins: [lowcodeComponentMixin],
147
- props: {
148
- // 业务名称
149
- title: {
150
- type: String,
151
- default: ''
152
- },
153
- // 卡片标题
154
- crudTitle: {
155
- type: String,
156
- default: null
157
- },
158
- // 查询配置文件名
159
- queryParamsName: {
160
- type: String,
161
- default: null
162
- },
163
- // 配置所属命名空间
164
- serviceName: {
165
- type: String,
166
- default: undefined
167
- },
168
- // 查询配置文件Json,用于查询配置生成器的预览
169
- queryParamsJson: {
170
- type: Object,
171
- default: null
172
- },
173
- // xTree 配置
174
- xTreeConfigName: {
175
- type: String,
176
- default: null
177
- },
178
- // 业务逻辑名称, 通过logic获取表单表格配置
179
- logicName: {
180
- type: String,
181
- default: null
182
- },
183
- // 执行logic传递的参数
184
- logicParam: {
185
- type: Object,
186
- default: () => {
187
- }
188
- },
189
- // 固定新增表单
190
- fixedAddForm: {
191
- type: Object,
192
- default: () => {
193
- return {}
194
- }
195
- },
196
- // 固定查询表单
197
- fixedQueryForm: {
198
- type: Object,
199
- default: () => {
200
- return {}
201
- }
202
- },
203
- // 预览模式
204
- viewMode: {
205
- type: Boolean,
206
- default: () => {
207
- return false
208
- }
209
- },
210
- // 环境
211
- env: {
212
- type: String,
213
- default: () => {
214
- return 'prod'
215
- }
216
- },
217
- // 数据只有一页时是否展示分页,true:展示,auto:隐藏
218
- showPagination: {
219
- type: Boolean,
220
- default: true
221
- },
222
- // 调用logic获取数据源的追加参数
223
- getDataParams: {
224
- type: Object,
225
- default: undefined
226
- },
227
- // 可以控制组件中导出等按钮的隐藏
228
- buttonState: {
229
- type: Object,
230
- default: undefined
231
- },
232
- // 是否自定义新增按钮的功能
233
- customAdd: {
234
- type: Boolean,
235
- default: false
236
- },
237
- // 是否自定义删除按钮的功能
238
- customDelete: {
239
- type: Boolean,
240
- default: false
241
- },
242
- // 是否自定义修改按钮的功能
243
- customEdit: {
244
- type: Boolean,
245
- default: false
246
- },
247
- // 自适应底部边距
248
- extraHeight: {
249
- type: Number,
250
- default: 80
251
- }
252
- },
253
- watch: {
254
- logicParam: {
255
- handler () {
256
- this.initConfig()
257
- },
258
- deep: true
259
- },
260
- queryParamsJson: {
261
- handler () {
262
- this.initConfig()
263
- },
264
- deep: true
265
- },
266
- queryParamsName: {
267
- handler () {
268
- this.initConfig()
269
- }
270
- },
271
- serviceName: {
272
- handler () {
273
- this.initConfig()
274
- }
275
- }
276
- },
277
- created () {
278
- this.initConfig()
279
- },
280
- methods: {
281
- initConfig () {
282
- this.loading = true
283
- this.loadError = false
284
- if (this.queryParamsName) {
285
- this.getConfig()
286
- } else if (this.queryParamsJson) {
287
- this.getConfigBySource()
288
- } else if (this.logicName && this.logicParam) {
289
- this.getColumnJsonByLogic()
290
- } else {
291
- this.loading = false
292
- this.loadError = true
293
- }
294
- },
295
- getConfig () {
296
- getConfigByName(this.queryParamsName, this.serviceName, (res) => {
297
- this.updateComponents(res)
298
- }, this.env === 'dev')
299
- },
300
- getConfigBySource () {
301
- parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
302
- this.updateComponents(res, true)
303
- })
304
- },
305
- getColumnJsonByLogic () {
306
- getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
307
- this.updateComponents(res, true)
308
- }, this.env === 'dev')
309
- },
310
- /**
311
- * 更新子组件
312
- * @param res 参数
313
- * @param setQueryParams 是否设置queryParams参数
314
- */
315
- updateComponents (res, setQueryParams) {
316
- this.realQueryConfig = res
317
- if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
318
- this.$refs.xForm.init({
319
- formItems: res.formJson,
320
- serviceName: this.serviceName,
321
- getDataParams: this.getDataParams,
322
- env: this.env
323
- })
324
- this.$refs.xTable.init({
325
- queryParams: setQueryParams ? res : null,
326
- tableColumns: res.columnJson,
327
- buttonState: Object.assign(res.buttonState, this.buttonState),
328
- title: this.title,
329
- viewMode: this.viewMode,
330
- tableSummaryMap: res.tableSummaryMap,
331
- isTableTemp: this.isTableTemp,
332
- serviceName: this.serviceName,
333
- env: this.env,
334
- form: this.$refs.xForm.form
335
- })
336
- }
337
- this.loading = false
338
- },
339
- /**
340
- * 提交查询表单事件
341
- * @param res 参数
342
- */
343
- onSearchSubmit (res) {
344
- if (res.valid) {
345
- // 表单赋值
346
- this.$refs.xTable.setQueryForm(res.form)
347
- // commit
348
- this.$emit('afterSearchSubmit', res)
349
- } else {
350
- return false
351
- }
352
- },
353
- active (props) {
354
- let num = false
355
- for (const key in props) {
356
- // eslint-disable-next-line no-prototype-builtins
357
- if (this.$props.hasOwnProperty(key)) {
358
- console.log('key', this.$props[key] instanceof Object)
359
- if (this.$props[key] instanceof Object) {
360
- this.$props[key] = JSON.parse(props[key])
361
- } else {
362
- this.$props[key] = props[key]
363
- }
364
- num = true
365
- }
366
- console.log(key, props[key])
367
- }
368
- console.warn('activeProps', this.$props)
369
- if (num) {
370
- this.initConfig()
371
- }
372
- },
373
- /**
374
- * 提交新增/修改表单后事件
375
- */
376
- onAddOrEditSubmitAfterSubmit (res) {
377
- this.refreshTable(res.businessType === '新增')
378
- // commit
379
- this.$emit('afterSubmit', res)
380
- },
381
- /**
382
- * 表格查询后事件
383
- * @param res 参数
384
- * @param conditionParams 查询条件
385
- */
386
- afterQuery (res, conditionParams) {
387
- this.$emit('afterQuery', res, conditionParams)
388
- },
389
- /**
390
- * 详情按钮事件
391
- * @param record 本条数据
392
- * @param id 数据标识
393
- * @param actionType 操作类型
394
- * @param fun 向上级传递的事件
395
- */
396
- action (record, id, actionType, fun = 'action') {
397
- this.$emit(fun, record, id, actionType)
398
- this.$lowCodeEmit(fun, record)
399
- },
400
- treeOnChecked (checkedKeys, deepNodes, deepKeys) {
401
- this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
402
- },
403
- treeBtnFuncClick (index, func) {
404
- this.$emit('treeBtnFuncClick', index, func)
405
- },
406
- /**
407
- * 新增按钮事件
408
- */
409
- del (keys, callback) {
410
- if (this.customDelete) {
411
- this.$emit('del', keys, callback)
412
- }
413
- },
414
- /**
415
- * 新增按钮事件
416
- */
417
- add () {
418
- if (this.customAdd) {
419
- this.$emit('add')
420
- } else {
421
- const res = this.realQueryConfig
422
- this.$refs.xAddForm.init({
423
- businessType: '新增',
424
- title: this.title,
425
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
426
- configName: this.queryParamsName,
427
- configContent: this.queryParamsJson,
428
- formItems: res.formJson,
429
- viewMode: this.viewMode,
430
- isTableTemp: this.isTableTemp,
431
- serviceName: this.serviceName,
432
- fixedAddForm: this.fixedAddForm,
433
- getDataParams: this.getDataParams,
434
- layout: res.xAddFormLayout || 'horizontal',
435
- env: this.env
436
- })
437
- }
438
- },
439
- /**
440
- * 修改按钮事件
441
- * @param modifyModelData 修改表单数据
442
- */
443
- edit (modifyModelData) {
444
- if (this.customAdd) {
445
- this.$emit('edit')
446
- } else {
447
- const res = this.realQueryConfig
448
- this.$refs.xAddForm.init({
449
- businessType: '修改',
450
- title: this.title,
451
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
452
- configName: this.queryParamsName,
453
- configContent: this.queryParamsJson,
454
- formItems: res.formJson,
455
- viewMode: this.viewMode,
456
- isTableTemp: this.isTableTemp,
457
- serviceName: this.serviceName,
458
- fixedAddForm: this.fixedAddForm,
459
- getDataParams: this.getDataParams,
460
- modifyModelData: modifyModelData,
461
- layout: res.xAddFormLayout || 'horizontal',
462
- env: this.env
463
- })
464
- }
465
- },
466
- /**
467
- * 删除后事件
468
- * @param res
469
- */
470
- afterDelete (res) {
471
- this.$emit('afterDelete', res)
472
- },
473
- /**
474
- * 更多条件是否展示
475
- */
476
- toggleAdvanced () {
477
- this.$refs.xTable.setScrollYHeight({})
478
- },
479
- /**
480
- * 查询表单部分显示/隐藏切换
481
- */
482
- toggleIsFormShow () {
483
- this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
484
- this.$refs.xForm.toggleVisible()
485
- this.$refs.xTable.setScrollYHeight({})
486
- },
487
- /**
488
- * 选择列事件
489
- * @param selectedRowKeys 选中列Key集合
490
- * @param selectedRows 选中列
491
- */
492
- selectRow (selectedRowKeys, selectedRows) {
493
- this.table_selectedRowKeys = selectedRowKeys
494
- this.table_selectedRows = selectedRows
495
- this.$emit('selectRow', selectedRowKeys, selectedRows)
496
- },
497
- /**
498
- * 临时表修改
499
- * @param res 参数
500
- */
501
- tempTableEdit (res) {
502
- this.$emit('tempTableEdit', res)
503
- },
504
- /**
505
- * 刷新表格
506
- * @param toFirstPage 是否到第一页
507
- */
508
- refreshTable (toFirstPage = true) {
509
- this.$refs.xTable.refresh(toFirstPage)
510
- },
511
- },
512
- action: {
513
- /**
514
- * 实现doAction方法
515
- */
516
- doAction (actionType, args, data) {
517
- switch (actionType) {
518
- case 'refreshTable':
519
- for (const item in args) {
520
- console.log('item', item)
521
- }
522
- break
523
- default:
524
- break
525
- }
526
- }
527
- }
528
- }
529
- </script>
530
- <style lang="less" scoped>
531
- .crud_title {
532
- height: 32px;
533
- font-size: 16px;
534
- font-weight: 500;
535
- color: #000000d9;
536
- line-height: 32px;
537
- margin-bottom: 12px;
538
- }
539
- </style>
1
+ <template>
2
+ <a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
3
+ <a-col
4
+ :xs="14"
5
+ :sm="14"
6
+ :md="12"
7
+ :lg="9"
8
+ :xl="6"
9
+ :xxl="5"
10
+ v-if="xTreeConfigName"
11
+ :style="{ maxWidth: '400px'}">
12
+ <x-tree
13
+ :config-name="xTreeConfigName"
14
+ :env="env"
15
+ @action="action"
16
+ @btnFuncClick="treeBtnFuncClick"
17
+ @treeOnChecked="treeOnChecked"
18
+ ref="xtree"
19
+ ></x-tree>
20
+ </a-col>
21
+ <a-col
22
+ :xs="xTreeConfigName ? 10 : 24"
23
+ :sm="xTreeConfigName ? 10 : 24"
24
+ :md="xTreeConfigName ? 12 : 24"
25
+ :lg="xTreeConfigName ? 15 : 24"
26
+ :xl="xTreeConfigName ? 18 : 24"
27
+ :xxl="xTreeConfigName ? 19 : 24">
28
+ <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
29
+ <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
30
+ <div v-show="!loading">
31
+ <template v-if="!loadError">
32
+ <x-add-form
33
+ ref="xAddForm"
34
+ @afterSubmit="onAddOrEditSubmitAfterSubmit"
35
+ >
36
+ <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
37
+ <slot
38
+ name="groupFormItems"
39
+ :form="form"
40
+ :model="model"
41
+ :rules="rules"
42
+ :modifyModelData="modifyModelData"></slot>
43
+ </template>
44
+ </x-add-form>
45
+ <div v-if="crudTitle" class="crud_title">
46
+ {{ crudTitle }}
47
+ </div>
48
+ <x-form
49
+ ref="xForm"
50
+ @toggleAdvanced="toggleAdvanced"
51
+ @onSubmit="onSearchSubmit">
52
+ <slot name="formBtnExpand"></slot>
53
+ </x-form>
54
+ <x-table
55
+ ref="xTable"
56
+ :fixedQueryForm="fixedQueryForm"
57
+ :queryParamsName="queryParamsName"
58
+ :query-params-json="queryParamsJson"
59
+ :show-pagination="showPagination"
60
+ :customDelete="customDelete"
61
+ :extraHeight="extraHeight"
62
+ @add="add"
63
+ @edit="edit"
64
+ @del="del"
65
+ @afterDelete="afterDelete"
66
+ @action="action"
67
+ @selectRow="selectRow"
68
+ @afterQuery="afterQuery"
69
+ @tempTableEdit="tempTableEdit"
70
+ :card-mode-config="cardModeConfig"
71
+ :allow-card-mode="allowedCardMode">
72
+ <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
73
+ <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
74
+ </template>
75
+ <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
76
+ <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
77
+ </template>
78
+ <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
79
+ <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
80
+ <a-tooltip title="收起查询条件" placement="bottom">
81
+ <a-button @click="toggleIsFormShow">
82
+ <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
83
+ </a-button>
84
+ </a-tooltip>
85
+ </template>
86
+ <!-- 底部插槽 -->
87
+ <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
88
+ <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
89
+ </template>
90
+ <!-- excel导入说明插槽 -->
91
+ <template #importExcelSlot>
92
+ <slot name="importExcelSlot"></slot>
93
+ </template>
94
+ </x-table>
95
+ </template>
96
+ <template v-else>
97
+ <a-empty>
98
+ <span slot="description"> 页面配置不存在请联系系统管理员, </span>
99
+ </a-empty>
100
+ </template>
101
+ </div>
102
+ </a-col>
103
+ </a-row>
104
+ </template>
105
+ <script>
106
+ import XForm from '@vue2-client/base-client/components/common/XForm'
107
+ import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
108
+ import XTable from '@vue2-client/base-client/components/common/XTable'
109
+ import XTree from '@vue2-client/base-client/components/common/XTree'
110
+ import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
111
+ import {
112
+ getConfigByName,
113
+ getConfigByLogic,
114
+ parseConfig,
115
+ } from '@vue2-client/services/api/common'
116
+ import { mapState } from 'vuex'
117
+ import lowcodeComponentMixin from '@vue2-client/utils/lowcode/lowcodeComponentMixin'
118
+
119
+ export default {
120
+ name: 'XFormTable',
121
+ components: {
122
+ XTable,
123
+ XForm,
124
+ XTree,
125
+ XAddForm,
126
+ XImportExcel
127
+ },
128
+ data () {
129
+ return {
130
+ // 加载状态
131
+ loading: false,
132
+ // 图标样式
133
+ iconStyle: {
134
+ position: 'relative',
135
+ top: '1px'
136
+ },
137
+ loadError: false,
138
+ // 实际查询配置内容
139
+ realQueryConfig: {},
140
+ toggleIsFormIcon: 'vertical-align-top',
141
+ table_selectedRowKeys: [],
142
+ table_selectedRows: [],
143
+ allowedCardMode: false,
144
+ cardModeConfig: undefined
145
+ }
146
+ },
147
+ computed: {
148
+ ...mapState('setting', ['isMobile'])
149
+ },
150
+ mixins: [lowcodeComponentMixin],
151
+ props: {
152
+ // 业务名称
153
+ title: {
154
+ type: String,
155
+ default: ''
156
+ },
157
+ // 卡片标题
158
+ crudTitle: {
159
+ type: String,
160
+ default: null
161
+ },
162
+ // 查询配置文件名
163
+ queryParamsName: {
164
+ type: String,
165
+ default: null
166
+ },
167
+ // 配置所属命名空间
168
+ serviceName: {
169
+ type: String,
170
+ default: undefined
171
+ },
172
+ // 查询配置文件Json,用于查询配置生成器的预览
173
+ queryParamsJson: {
174
+ type: Object,
175
+ default: null
176
+ },
177
+ // xTree 配置
178
+ xTreeConfigName: {
179
+ type: String,
180
+ default: null
181
+ },
182
+ // 业务逻辑名称, 通过logic获取表单表格配置
183
+ logicName: {
184
+ type: String,
185
+ default: null
186
+ },
187
+ // 执行logic传递的参数
188
+ logicParam: {
189
+ type: Object,
190
+ default: () => {
191
+ }
192
+ },
193
+ // 固定新增表单
194
+ fixedAddForm: {
195
+ type: Object,
196
+ default: () => {
197
+ return {}
198
+ }
199
+ },
200
+ // 固定查询表单
201
+ fixedQueryForm: {
202
+ type: Object,
203
+ default: () => {
204
+ return {}
205
+ }
206
+ },
207
+ // 预览模式
208
+ viewMode: {
209
+ type: Boolean,
210
+ default: () => {
211
+ return false
212
+ }
213
+ },
214
+ // 环境
215
+ env: {
216
+ type: String,
217
+ default: () => {
218
+ return 'prod'
219
+ }
220
+ },
221
+ // 数据只有一页时是否展示分页,true:展示,auto:隐藏
222
+ showPagination: {
223
+ type: Boolean,
224
+ default: true
225
+ },
226
+ // 调用logic获取数据源的追加参数
227
+ getDataParams: {
228
+ type: Object,
229
+ default: undefined
230
+ },
231
+ // 可以控制组件中导出等按钮的隐藏
232
+ buttonState: {
233
+ type: Object,
234
+ default: undefined
235
+ },
236
+ // 是否自定义新增按钮的功能
237
+ customAdd: {
238
+ type: Boolean,
239
+ default: false
240
+ },
241
+ // 是否自定义删除按钮的功能
242
+ customDelete: {
243
+ type: Boolean,
244
+ default: false
245
+ },
246
+ // 是否自定义修改按钮的功能
247
+ customEdit: {
248
+ type: Boolean,
249
+ default: false
250
+ },
251
+ // 自适应底部边距
252
+ extraHeight: {
253
+ type: Number,
254
+ default: 80
255
+ }
256
+ },
257
+ watch: {
258
+ logicParam: {
259
+ handler () {
260
+ this.initConfig()
261
+ },
262
+ deep: true
263
+ },
264
+ queryParamsJson: {
265
+ handler () {
266
+ this.initConfig()
267
+ },
268
+ deep: true
269
+ },
270
+ queryParamsName: {
271
+ handler () {
272
+ this.initConfig()
273
+ }
274
+ },
275
+ serviceName: {
276
+ handler () {
277
+ this.initConfig()
278
+ }
279
+ }
280
+ },
281
+ created () {
282
+ this.initConfig()
283
+ },
284
+ methods: {
285
+ initConfig () {
286
+ this.loading = true
287
+ this.loadError = false
288
+ if (this.queryParamsName) {
289
+ this.getConfig()
290
+ } else if (this.queryParamsJson) {
291
+ this.getConfigBySource()
292
+ } else if (this.logicName && this.logicParam) {
293
+ this.getColumnJsonByLogic()
294
+ } else {
295
+ this.loading = false
296
+ this.loadError = true
297
+ }
298
+ },
299
+ getConfig () {
300
+ getConfigByName(this.queryParamsName, this.serviceName, (res) => {
301
+ this.allowedCardMode = res.allowedCardMode
302
+ this.cardModeConfig = res.cardModeConfig
303
+ this.updateComponents(res)
304
+ }, this.env === 'dev')
305
+ },
306
+ getConfigBySource () {
307
+ parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
308
+ this.updateComponents(res, true)
309
+ })
310
+ },
311
+ getColumnJsonByLogic () {
312
+ getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
313
+ this.updateComponents(res, true)
314
+ }, this.env === 'dev')
315
+ },
316
+ /**
317
+ * 更新子组件
318
+ * @param res 参数
319
+ * @param setQueryParams 是否设置queryParams参数
320
+ */
321
+ updateComponents (res, setQueryParams) {
322
+ this.realQueryConfig = res
323
+ if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
324
+ this.$refs.xForm.init({
325
+ formItems: res.formJson,
326
+ serviceName: this.serviceName,
327
+ getDataParams: this.getDataParams,
328
+ env: this.env
329
+ })
330
+ this.$refs.xTable.init({
331
+ queryParams: setQueryParams ? res : null,
332
+ tableColumns: res.columnJson,
333
+ buttonState: Object.assign(res.buttonState, this.buttonState),
334
+ title: this.title,
335
+ viewMode: this.viewMode,
336
+ tableSummaryMap: res.tableSummaryMap,
337
+ isTableTemp: this.isTableTemp,
338
+ serviceName: this.serviceName,
339
+ env: this.env,
340
+ form: this.$refs.xForm.form
341
+ })
342
+ }
343
+ this.loading = false
344
+ },
345
+ /**
346
+ * 提交查询表单事件
347
+ * @param res 参数
348
+ */
349
+ onSearchSubmit (res) {
350
+ if (res.valid) {
351
+ // 表单赋值
352
+ this.$refs.xTable.setQueryForm(res.form)
353
+ // commit
354
+ this.$emit('afterSearchSubmit', res)
355
+ } else {
356
+ return false
357
+ }
358
+ },
359
+ active (props) {
360
+ let num = false
361
+ for (const key in props) {
362
+ // eslint-disable-next-line no-prototype-builtins
363
+ if (this.$props.hasOwnProperty(key)) {
364
+ console.log('key', this.$props[key] instanceof Object)
365
+ if (this.$props[key] instanceof Object) {
366
+ this.$props[key] = JSON.parse(props[key])
367
+ } else {
368
+ this.$props[key] = props[key]
369
+ }
370
+ num = true
371
+ }
372
+ console.log(key, props[key])
373
+ }
374
+ console.warn('activeProps', this.$props)
375
+ if (num) {
376
+ this.initConfig()
377
+ }
378
+ },
379
+ /**
380
+ * 提交新增/修改表单后事件
381
+ */
382
+ onAddOrEditSubmitAfterSubmit (res) {
383
+ this.refreshTable(res.businessType === '新增')
384
+ // commit
385
+ this.$emit('afterSubmit', res)
386
+ },
387
+ /**
388
+ * 表格查询后事件
389
+ * @param res 参数
390
+ * @param conditionParams 查询条件
391
+ */
392
+ afterQuery (res, conditionParams) {
393
+ this.$emit('afterQuery', res, conditionParams)
394
+ },
395
+ /**
396
+ * 详情按钮事件
397
+ * @param record 本条数据
398
+ * @param id 数据标识
399
+ * @param actionType 操作类型
400
+ * @param fun 向上级传递的事件
401
+ */
402
+ action (record, id, actionType, fun = 'action') {
403
+ this.$emit(fun, record, id, actionType)
404
+ this.$lowCodeEmit(fun, record)
405
+ },
406
+ treeOnChecked (checkedKeys, deepNodes, deepKeys) {
407
+ this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
408
+ },
409
+ treeBtnFuncClick (index, func) {
410
+ this.$emit('treeBtnFuncClick', index, func)
411
+ },
412
+ /**
413
+ * 新增按钮事件
414
+ */
415
+ del (keys, callback) {
416
+ if (this.customDelete) {
417
+ this.$emit('del', keys, callback)
418
+ }
419
+ },
420
+ /**
421
+ * 新增按钮事件
422
+ */
423
+ add () {
424
+ if (this.customAdd) {
425
+ this.$emit('add')
426
+ } else {
427
+ const res = this.realQueryConfig
428
+ this.$refs.xAddForm.init({
429
+ businessType: '新增',
430
+ title: this.title,
431
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
432
+ configName: this.queryParamsName,
433
+ configContent: this.queryParamsJson,
434
+ formItems: res.formJson,
435
+ viewMode: this.viewMode,
436
+ isTableTemp: this.isTableTemp,
437
+ serviceName: this.serviceName,
438
+ fixedAddForm: this.fixedAddForm,
439
+ getDataParams: this.getDataParams,
440
+ layout: res.xAddFormLayout || 'horizontal',
441
+ env: this.env
442
+ })
443
+ }
444
+ },
445
+ /**
446
+ * 修改按钮事件
447
+ * @param modifyModelData 修改表单数据
448
+ */
449
+ edit (modifyModelData) {
450
+ if (this.customAdd) {
451
+ this.$emit('edit')
452
+ } else {
453
+ const res = this.realQueryConfig
454
+ this.$refs.xAddForm.init({
455
+ businessType: '修改',
456
+ title: this.title,
457
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
458
+ configName: this.queryParamsName,
459
+ configContent: this.queryParamsJson,
460
+ formItems: res.formJson,
461
+ viewMode: this.viewMode,
462
+ isTableTemp: this.isTableTemp,
463
+ serviceName: this.serviceName,
464
+ fixedAddForm: this.fixedAddForm,
465
+ getDataParams: this.getDataParams,
466
+ modifyModelData: modifyModelData,
467
+ layout: res.xAddFormLayout || 'horizontal',
468
+ env: this.env
469
+ })
470
+ }
471
+ },
472
+ /**
473
+ * 删除后事件
474
+ * @param res
475
+ */
476
+ afterDelete (res) {
477
+ this.$emit('afterDelete', res)
478
+ },
479
+ /**
480
+ * 更多条件是否展示
481
+ */
482
+ toggleAdvanced () {
483
+ this.$refs.xTable.setScrollYHeight({})
484
+ },
485
+ /**
486
+ * 查询表单部分显示/隐藏切换
487
+ */
488
+ toggleIsFormShow () {
489
+ this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
490
+ this.$refs.xForm.toggleVisible()
491
+ this.$refs.xTable.setScrollYHeight({})
492
+ },
493
+ /**
494
+ * 选择列事件
495
+ * @param selectedRowKeys 选中列Key集合
496
+ * @param selectedRows 选中列
497
+ */
498
+ selectRow (selectedRowKeys, selectedRows) {
499
+ this.table_selectedRowKeys = selectedRowKeys
500
+ this.table_selectedRows = selectedRows
501
+ this.$emit('selectRow', selectedRowKeys, selectedRows)
502
+ },
503
+ /**
504
+ * 临时表修改
505
+ * @param res 参数
506
+ */
507
+ tempTableEdit (res) {
508
+ this.$emit('tempTableEdit', res)
509
+ },
510
+ /**
511
+ * 刷新表格
512
+ * @param toFirstPage 是否到第一页
513
+ */
514
+ refreshTable (toFirstPage = true) {
515
+ this.$refs.xTable.refresh(toFirstPage)
516
+ },
517
+ },
518
+ action: {
519
+ /**
520
+ * 实现doAction方法
521
+ */
522
+ doAction (actionType, args, data) {
523
+ switch (actionType) {
524
+ case 'refreshTable':
525
+ for (const item in args) {
526
+ console.log('item', item)
527
+ }
528
+ break
529
+ default:
530
+ break
531
+ }
532
+ }
533
+ }
534
+ }
535
+ </script>
536
+ <style lang="less" scoped>
537
+ .crud_title {
538
+ height: 32px;
539
+ font-size: 16px;
540
+ font-weight: 500;
541
+ color: #000000d9;
542
+ line-height: 32px;
543
+ margin-bottom: 12px;
544
+ }
545
+ </style>