vue2-client 1.6.49 → 1.7.0

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 (119) hide show
  1. package/.env +15 -15
  2. package/CHANGELOG.md +628 -625
  3. package/index.js +30 -30
  4. package/package.json +81 -81
  5. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
  6. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  7. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +667 -667
  8. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
  9. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +468 -462
  10. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
  11. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +146 -140
  12. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  13. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  14. package/src/base-client/components/common/Upload/Upload.vue +168 -168
  15. package/src/base-client/components/common/XAddForm/XAddForm.vue +325 -325
  16. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +279 -279
  17. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  18. package/src/base-client/components/common/XForm/XForm.vue +180 -180
  19. package/src/base-client/components/common/XForm/XFormItem.vue +513 -513
  20. package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
  21. package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
  22. package/src/base-client/components/common/XFormTable/XFormTable.vue +344 -336
  23. package/src/base-client/components/common/XFormTable/index.md +97 -97
  24. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
  25. package/src/base-client/components/common/XTable/XTable.vue +506 -506
  26. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
  27. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  28. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  29. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  30. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  31. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  32. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  33. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  34. package/src/base-client/plugins/AppData.js +76 -76
  35. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  36. package/src/base-client/plugins/PagedList.js +177 -177
  37. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  38. package/src/base-client/plugins/i18n-extend.js +32 -32
  39. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  40. package/src/components/Ellipsis/index.md +38 -38
  41. package/src/components/NumberInfo/index.md +43 -43
  42. package/src/components/STable/README.md +341 -341
  43. package/src/components/STable/index.js +318 -318
  44. package/src/components/Trend/index.md +45 -45
  45. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  46. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  47. package/src/components/exception/ExceptionPage.vue +70 -70
  48. package/src/components/form/FormRow.vue +52 -52
  49. package/src/components/index.js +36 -36
  50. package/src/components/menu/SideMenu.vue +62 -62
  51. package/src/components/menu/menu.js +273 -273
  52. package/src/components/page/header/index.less +40 -40
  53. package/src/components/setting/Setting.vue +235 -235
  54. package/src/components/table/StandardTable.vue +141 -141
  55. package/src/components/table/advance/ActionColumns.vue +158 -158
  56. package/src/components/table/advance/SearchArea.vue +355 -355
  57. package/src/components/tool/AStepItem.vue +60 -60
  58. package/src/components/tool/AvatarList.vue +68 -68
  59. package/src/components/tool/Drawer.vue +142 -142
  60. package/src/components/tool/TagSelect.vue +83 -83
  61. package/src/components/transition/PageToggleTransition.vue +97 -97
  62. package/src/config/CreateQueryConfig.js +307 -307
  63. package/src/config/default/admin.config.js +18 -18
  64. package/src/config/replacer/resolve.config.js +67 -67
  65. package/src/layouts/CommonLayout.vue +42 -42
  66. package/src/layouts/ComponentLayoutOne.vue +47 -47
  67. package/src/layouts/PageLayout.vue +151 -151
  68. package/src/layouts/SinglePageView.vue +116 -116
  69. package/src/layouts/footer/PageFooter.vue +49 -49
  70. package/src/layouts/header/AdminHeader.vue +134 -134
  71. package/src/layouts/header/HeaderAvatar.vue +64 -64
  72. package/src/layouts/header/HeaderNotice.vue +176 -176
  73. package/src/layouts/header/HeaderSearch.vue +67 -67
  74. package/src/layouts/header/InstitutionDetail.vue +181 -181
  75. package/src/layouts/header/index.less +92 -92
  76. package/src/layouts/tabs/TabsHead.vue +190 -190
  77. package/src/layouts/tabs/TabsView.vue +379 -379
  78. package/src/mock/goods/index.js +108 -108
  79. package/src/pages/CreateQueryPage.vue +84 -84
  80. package/src/pages/login/Login.vue +369 -369
  81. package/src/pages/report/ReportTable.js +124 -124
  82. package/src/pages/report/ReportTableHome.vue +28 -28
  83. package/src/pages/resourceManage/orgListManage.vue +98 -98
  84. package/src/pages/system/dictionary/index.vue +43 -43
  85. package/src/pages/system/file/index.vue +317 -317
  86. package/src/pages/system/monitor/loginInfor/index.vue +36 -36
  87. package/src/pages/system/monitor/operLog/index.vue +36 -36
  88. package/src/pages/system/settings/index.vue +126 -126
  89. package/src/pages/system/settings/modifyPassword.vue +109 -109
  90. package/src/router/async/config.async.js +28 -28
  91. package/src/router/async/router.map.js +66 -68
  92. package/src/router/index.js +27 -27
  93. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  94. package/src/services/api/LogDetailsViewApi.js +10 -10
  95. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  96. package/src/services/api/TicketDetailsViewApi.js +34 -34
  97. package/src/services/api/cas.js +79 -79
  98. package/src/services/api/common.js +137 -132
  99. package/src/services/api/commonTempTable.js +10 -10
  100. package/src/services/api/index.js +17 -17
  101. package/src/services/api/logininfor/index.js +6 -6
  102. package/src/services/api/manage.js +8 -8
  103. package/src/services/apiService.js +14 -14
  104. package/src/services/user.js +67 -67
  105. package/src/store/modules/index.js +4 -4
  106. package/src/theme/default/nprogress.less +76 -76
  107. package/src/theme/default/style.less +58 -58
  108. package/src/utils/EncryptUtil.js +53 -53
  109. package/src/utils/colors.js +107 -107
  110. package/src/utils/excel/Blob.js +180 -180
  111. package/src/utils/excel/Export2Excel.js +141 -141
  112. package/src/utils/formatter.js +68 -68
  113. package/src/utils/i18n.js +80 -80
  114. package/src/utils/map-utils.js +37 -37
  115. package/src/utils/theme-color-replacer-extend.js +91 -91
  116. package/src/utils/themeUtil.js +100 -100
  117. package/src/utils/util.js +230 -230
  118. package/vue.config.js +106 -106
  119. package/src/pages/system/queryParams/index.vue +0 -43
@@ -1,336 +1,344 @@
1
- <template>
2
- <div>
3
- <a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
4
- <div v-show="!loading">
5
- <x-add-form
6
- ref="xAddForm"
7
- :get-data-params="getDataParams"
8
- @onSubmit="onAddOrEditSubmit"
9
- />
10
- <x-form
11
- ref="xForm"
12
- :get-data-params="getDataParams"
13
- style="margin-bottom: 14px;"
14
- @onSubmit="onSearchSubmit">
15
- <slot name="formBtnExpand"></slot>
16
- </x-form>
17
- <x-table
18
- ref="xTable"
19
- :fixedQueryForm="fixedQueryForm"
20
- :queryParamsName="queryParamsName"
21
- :query-params-json="queryParamsJson"
22
- :show-pagination="showPagination"
23
- @add="add"
24
- @edit="edit"
25
- @afterDelete="afterDelete"
26
- @action="action"
27
- @selectRow="selectRow"
28
- @afterQuery="afterQuery"
29
- @tempTableEdit="tempTableEdit">
30
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
31
- <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
32
- </template>
33
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
34
- <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
35
- <a-button @click="toggleIsFormShow">
36
- <a-icon :style="iconStyle" type="vertical-align-top"/>
37
- </a-button>
38
- </template>
39
- <!-- 底部插槽 -->
40
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
41
- <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
42
- </template>
43
- </x-table>
44
- </div>
45
- </div>
46
- </template>
47
- <script>
48
- import XForm from '@vue2-client/base-client/components/common/XForm'
49
- import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
50
- import XTable from '@vue2-client/base-client/components/common/XTable'
51
- import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
52
- import { addOrModify, commonApi } from '@vue2-client/services/api/common'
53
- import { indexedDB } from '@vue2-client/utils/indexedDB'
54
- import { mapState } from 'vuex'
55
- import { post } from '@vue2-client/services/api/restTools'
56
-
57
- export default {
58
- name: 'XFormTable',
59
- components: {
60
- XTable,
61
- XForm,
62
- XAddForm,
63
- XImportExcel
64
- },
65
- data () {
66
- return {
67
- // 加载状态
68
- loading: false,
69
- // 图标样式
70
- iconStyle: {
71
- position: 'relative',
72
- top: '1px'
73
- }
74
- }
75
- },
76
- computed: {
77
- ...mapState('setting', ['isMobile'])
78
- },
79
- props: {
80
- // 业务名称
81
- title: {
82
- type: String,
83
- default: ''
84
- },
85
- // 查询配置文件名
86
- queryParamsName: {
87
- type: String,
88
- default: null
89
- },
90
- // 查询配置文件Json,用于查询配置生成器的预览
91
- queryParamsJson: {
92
- type: Object,
93
- default: null
94
- },
95
- // 业务逻辑名称, 通过logic获取表单表格配置
96
- logicName: {
97
- type: String,
98
- default: null
99
- },
100
- // 执行logic传递的参数
101
- logicParam: {
102
- type: Object,
103
- default: () => {}
104
- },
105
- // 固定新增表单
106
- fixedAddForm: {
107
- type: Object,
108
- default: () => {
109
- return {}
110
- }
111
- },
112
- // 固定查询表单
113
- fixedQueryForm: {
114
- type: Object,
115
- default: () => {
116
- return {}
117
- }
118
- },
119
- // 预览模式
120
- viewMode: {
121
- type: Boolean,
122
- default: () => {
123
- return false
124
- }
125
- },
126
- // 数据只有一页时是否展示分页,true:展示,auto:隐藏
127
- showPagination: {
128
- type: Boolean,
129
- default: true
130
- },
131
- // 调用logic获取数据源的追加参数
132
- getDataParams: {
133
- type: Object,
134
- default: undefined
135
- }
136
- },
137
- watch: {
138
- logicParam: {
139
- handler () {
140
- this.getColumnJsonByLogic()
141
- },
142
- deep: true
143
- },
144
- fixedQueryForm: {
145
- handler () {
146
- this.$nextTick(() => {
147
- this.refreshTable(true)
148
- })
149
- },
150
- deep: true
151
- },
152
- queryParamsJson: {
153
- handler () {
154
- this.getColumnsJsonBySource()
155
- },
156
- deep: true
157
- },
158
- queryParamsName: {
159
- handler () {
160
- this.getColumnsJson()
161
- }
162
- }
163
- },
164
- created () {
165
- if (this.queryParamsName) {
166
- this.getColumnsJson()
167
- } else if (this.queryParamsJson) {
168
- this.getColumnsJsonBySource()
169
- }
170
- },
171
- methods: {
172
- getColumnsJson () {
173
- this.loading = true
174
- indexedDB.getByWeb(this.queryParamsName, commonApi.getColumnsJson, { str: this.queryParamsName }, (res) => {
175
- this.updateComponents(res)
176
- })
177
- },
178
- getColumnsJsonBySource () {
179
- this.loading = true
180
- post(commonApi.getColumnsJson, { queryObject: this.queryParamsJson }).then(res => {
181
- this.updateComponents(res, true)
182
- })
183
- },
184
- getColumnJsonByLogic () {
185
- this.loading = true
186
- indexedDB.getByWeb(`${this.logicName}_${JSON.stringify(this.logicParam)}`, commonApi.getColumnsJson, { logic: this.logicName, logicParam: this.logicParam }, (res) => {
187
- this.updateComponents(res, true)
188
- })
189
- },
190
- /**
191
- * 更新子组件
192
- * @param res 参数
193
- * @param setQueryParams 是否设置queryParams参数
194
- */
195
- updateComponents (res, setQueryParams) {
196
- if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
197
- this.$refs.xTable.init({
198
- queryParams: setQueryParams ? res : null,
199
- tableColumns: res.columnJson,
200
- buttonState: res.buttonState,
201
- title: this.title,
202
- viewMode: this.viewMode,
203
- isTableTemp: this.isTableTemp,
204
- serviceName: res.serviceName
205
- })
206
- this.$refs.xForm.init({
207
- formItems: res.formJson,
208
- serviceName: res.serviceName
209
- })
210
- this.$refs.xAddForm.init({
211
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
212
- formItems: res.formJson,
213
- viewMode: this.viewMode,
214
- isTableTemp: this.isTableTemp,
215
- serviceName: res.serviceName
216
- })
217
- }
218
- this.loading = false
219
- },
220
- /**
221
- * 提交查询表单事件
222
- * @param res 参数
223
- */
224
- onSearchSubmit (res) {
225
- if (res.valid) {
226
- // 表单赋值
227
- this.$refs.xTable.setQueryForm(res.form)
228
- // commit
229
- this.$emit('afterSearchSubmit', res)
230
- } else {
231
- return false
232
- }
233
- },
234
- /**
235
- * 提交新增表单事件
236
- */
237
- onAddOrEditSubmit (res, callback) {
238
- // 组织请求
239
- const requestParameters = {
240
- queryParamsName: this.queryParamsName,
241
- queryParams: this.queryParamsJson,
242
- form: res.realForm,
243
- businessType: res.businessType,
244
- operator: res.currUserName
245
- }
246
- addOrModify(requestParameters, res.serviceName).then(data => {
247
- this.$message.success(res.businessType + '成功!')
248
- this.refreshTable(res.businessType === '新增')
249
- // commit
250
- this.$emit('afterSubmit', { type: res.businessType, id: data.id, form: requestParameters.form })
251
- }).catch(e => {
252
- this.$message.error(res.businessType + '失败:' + e)
253
- }).finally(() => {
254
- callback()
255
- })
256
- },
257
- /**
258
- * 表格查询后事件
259
- * @param res 参数
260
- * @param conditionParams 查询条件
261
- */
262
- afterQuery (res, conditionParams) {
263
- this.$emit('afterQuery', res, conditionParams)
264
- },
265
- /**
266
- * 详情按钮事件
267
- * @param record 本条数据
268
- * @param id 数据标识
269
- * @param actionType 操作类型
270
- */
271
- action (record, id, actionType) {
272
- this.$emit('action', record, id, actionType)
273
- },
274
- /**
275
- * 新增按钮事件
276
- */
277
- add () {
278
- this.$refs.xAddForm.open({
279
- businessType: '新增',
280
- title: this.title,
281
- fixedAddForm: this.fixedAddForm
282
- })
283
- },
284
- /**
285
- * 修改按钮事件
286
- * @param res 参数
287
- */
288
- edit (res) {
289
- this.$refs.xAddForm.open({
290
- businessType: '修改',
291
- modifyModelData: res,
292
- title: this.title,
293
- fixedAddForm: this.fixedAddForm
294
- })
295
- },
296
- /**
297
- * 删除后事件
298
- * @param res
299
- */
300
- afterDelete (res) {
301
- this.$emit('afterDelete', res)
302
- },
303
- /**
304
- * 查询表单部分显示/隐藏切换
305
- */
306
- toggleIsFormShow () {
307
- this.$refs.xForm.toggleVisible()
308
- },
309
- /**
310
- * 选择列事件
311
- * @param selectedRowKeys 选中列Key集合
312
- * @param selectedRows 选中列
313
- */
314
- selectRow (selectedRowKeys, selectedRows) {
315
- this.$emit('selectRow', selectedRowKeys, selectedRows)
316
- },
317
- /**
318
- * 临时表修改
319
- * @param res 参数
320
- */
321
- tempTableEdit (res) {
322
- this.$emit('tempTableEdit', res)
323
- },
324
- /**
325
- * 刷新表格
326
- * @param toFirstPage 是否到第一页
327
- */
328
- refreshTable (toFirstPage = true) {
329
- this.$refs.xTable.refresh(toFirstPage)
330
- },
331
- }
332
- }
333
- </script>
334
- <style lang="less" scoped>
335
-
336
- </style>
1
+ <template>
2
+ <div>
3
+ <a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
4
+ <div v-show="!loading">
5
+ <x-add-form
6
+ ref="xAddForm"
7
+ :get-data-params="getDataParams"
8
+ @onSubmit="onAddOrEditSubmit"
9
+ />
10
+ <x-form
11
+ ref="xForm"
12
+ :get-data-params="getDataParams"
13
+ style="margin-bottom: 14px;"
14
+ @onSubmit="onSearchSubmit">
15
+ <slot name="formBtnExpand"></slot>
16
+ </x-form>
17
+ <x-table
18
+ ref="xTable"
19
+ :fixedQueryForm="fixedQueryForm"
20
+ :queryParamsName="queryParamsName"
21
+ :query-params-json="queryParamsJson"
22
+ :show-pagination="showPagination"
23
+ @add="add"
24
+ @edit="edit"
25
+ @afterDelete="afterDelete"
26
+ @action="action"
27
+ @selectRow="selectRow"
28
+ @afterQuery="afterQuery"
29
+ @tempTableEdit="tempTableEdit">
30
+ <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
31
+ <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
32
+ </template>
33
+ <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
34
+ <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
35
+ <a-button @click="toggleIsFormShow">
36
+ <a-icon :style="iconStyle" type="vertical-align-top"/>
37
+ </a-button>
38
+ </template>
39
+ <!-- 底部插槽 -->
40
+ <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
41
+ <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
42
+ </template>
43
+ </x-table>
44
+ </div>
45
+ </div>
46
+ </template>
47
+ <script>
48
+ import XForm from '@vue2-client/base-client/components/common/XForm'
49
+ import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
50
+ import XTable from '@vue2-client/base-client/components/common/XTable'
51
+ import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
52
+ import { addOrModify, getConfigUrl } from '@vue2-client/services/api/common'
53
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
54
+ import { mapState } from 'vuex'
55
+ import { post } from '@vue2-client/services/api/restTools'
56
+
57
+ export default {
58
+ name: 'XFormTable',
59
+ components: {
60
+ XTable,
61
+ XForm,
62
+ XAddForm,
63
+ XImportExcel
64
+ },
65
+ data () {
66
+ return {
67
+ // 加载状态
68
+ loading: false,
69
+ // 图标样式
70
+ iconStyle: {
71
+ position: 'relative',
72
+ top: '1px'
73
+ }
74
+ }
75
+ },
76
+ computed: {
77
+ ...mapState('setting', ['isMobile'])
78
+ },
79
+ props: {
80
+ // 业务名称
81
+ title: {
82
+ type: String,
83
+ default: ''
84
+ },
85
+ // 查询配置文件名
86
+ queryParamsName: {
87
+ type: String,
88
+ default: null
89
+ },
90
+ // 配置所属命名空间
91
+ serviceName: {
92
+ type: String,
93
+ default: undefined
94
+ },
95
+ // 查询配置文件Json,用于查询配置生成器的预览
96
+ queryParamsJson: {
97
+ type: Object,
98
+ default: null
99
+ },
100
+ // 业务逻辑名称, 通过logic获取表单表格配置
101
+ logicName: {
102
+ type: String,
103
+ default: null
104
+ },
105
+ // 执行logic传递的参数
106
+ logicParam: {
107
+ type: Object,
108
+ default: () => {}
109
+ },
110
+ // 固定新增表单
111
+ fixedAddForm: {
112
+ type: Object,
113
+ default: () => {
114
+ return {}
115
+ }
116
+ },
117
+ // 固定查询表单
118
+ fixedQueryForm: {
119
+ type: Object,
120
+ default: () => {
121
+ return {}
122
+ }
123
+ },
124
+ // 预览模式
125
+ viewMode: {
126
+ type: Boolean,
127
+ default: () => {
128
+ return false
129
+ }
130
+ },
131
+ // 数据只有一页时是否展示分页,true:展示,auto:隐藏
132
+ showPagination: {
133
+ type: Boolean,
134
+ default: true
135
+ },
136
+ // 调用logic获取数据源的追加参数
137
+ getDataParams: {
138
+ type: Object,
139
+ default: undefined
140
+ }
141
+ },
142
+ watch: {
143
+ logicParam: {
144
+ handler () {
145
+ this.getColumnJsonByLogic()
146
+ },
147
+ deep: true
148
+ },
149
+ fixedQueryForm: {
150
+ handler () {
151
+ this.$nextTick(() => {
152
+ this.refreshTable(true)
153
+ })
154
+ },
155
+ deep: true
156
+ },
157
+ queryParamsJson: {
158
+ handler () {
159
+ this.getColumnsJsonBySource()
160
+ },
161
+ deep: true
162
+ },
163
+ queryParamsName: {
164
+ handler () {
165
+ this.getColumnsJson()
166
+ }
167
+ }
168
+ },
169
+ created () {
170
+ if (this.queryParamsName) {
171
+ this.getColumnsJson()
172
+ } else if (this.queryParamsJson) {
173
+ this.getColumnsJsonBySource()
174
+ }
175
+ },
176
+ methods: {
177
+ getColumnsJson () {
178
+ this.loading = true
179
+ const url = getConfigUrl(this.serviceName)
180
+ indexedDB.getByWeb(this.queryParamsName, url, { configName: this.queryParamsName }, (res) => {
181
+ this.updateComponents(res)
182
+ })
183
+ },
184
+ getColumnsJsonBySource () {
185
+ this.loading = true
186
+ const url = getConfigUrl(this.serviceName)
187
+ post(url, { queryObject: this.queryParamsJson }).then(res => {
188
+ this.updateComponents(res, true)
189
+ })
190
+ },
191
+ getColumnJsonByLogic () {
192
+ this.loading = true
193
+ const url = getConfigUrl(this.serviceName)
194
+ indexedDB.getByWeb(`${this.logicName}_${JSON.stringify(this.logicParam)}`, url, { logic: this.logicName, logicParam: this.logicParam }, (res) => {
195
+ this.updateComponents(res, true)
196
+ })
197
+ },
198
+ /**
199
+ * 更新子组件
200
+ * @param res 参数
201
+ * @param setQueryParams 是否设置queryParams参数
202
+ */
203
+ updateComponents (res, setQueryParams) {
204
+ if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
205
+ this.$refs.xTable.init({
206
+ queryParams: setQueryParams ? res : null,
207
+ tableColumns: res.columnJson,
208
+ buttonState: res.buttonState,
209
+ title: this.title,
210
+ viewMode: this.viewMode,
211
+ isTableTemp: this.isTableTemp,
212
+ serviceName: res.serviceName
213
+ })
214
+ this.$refs.xForm.init({
215
+ formItems: res.formJson,
216
+ serviceName: res.serviceName
217
+ })
218
+ this.$refs.xAddForm.init({
219
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
220
+ formItems: res.formJson,
221
+ viewMode: this.viewMode,
222
+ isTableTemp: this.isTableTemp,
223
+ serviceName: res.serviceName
224
+ })
225
+ }
226
+ this.loading = false
227
+ },
228
+ /**
229
+ * 提交查询表单事件
230
+ * @param res 参数
231
+ */
232
+ onSearchSubmit (res) {
233
+ if (res.valid) {
234
+ // 表单赋值
235
+ this.$refs.xTable.setQueryForm(res.form)
236
+ // commit
237
+ this.$emit('afterSearchSubmit', res)
238
+ } else {
239
+ return false
240
+ }
241
+ },
242
+ /**
243
+ * 提交新增表单事件
244
+ */
245
+ onAddOrEditSubmit (res, callback) {
246
+ // 组织请求
247
+ const requestParameters = {
248
+ queryParamsName: this.queryParamsName,
249
+ queryParams: this.queryParamsJson,
250
+ form: res.realForm,
251
+ businessType: res.businessType,
252
+ operator: res.currUserName
253
+ }
254
+ addOrModify(requestParameters, res.serviceName).then(data => {
255
+ this.$message.success(res.businessType + '成功!')
256
+ this.refreshTable(res.businessType === '新增')
257
+ // commit
258
+ this.$emit('afterSubmit', { type: res.businessType, id: data.id, form: requestParameters.form })
259
+ }).catch(e => {
260
+ this.$message.error(res.businessType + '失败:' + e)
261
+ }).finally(() => {
262
+ callback()
263
+ })
264
+ },
265
+ /**
266
+ * 表格查询后事件
267
+ * @param res 参数
268
+ * @param conditionParams 查询条件
269
+ */
270
+ afterQuery (res, conditionParams) {
271
+ this.$emit('afterQuery', res, conditionParams)
272
+ },
273
+ /**
274
+ * 详情按钮事件
275
+ * @param record 本条数据
276
+ * @param id 数据标识
277
+ * @param actionType 操作类型
278
+ */
279
+ action (record, id, actionType) {
280
+ this.$emit('action', record, id, actionType)
281
+ },
282
+ /**
283
+ * 新增按钮事件
284
+ */
285
+ add () {
286
+ this.$refs.xAddForm.open({
287
+ businessType: '新增',
288
+ title: this.title,
289
+ fixedAddForm: this.fixedAddForm
290
+ })
291
+ },
292
+ /**
293
+ * 修改按钮事件
294
+ * @param res 参数
295
+ */
296
+ edit (res) {
297
+ this.$refs.xAddForm.open({
298
+ businessType: '修改',
299
+ modifyModelData: res,
300
+ title: this.title,
301
+ fixedAddForm: this.fixedAddForm
302
+ })
303
+ },
304
+ /**
305
+ * 删除后事件
306
+ * @param res
307
+ */
308
+ afterDelete (res) {
309
+ this.$emit('afterDelete', res)
310
+ },
311
+ /**
312
+ * 查询表单部分显示/隐藏切换
313
+ */
314
+ toggleIsFormShow () {
315
+ this.$refs.xForm.toggleVisible()
316
+ },
317
+ /**
318
+ * 选择列事件
319
+ * @param selectedRowKeys 选中列Key集合
320
+ * @param selectedRows 选中列
321
+ */
322
+ selectRow (selectedRowKeys, selectedRows) {
323
+ this.$emit('selectRow', selectedRowKeys, selectedRows)
324
+ },
325
+ /**
326
+ * 临时表修改
327
+ * @param res 参数
328
+ */
329
+ tempTableEdit (res) {
330
+ this.$emit('tempTableEdit', res)
331
+ },
332
+ /**
333
+ * 刷新表格
334
+ * @param toFirstPage 是否到第一页
335
+ */
336
+ refreshTable (toFirstPage = true) {
337
+ this.$refs.xTable.refresh(toFirstPage)
338
+ },
339
+ }
340
+ }
341
+ </script>
342
+ <style lang="less" scoped>
343
+
344
+ </style>