This commit is contained in:
huangyaohui 2026-03-23 09:05:02 +08:00
parent 573c3016a1
commit ba8805d4b9
1 changed files with 16 additions and 16 deletions

View File

@ -100,19 +100,13 @@ const accidentImpactDataBySection = {
//
const accidentImpactMetric = ref('speed')
const timePoints = [
'00:00',
'04:00',
'08:00',
'12:00',
'16:00',
'20:00',
'24:00',
]
const congestionData = [45, 30, 75, 40, 70, 55, 35]
const speedData = [65, 70, 45, 55, 50, 60, 68]
const congestionDataAxis = ref([])
const speedDataAxis = ref([])
const timePoints = computed(() => {
return accidentImpactMetric.value === 'speed' ? speedDataAxis.value : congestionDataAxis.value
})
const congestionData = ref([])
const speedData = ref([])
// pcu/h
const demoAreaLast7Days = ref([])
@ -532,7 +526,7 @@ const demoAreaHistoryTrendOption = computed(() => {
const trendOption = computed(() => {
const isCongestion = activeTrendMetric.value === 'congestion'
const seriesName = isCongestion ? '拥堵指数' : '平均速度'
const data = isCongestion ? congestionData : speedData
const data = isCongestion ? congestionData.value : speedData.value
return {
backgroundColor: 'transparent',
@ -565,7 +559,7 @@ const trendOption = computed(() => {
},
xAxis: {
type: 'category',
data: timePoints,
data: timePoints.value,
boundaryGap: false,
axisLine: {
lineStyle: {
@ -1179,7 +1173,13 @@ const getPageData = async () => {
trafficStatus.value.travelTimeIndex = item.data
}
})
// 111
//
const trendStatisticsCongestionIndex = data['trend_statistics']?.congestion_index?.items || []
const trendStatisticsAverageSpeed = data['trend_statistics']?.average_speed?.items || []
congestionDataAxis.value = trendStatisticsCongestionIndex.map(item => item.project)
congestionData.value = trendStatisticsCongestionIndex.map(item => item.data)
speedDataAxis.value = trendStatisticsAverageSpeed.map(item => item.project)
speedData.value = trendStatisticsAverageSpeed.map(item => item.data)
}
onMounted(() => {