vue2-client 1.5.13 → 1.5.15

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