1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
<div style="height: 70vh; overflow: auto;">
<a-table :dataSource="tableData" :columns="columns" rowKey="knowledge2Id" :pagination="false" :loading="loading" bordered>
</a-table>
</div>
</template>
<script>
import { groupList } from '@/views/peAssign/config'
import { getType } from '@/views/utils/auth'
import { mergeRow } from '@/views/utils/common'
export default {
name: "projectStatistic",
data() {
return {
loading: false,
columns: [
{ title: '一级学科', dataIndex: 'knowledge1Name', align: 'center', customRender: (text, row) => { return { children: `${text}`, attrs: { rowSpan: row.knowledge1NameRowSpan } } } },
{ title: '二级学科', dataIndex: 'knowledge2Name', align: 'left' },
{ title: '项目数', dataIndex: 'knowledgeCount', align: 'center' },
{ title: '总数', dataIndex: 'totalCount', align: 'center', customRender: (text, row) => { return { children: row.totalCount, attrs: { rowSpan: row.groupNameRowSpan } } } },
{ title: '分组', dataIndex: 'groupName', align: 'center', customRender: (text, row) => { return { children: `${text}`, attrs: { rowSpan: row.groupNameRowSpan } } } },
{ title: '分配专家', dataIndex: 'expertName', align: 'center',
customRender: (text, row) => {
const array = []
if (text != null && text !== '') {
text.split('|').forEach(e => {
array.push(<a-tag color="orange">{e}</a-tag>)
array.push(<br/>)
})
}
return {
children: array,//(<a-tag color="orange">{text}</a-tag>),
attrs: { rowSpan: row.groupNameRowSpan }
}
}
},
],
tableData: [],//groupList(),
reportYear: null
};
},
created() {
this.getYear()
},
mounted() {
},
methods: {
getYear () {
this.$api.batch.getCurrentYearBatch({ type: 1, projType: getType() }).then(({ data = {} }) => {
if (data) {
this.reportYear = data.year
this.getProjectExpertGroupStatistic()
}
}).catch(() => { })
},
getProjectExpertGroupStatistic () {
this.$api.statistical.getProjectExpertGroupStatistic({ reportYear: this.reportYear, auditType: 1, projType: getType() }).then(({ data = {} }) => {
if (data) {
this.tableData = data
}
}).catch(() => { })
},
exportData() {
}
},
watch: {
tableData: {
handler (value) {
mergeRow('knowledge1Name', this.tableData) // 合并knowledge1Name
mergeRow('groupName', this.tableData) // 合并groupName
}
}
}
};
</script>