vue2-client 1.8.259 → 1.8.261

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