对接项目详情的图标

This commit is contained in:
qq787203167
2022-05-16 17:30:45 +08:00
parent 88159cfc15
commit c8af7231fc
2 changed files with 186 additions and 67 deletions
@@ -14,7 +14,7 @@
:columns="columns"
>
<template slot="footer" slot-scope="currentPageData">
{{$t('totalTable')}}
{{$t('totalTable')}}:{{certificationProgressTotal}}
</template>
</a-table>
</div>
@@ -24,46 +24,108 @@
<script>
import * as echarts from 'echarts'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
export default {
name: 'certificationProgress',
data() {
return {
loading:false,
dataSource:[],
loading: false,
dataSource: [],
certificationProgressTotal: 0,
url: {
getProjectDetailsStatistics: '/project/projectLibraryBase/getProjectDetailsStatistics'
},
columns: [
{
title: this.$t('notInvolved'),
align: 'center',
dataIndex: 'nonConformity',
dataIndex: 'notInvolved'
},
{
title: this.$t('toBeStarted'),
align: 'center',
dataIndex: 'Tracked',
dataIndex: 'toBeStarted'
},
{
title: this.$t('inProgress'),
align: 'center',
dataIndex: 'accord',
dataIndex: 'inProgress'
},
{
title: this.$t('experimentFailed'),
align: 'center',
dataIndex: 'notEvaluated',
dataIndex: 'experimentFailed'
},
{
title: this.$t('experimentPassed'),
align: 'center',
dataIndex: 'notEvaluatedOne',
dataIndex: 'experimentPassed'
}
]
}
},
mounted() {
this.mainLeftEcharts()
this.getData()
},
methods: {
getData() {
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => {
if (res.success) {
let certificationProgressMap = res.result.certificationProgressMap.certificationProgressMapList || []
this.certificationProgressTotal = res.result.certificationProgressMap.certificationProgressTotal
this.dataEcharts(certificationProgressMap)
}
})
},
dataEcharts(val) {
let data = []
let color = []
this.dataSource = []
if (val && val.length > 0) {
this.dataSource = [{}]
val.forEach(res => {
if (res.certificationProgress == 'NA') {
data.push({
value: res.certificationProgressCount,
name: this.$t('notInvolved')
})
color.push('#9DB9D4')
this.dataSource[0].notInvolved = res.certificationProgressCount
} else if (res.certificationProgress == 'Not start') {
data.push({
value: res.certificationProgressCount,
name: this.$t('toBeStarted')
})
color.push('#FDB033')
this.dataSource[0].toBeStarted = res.certificationProgressCount
} else if (res.certificationProgress == 'In progress') {
data.push({
value: res.certificationProgressCount,
name: this.$t('inProgress')
})
color.push('#FF8543')
this.dataSource[0].inProgress = res.certificationProgressCount
} else if (res.certificationProgress == 'Test failed') {
data.push({
value: res.certificationProgressCount,
name: this.$t('experimentFailed')
})
color.push('#FF8543')
this.dataSource[0].experimentFailed = res.certificationProgressCount
} else if (res.certificationProgress == 'Test passed') {
data.push({
value: res.certificationProgressCount,
name: this.$t('experimentPassed')
})
color.push('#2F8DF3')
this.dataSource[0].experimentPassed = res.certificationProgressCount
}
})
}
this.mainLeftEcharts(data, color)
},
getEcharts(chart, title, color, data) {
var myChart = echarts.init(document.getElementById(chart))
myChart.setOption({
@@ -100,15 +162,7 @@
]
})
},
mainLeftEcharts() {
let data = [
{ value: 1048, name: this.$t('notInvolved') },
{ value: 735, name: this.$t('toBeStarted') },
{ value: 580, name: this.$t('inProgress') },
{ value: 580, name: this.$t('experimentFailed') },
{ value: 580, name: this.$t('experimentPassed') }
]
let color = ['#9DB9D4', '#FDB033', '#37CED1', '#FF8543', '#2F8DF3', ]
mainLeftEcharts(data, color) {
this.getEcharts('main-left', this.$t('CertificationProgress'), color, data)
}
}