478 lines
15 KiB
Java
478 lines
15 KiB
Java
<template>
|
|
<div>
|
|
<div class="box-content">
|
|
<div class="box-content-left">
|
|
<div class="total-text">
|
|
<span>{{$t('totalTable')+' : '+mainLeftNum}}</span>
|
|
</div>
|
|
<div id="main-left"></div>
|
|
</div>
|
|
<div class="box-content-right">
|
|
<div class="total-text">
|
|
<span>{{$t('totalTable')+' : '+mainRightNum}}</span>
|
|
</div>
|
|
<div id="main-right"></div>
|
|
</div>
|
|
</div>
|
|
<div class="box-content">
|
|
<div class="box-content-bottom">
|
|
<div class="total-text-text" :class="{'total-text-text-cntop':long == 'zh-cn' ? true:false,
|
|
'total-text-text-entop':long == 'zh-cn' ? false:true}">
|
|
<span>{{$t('totalTable')+' : '+mainBottomNum}}</span>
|
|
</div>
|
|
<div class="box-content-text">
|
|
<div class="box-content-text-text" @click="boxContentClick(0)">
|
|
{{$t('whole')}}
|
|
</div>
|
|
<div class="box-content-text-text" @click="boxContentClick(1)">
|
|
{{$t('completeVehicle')}}
|
|
</div>
|
|
<div class="box-content-text-text" @click="boxContentClick(2)">
|
|
{{$t('components')}}
|
|
</div>
|
|
</div>
|
|
<div id="main-bottom"></div>
|
|
</div>
|
|
</div>
|
|
<responsibilityList @responsibility="responsibility" ref="responsibilityListRef"/>
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import * as echarts from 'echarts'
|
|
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
|
import responsibilityList from './responsibilityList'
|
|
|
|
export default {
|
|
name: 'certificationActivity',
|
|
components: {
|
|
responsibilityList
|
|
},
|
|
props: {
|
|
idList: {
|
|
type: Array,
|
|
default: []
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
url: {
|
|
getProjectDetailsStatistics: '/project/projectLibraryBase/getProjectDetailsStatistics'
|
|
},
|
|
certificationProgressMap: {},
|
|
num: '0',
|
|
mainLeftNum: 0,
|
|
mainRightNum: 0,
|
|
mainBottomNum: 0,
|
|
long: localStorage.getItem('language') || 'zh-cn'
|
|
}
|
|
},
|
|
mounted() {
|
|
this.num = '0'
|
|
let boxContentTextColor = document.getElementsByClassName('box-content-text-color')
|
|
if (boxContentTextColor && boxContentTextColor.length > 0) {
|
|
boxContentTextColor[0].classList.remove('box-content-text-color')
|
|
}
|
|
let boxContentTextText = document.getElementsByClassName('box-content-text-text')
|
|
if (boxContentTextText && boxContentTextText.length > 0) {
|
|
boxContentTextText[0].classList.add('box-content-text-color')
|
|
}
|
|
this.mainBottomEcharts()
|
|
this.getData()
|
|
},
|
|
methods: {
|
|
getData() {
|
|
let id = ''
|
|
if (this.idList && this.idList.length > 0) {
|
|
id = this.idList.join(',')
|
|
} else {
|
|
id = this.$route.query.id
|
|
}
|
|
getAction(this.url.getProjectDetailsStatistics, { id: id }).then((res) => {
|
|
if (res.success) {
|
|
if (res.result) {
|
|
let rzTaskToConfirmMapList = res.result.rzTaskToConfirmMap ? res.result.rzTaskToConfirmMap.rzTaskToConfirmMapList : []
|
|
let prehomoMapList = res.result.prehomoMap ? res.result.prehomoMap.prehomoMapList : []
|
|
this.certificationProgressMap = res.result.certificationProgressMap
|
|
let allMapList = res.result.certificationProgressMap ? res.result.certificationProgressMap.allMapList : []
|
|
this.dataEcharts(rzTaskToConfirmMapList)
|
|
this.mainRightEcharts(prehomoMapList)
|
|
this.mainBottomEcharts(allMapList)
|
|
}
|
|
}
|
|
})
|
|
},
|
|
dataEcharts(dataSource) {
|
|
let data = []
|
|
let color = []
|
|
this.mainLeftNum = 0
|
|
if (dataSource && dataSource.length > 0) {
|
|
this.dataSource = [{}]
|
|
dataSource.forEach(res => {
|
|
if (res.taskAffirmStatus == 'Not started') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('notLaunch'),
|
|
color: '#00B3BE',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#00B3BE')
|
|
} else if (res.taskAffirmStatus == 'List to confirm') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('listToConfirm'),
|
|
color: '#FDA71C',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#FDA71C')
|
|
} else if (res.taskAffirmStatus == 'Accepted') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('accept'),
|
|
color: '#26BC4B',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#26BC4B')
|
|
} else if (res.taskAffirmStatus == 'Rejected') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('refuse'),
|
|
color: '#E83030',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#E83030')
|
|
}
|
|
this.mainLeftNum += res.taskAffirmStatusCount
|
|
})
|
|
}
|
|
this.getEcharts('main-left', this.$t('certificationTaskConfirmation'), color, data)
|
|
},
|
|
mainRightEcharts(dataSource) {
|
|
let data = []
|
|
let color = []
|
|
this.mainRightNum = 0
|
|
if (dataSource && dataSource.length > 0) {
|
|
this.dataSource = [{}]
|
|
dataSource.forEach(res => {
|
|
if (res.taskAffirmStatus == 'Not started') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('notLaunch'),
|
|
color: '#00B3BE',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#00B3BE')
|
|
} else if (res.taskAffirmStatus == 'List to confirm') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('listToConfirm'),
|
|
color: '#FDA71C',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#FDA71C')
|
|
} else if (res.taskAffirmStatus == 'Review and pass') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('reviewAndPass'),
|
|
color: '#26BC4B',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#26BC4B')
|
|
} else if (res.taskAffirmStatus == 'Review and return') {
|
|
data.push({
|
|
value: res.taskAffirmStatusCount,
|
|
name: this.$t('reviewAndReturn'),
|
|
color: '#E83030',
|
|
status: res.taskAffirmStatus
|
|
})
|
|
color.push('#E83030')
|
|
}
|
|
this.mainRightNum += res.taskAffirmStatusCount
|
|
})
|
|
}
|
|
this.getEcharts('main-right', this.$t('preHomoFlow'), color, data)
|
|
},
|
|
mainBottomEcharts(dataSource) {
|
|
let data = []
|
|
let color = []
|
|
this.mainBottomNum = 0
|
|
if (dataSource && dataSource.length > 0) {
|
|
dataSource.forEach(res => {
|
|
if (res.certificationProgress == 'Not start') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('Notatthe'),
|
|
color: '#00B3BE',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#00B3BE')
|
|
} else if (res.certificationProgress == 'In progress') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('inProgress'),
|
|
color: '#FDA71C',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#FDA71C')
|
|
} else if (res.certificationProgress == 'Test passed') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('experimentPassed'),
|
|
color: '#26BC4B',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#26BC4B')
|
|
} else if (res.certificationProgress == 'Test failed') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('experimentFailed'),
|
|
color: '#E83030',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#E83030')
|
|
} else if (res.certificationProgress == 'Component report not submitted') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('componentReportNotSubmitted'),
|
|
color: '#FDA71C',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#FDA71C')
|
|
} else if (res.certificationProgress == 'Component report submitted') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('componentReportSubmitted'),
|
|
color: '#6FD682',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#6FD682')
|
|
} else if (res.certificationProgress == 'Component report has been stored') {
|
|
data.push({
|
|
value: res.certificationProgressCount,
|
|
name: this.$t('componentReportHasBeenStored'),
|
|
color: '#26BC4B',
|
|
status: res.certificationProgress
|
|
})
|
|
color.push('#26BC4B')
|
|
}
|
|
this.mainBottomNum += res.certificationProgressCount
|
|
})
|
|
}
|
|
this.getEcharts('main-bottom', this.$t('CertificationProgress'), color, data)
|
|
},
|
|
getEcharts(chart, title, color, data) {
|
|
var myChart = echarts.init(document.getElementById(chart))
|
|
myChart.setOption({
|
|
title: {
|
|
text: title
|
|
},
|
|
tooltip: {
|
|
trigger: 'item',
|
|
textStyle: {
|
|
fontWeight: 'normal',
|
|
fontSize: 14,
|
|
color: '#040B29',
|
|
fontFamily: 'BlueSkyNoto'
|
|
},
|
|
formatter: function(parms) {
|
|
let str = parms.marker + ' ' + parms.data.name + ' ' + parms.data.value + ' (' + parms.percent + '%)'
|
|
return str
|
|
}
|
|
},
|
|
legend: {
|
|
itemWidth: 12,
|
|
itemHeight: 12,
|
|
bottom: '0',
|
|
left: 'center',
|
|
itemGap: 30,
|
|
icon: 'circle'
|
|
},
|
|
series: [
|
|
{
|
|
name: title,
|
|
type: 'pie',
|
|
radius: ['40%', '54%'],
|
|
avoidLabelOverlap: false,
|
|
label: {
|
|
show: false,
|
|
position: 'center'
|
|
},
|
|
labelLine: {
|
|
show: false
|
|
},
|
|
color: color,
|
|
data: data
|
|
}
|
|
]
|
|
})
|
|
myChart.off('click') // 重点代码
|
|
myChart.on('click', (params) => {
|
|
console.log(params)
|
|
let query = {
|
|
title: params.seriesName+'-'+params.name,
|
|
projectLibraryId: this.$route.query.id
|
|
}
|
|
if (params.seriesName === this.$t('certificationTaskConfirmation')) {
|
|
query.operatorType = 'queryRZTaskToConfirmStatistics'
|
|
query.status = params.data.status
|
|
} else if (params.seriesName === this.$t('preHomoFlow')) {
|
|
query.operatorType = 'queryPrehomoStatistics'
|
|
query.status = params.data.status
|
|
} else if (params.seriesName === this.$t('CertificationProgress')) {
|
|
if (this.num == '0') {
|
|
query.operatorType = 'queryCertificationProgressStatisticsAll'
|
|
} else if (this.num == '1') {
|
|
query.operatorType = 'queryCertificationProgressStatisticsCar'
|
|
} else if (this.num == '2') {
|
|
query.operatorType = 'queryCertificationProgressStatisticsPart'
|
|
}
|
|
query.status = params.data.status
|
|
}
|
|
this.$refs.responsibilityListRef.getData(query)
|
|
})
|
|
},
|
|
|
|
responsibility(item) {
|
|
this.$emit('currentStatus', item)
|
|
},
|
|
boxContentClick(num) {
|
|
|
|
let boxContentTextColor = document.getElementsByClassName('box-content-text-color')
|
|
if (boxContentTextColor && boxContentTextColor.length > 0) {
|
|
boxContentTextColor[0].classList.remove('box-content-text-color')
|
|
}
|
|
let boxContentTextText = document.getElementsByClassName('box-content-text-text')
|
|
if (boxContentTextText && boxContentTextText.length > 0) {
|
|
boxContentTextText[num].classList.add('box-content-text-color')
|
|
}
|
|
this.num = num
|
|
if (num == 0) {
|
|
this.mainBottomEcharts(this.certificationProgressMap.allMapList || [])
|
|
} else if (num == 1) {
|
|
this.mainBottomEcharts(this.certificationProgressMap.carMapList || [])
|
|
} else if (num == 2) {
|
|
this.mainBottomEcharts(this.certificationProgressMap.partMapList || [])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.box-content {
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
/*margin-bottom: 20px;*/
|
|
|
|
.box-content-left {
|
|
width: calc(50% - 10px);
|
|
height: 346px;
|
|
position: relative;
|
|
border: 2px #eff1f3 solid;
|
|
border-radius: 6px;
|
|
margin-top: 4px;
|
|
|
|
#main-left {
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 20px 24px;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
|
|
.box-content-right {
|
|
width: calc(50% - 10px);
|
|
height: 346px;
|
|
position: relative;
|
|
border: 2px #eff1f3 solid;
|
|
border-radius: 6px;
|
|
margin-top: 4px;
|
|
|
|
#main-right {
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 20px 24px;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
|
|
.box-content-bottom {
|
|
width: 100%;
|
|
height: 346px;
|
|
border: 2px #eff1f3 solid;
|
|
position: relative;
|
|
border-radius: 6px;
|
|
margin-top: 20px;
|
|
overflow: hidden;
|
|
|
|
.box-content-text {
|
|
height: 30px;
|
|
background: #F5F6F7;
|
|
border-radius: 4px;
|
|
position: absolute;
|
|
right: 24px;
|
|
top: 20px;
|
|
display: flex;
|
|
z-index: 100;
|
|
justify-content: space-between;
|
|
padding: 0 2px 0 2px;
|
|
|
|
.box-content-text-text {
|
|
display: inline-block;
|
|
font-size: 12px;
|
|
color: #6F7385;
|
|
line-height: 30px;
|
|
margin-right: 10px;
|
|
cursor: pointer;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.box-content-text-color {
|
|
box-shadow: 0px 1px 2px rgba(0, 0, 60, 0.01), 0px 2px 4px rgba(0, 22, 60, 0.02), 0px 4px 6px rgba(0, 22, 60, 0.0229458);
|
|
border-radius: 4px;
|
|
padding: 4px 6px;
|
|
background: #FFFFFF;
|
|
border: 1px solid #E6E7EC;
|
|
color: #01A0AC;
|
|
line-height: normal;
|
|
margin-right: 0;
|
|
margin-left: 0;
|
|
}
|
|
}
|
|
|
|
#main-bottom {
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: 20px 24px;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
}
|
|
|
|
.total-text {
|
|
position: absolute;
|
|
right: 28px;
|
|
top: 19px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.total-text-text {
|
|
position: absolute;
|
|
right: 28px;
|
|
top: 21px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.total-text-text-cntop {
|
|
right: 180px;
|
|
}
|
|
|
|
.total-text-text-entop {
|
|
right: 290px;
|
|
}
|
|
</style> |