vue2-client 1.5.8 → 1.5.10
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.
- package/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +28 -39
- package/src/base-client/components/common/XAddForm/XAddForm.vue +11 -20
- package/src/base-client/components/common/XFormTable/XFormTable.vue +30 -9
- package/src/components/Ellipsis/Ellipsis.vue +2 -1
- package/src/layouts/header/HeaderNotice.vue +8 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -7,13 +7,8 @@
|
|
|
7
7
|
@close="onClose"
|
|
8
8
|
>
|
|
9
9
|
<x-add-form
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:visible.sync="editQueryVisible"
|
|
13
|
-
:json-data="formObj.formJson"
|
|
14
|
-
:modify-model-data="modifyModelDataItem"
|
|
15
|
-
:loading="loading"
|
|
16
|
-
@onSubmit="submit"/>
|
|
10
|
+
ref="xAddForm"
|
|
11
|
+
@onSubmit="onAddOrEditSubmit"/>
|
|
17
12
|
<a-list
|
|
18
13
|
:grid="{gutter: 24, lg: 4, md: 3, sm: 1, xs: 1}"
|
|
19
14
|
:dataSource="columnJson.groups"
|
|
@@ -45,18 +40,11 @@ export default {
|
|
|
45
40
|
return {
|
|
46
41
|
// 页面宽度
|
|
47
42
|
screenWidth: document.documentElement.clientWidth,
|
|
48
|
-
// 是否显示参数下发抽屉
|
|
49
|
-
editQueryVisible: false,
|
|
50
|
-
targetIndex: 0,
|
|
51
43
|
columnJson: {},
|
|
52
|
-
editIndex: -1,
|
|
53
44
|
formObj: {
|
|
54
45
|
groupName: '',
|
|
55
46
|
formJson: []
|
|
56
|
-
}
|
|
57
|
-
modifyModelDataItem: {},
|
|
58
|
-
// 参数设置业务执行状态
|
|
59
|
-
loading: false
|
|
47
|
+
}
|
|
60
48
|
}
|
|
61
49
|
},
|
|
62
50
|
mounted () {
|
|
@@ -94,36 +82,37 @@ export default {
|
|
|
94
82
|
toEdit (item) {
|
|
95
83
|
post(commonApi.getColumnsJson, { queryObject: item }).then(res => {
|
|
96
84
|
this.formObj = res
|
|
97
|
-
this.
|
|
98
|
-
|
|
85
|
+
this.$refs.xAddForm.init({
|
|
86
|
+
formItems: this.formObj.formJson,
|
|
87
|
+
serviceName: this.formObj.serviceName
|
|
88
|
+
})
|
|
89
|
+
const modifyModelData = { data: this.modifyModelData[this.formObj.groupName] }
|
|
90
|
+
this.$refs.xAddForm.open({
|
|
91
|
+
businessType: '修改',
|
|
92
|
+
modifyModelData: modifyModelData,
|
|
93
|
+
title: this.title
|
|
94
|
+
})
|
|
99
95
|
})
|
|
100
96
|
},
|
|
101
97
|
onClose () {
|
|
102
98
|
this.$emit('update:visible', false)
|
|
103
99
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
requestParameters.paramsJson[this.formObj.groupName] =
|
|
111
|
-
for (const key of Object.keys(res.form)) {
|
|
112
|
-
const realKey = key.substring(key.indexOf('_') + 1)
|
|
113
|
-
requestParameters.paramsJson[this.formObj.groupName][realKey] = res.form[key]
|
|
114
|
-
}
|
|
115
|
-
this.$emit('onSubmit', requestParameters, result => {
|
|
116
|
-
if (result) {
|
|
117
|
-
this.$message.success('参数设置成功!')
|
|
118
|
-
} else {
|
|
119
|
-
this.$message.error('参数设置失败!')
|
|
120
|
-
}
|
|
121
|
-
this.loading = false
|
|
122
|
-
this.editQueryVisible = false
|
|
123
|
-
})
|
|
124
|
-
} else {
|
|
125
|
-
return false
|
|
100
|
+
onAddOrEditSubmit (res, callback) {
|
|
101
|
+
const requestParameters = {
|
|
102
|
+
paramsJson: {}
|
|
103
|
+
}
|
|
104
|
+
requestParameters.paramsJson[this.formObj.groupName] = {}
|
|
105
|
+
for (const key of Object.keys(res.form)) {
|
|
106
|
+
requestParameters.paramsJson[this.formObj.groupName][key] = res.form[key]
|
|
126
107
|
}
|
|
108
|
+
this.$emit('onSubmit', requestParameters, result => {
|
|
109
|
+
if (result) {
|
|
110
|
+
this.$message.success('参数设置成功!')
|
|
111
|
+
} else {
|
|
112
|
+
this.$message.error('参数设置失败!')
|
|
113
|
+
}
|
|
114
|
+
callback()
|
|
115
|
+
})
|
|
127
116
|
}
|
|
128
117
|
}
|
|
129
118
|
}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
|
|
40
40
|
import { formatDate } from '@vue2-client/utils/util'
|
|
41
41
|
import { mapState } from 'vuex'
|
|
42
|
-
import {
|
|
42
|
+
import { post } from '@vue2-client/services/api'
|
|
43
43
|
|
|
44
44
|
export default {
|
|
45
45
|
name: 'XAddForm',
|
|
@@ -52,8 +52,6 @@ export default {
|
|
|
52
52
|
viewMode: false,
|
|
53
53
|
// 是否展示
|
|
54
54
|
isShow: false,
|
|
55
|
-
// 查询配置文件名
|
|
56
|
-
queryParamsName: '',
|
|
57
55
|
// 内容加载是否完成
|
|
58
56
|
loaded: false,
|
|
59
57
|
// 业务类型
|
|
@@ -105,13 +103,12 @@ export default {
|
|
|
105
103
|
},
|
|
106
104
|
methods: {
|
|
107
105
|
init (params) {
|
|
108
|
-
const { isShow = true, formItems, viewMode, isTableTemp,
|
|
106
|
+
const { isShow = true, formItems, viewMode, isTableTemp, serviceName = 'af-system' } = params
|
|
109
107
|
if (isShow) {
|
|
110
108
|
this.isShow = true
|
|
111
109
|
this.formItems = JSON.parse(JSON.stringify(formItems))
|
|
112
110
|
this.viewMode = viewMode
|
|
113
111
|
this.isTableTemp = isTableTemp
|
|
114
|
-
this.queryParamsName = queryParamsName
|
|
115
112
|
this.serviceName = serviceName
|
|
116
113
|
}
|
|
117
114
|
},
|
|
@@ -251,24 +248,18 @@ export default {
|
|
|
251
248
|
})
|
|
252
249
|
return
|
|
253
250
|
}
|
|
254
|
-
//
|
|
255
|
-
const
|
|
256
|
-
queryParamsName: this.queryParamsName,
|
|
257
|
-
form: {},
|
|
258
|
-
businessType: this.businessType,
|
|
259
|
-
operator: this.currUser.name
|
|
260
|
-
}
|
|
251
|
+
// 处理表单键问题
|
|
252
|
+
const realForm = {}
|
|
261
253
|
for (const key of Object.keys(requestForm)) {
|
|
262
254
|
const realKey = this.getRealKey(key)
|
|
263
|
-
|
|
255
|
+
realForm[realKey] = requestForm[key]
|
|
264
256
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}).finally(() => {
|
|
257
|
+
// 交由父级处理
|
|
258
|
+
this.$emit('onSubmit', {
|
|
259
|
+
businessType: this.businessType,
|
|
260
|
+
realForm: realForm,
|
|
261
|
+
currUserName: this.currUser.name
|
|
262
|
+
}, () => {
|
|
272
263
|
this.close()
|
|
273
264
|
})
|
|
274
265
|
})
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<x-add-form
|
|
4
4
|
ref="xAddForm"
|
|
5
|
-
@
|
|
5
|
+
@onSubmit="onAddOrEditSubmit"
|
|
6
6
|
/>
|
|
7
7
|
<x-form
|
|
8
8
|
ref="xForm"
|
|
@@ -44,7 +44,7 @@ import XForm from '@vue2-client/base-client/components/common/XForm'
|
|
|
44
44
|
import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
|
|
45
45
|
import XTable from '@vue2-client/base-client/components/common/XTable'
|
|
46
46
|
import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
|
|
47
|
-
import { commonApi } from '@vue2-client/services/api/common'
|
|
47
|
+
import { addOrModify, commonApi } from '@vue2-client/services/api/common'
|
|
48
48
|
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
49
49
|
import { mapState } from 'vuex'
|
|
50
50
|
import { post } from '@vue2-client/services/api/restTools'
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
131
131
|
},
|
|
132
132
|
fixedQueryForm: {
|
|
133
133
|
handler () {
|
|
134
|
-
this
|
|
134
|
+
this.refreshTable(true)
|
|
135
135
|
},
|
|
136
136
|
deep: true
|
|
137
137
|
},
|
|
@@ -194,7 +194,6 @@ export default {
|
|
|
194
194
|
formItems: res.formJson,
|
|
195
195
|
viewMode: this.viewMode,
|
|
196
196
|
isTableTemp: this.isTableTemp,
|
|
197
|
-
queryParamsName: this.queryParamsName,
|
|
198
197
|
serviceName: res.serviceName
|
|
199
198
|
})
|
|
200
199
|
},
|
|
@@ -213,11 +212,26 @@ export default {
|
|
|
213
212
|
}
|
|
214
213
|
},
|
|
215
214
|
/**
|
|
216
|
-
*
|
|
217
|
-
* @param res 参数
|
|
215
|
+
* 提交新增表单事件
|
|
218
216
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
onAddOrEditSubmit (res, callback) {
|
|
218
|
+
// 组织请求
|
|
219
|
+
const requestParameters = {
|
|
220
|
+
queryParamsName: this.queryParamsName,
|
|
221
|
+
form: res.realForm,
|
|
222
|
+
businessType: res.businessType,
|
|
223
|
+
operator: res.currUserName
|
|
224
|
+
}
|
|
225
|
+
addOrModify(requestParameters, this.serviceName).then(data => {
|
|
226
|
+
this.$message.success(res.businessType + '成功!')
|
|
227
|
+
this.refreshTable(res.businessType === '新增')
|
|
228
|
+
// commit
|
|
229
|
+
this.$emit('afterSubmit', { type: res.businessType, id: data.id, form: requestParameters.form })
|
|
230
|
+
}).catch(e => {
|
|
231
|
+
this.$message.error(res.businessType + '失败:' + e)
|
|
232
|
+
}).finally(() => {
|
|
233
|
+
callback()
|
|
234
|
+
})
|
|
221
235
|
},
|
|
222
236
|
/**
|
|
223
237
|
* 表格查询后事件
|
|
@@ -283,7 +297,14 @@ export default {
|
|
|
283
297
|
*/
|
|
284
298
|
tempTableEdit (res) {
|
|
285
299
|
this.$emit('tempTableEdit', res)
|
|
286
|
-
}
|
|
300
|
+
},
|
|
301
|
+
/**
|
|
302
|
+
* 刷新表格
|
|
303
|
+
* @param toFirstPage 是否到第一页
|
|
304
|
+
*/
|
|
305
|
+
refreshTable (toFirstPage = true) {
|
|
306
|
+
this.$refs.xTable.refresh(toFirstPage)
|
|
307
|
+
},
|
|
287
308
|
}
|
|
288
309
|
}
|
|
289
310
|
</script>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<a-list class="tab-pane"></a-list>
|
|
29
29
|
</a-tab-pane>
|
|
30
30
|
<a-tab-pane key="3" tab="待办">
|
|
31
|
-
<a-list :data-source="backlog" class="tab-pane" item-layout="horizontal">
|
|
31
|
+
<a-list :data-source="backlog" class="tab-pane" item-layout="horizontal" :pagination="pagination">
|
|
32
32
|
<a-list-item slot="renderItem" slot-scope="item">
|
|
33
33
|
<a v-if="item.type==='制度待确认'" slot="actions" @click="confirm_institution(item)">查看</a>
|
|
34
34
|
<a-list-item-meta :description="item.description" :title="item.title"/>
|
|
@@ -63,6 +63,12 @@ export default {
|
|
|
63
63
|
institution: undefined,
|
|
64
64
|
affirmInstitution: undefined,
|
|
65
65
|
backlog: [],
|
|
66
|
+
pagination: {
|
|
67
|
+
onChange: page => {
|
|
68
|
+
console.log(page)
|
|
69
|
+
},
|
|
70
|
+
pageSize: 5
|
|
71
|
+
},
|
|
66
72
|
activeKey: '1'
|
|
67
73
|
}
|
|
68
74
|
},
|
|
@@ -88,7 +94,7 @@ export default {
|
|
|
88
94
|
key,
|
|
89
95
|
message: `您有${this.backlog.length}条待办需要确认`,
|
|
90
96
|
top: '50px',
|
|
91
|
-
description: <ellipsis length="200"
|
|
97
|
+
description: <ellipsis length="200">{ this.backlog.map((item, index) => index + 1 + '、' + item.title).join(';') }</ellipsis>,
|
|
92
98
|
icon: <a-icon type="container" style="color: #f5222d"/>,
|
|
93
99
|
btn: h => {
|
|
94
100
|
return h(
|