联调市详情页面

This commit is contained in:
GGJ
2024-04-29 16:37:07 +08:00
parent 0c7b5ff4d6
commit 830d2017a5
20 changed files with 1295 additions and 141 deletions

View File

@@ -39,7 +39,7 @@
import { ref } from 'vue'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { getAssessDetail } from '@/api/device-boot/panorama'
import { getAssessDetail, getAssessTrend } from '@/api/device-boot/panorama'
const dialogVisible: any = ref(false)
const tableData: any = ref([])
@@ -48,50 +48,54 @@ const picEChart = ref()
const open = async (row: any) => {
getAssessDetail(row).then(res => {
tableData.value = res.data
})
getAssessTrend(row).then(res => {
picEChart.value = {
tooltip: {
formatter: function (params: any) {
let tips = ''
if (params[0].value == 3.14159) {
tips += params[0].name + ':暂无数据<br/>'
} else {
tips += params[0].name + ':' + params[0].value + '%<br/>'
}
return tips
}
},
title: {
text: ''
text: '各地市综合评估趋势对比'
},
xAxis: {
name: '(区域)',
data: res.data.map((item: any) => item.deptName)
},
grid: {
bottom: '10px'
},
yAxis: {
name: '',
min: 0,
max: 100
name: ''
},
options: {
series: [
{
name: '评估得分',
type: 'bar',
data: res.data.map((item: any) => item.assessData)
}
]
dataZoom: false,
series: []
}
}
let list: any = []
let time: any = []
res.data.forEach((item: any, num: any) => {
time = []
item.children.forEach((val: any, i: any) => {
if (num == 0) {
list.push([])
}
time.push(val.dataTime)
list[i].push(val.score == 3.14159 ? null : val.score)
})
})
list.forEach((item: any, i: any) => {
picEChart.value.options.series.push({
name: time[i],
type: 'line',
data: item
})
})
})
dialogVisible.value = true
}
const formatter = (row: any) => {
if (row.cellValue == 3.14159) {
return '暂无数据'
return '/'
} else {
return row.cellValue
}