|
@ -68,61 +68,70 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
// ================== |
|
|
this.initData() |
|
|
Promise.allSettled([ |
|
|
// 设置定时器,每分钟刷新一次 |
|
|
// 交通事件, 施工路段 |
|
|
this.timer = setInterval(this.initData, 60 * 1000); |
|
|
request({ |
|
|
}, |
|
|
url: `/business/trafficIncidents/getKeyData`, |
|
|
beforeDestroy() { |
|
|
method: "get", |
|
|
clearInterval(this.timer); // 清除定时器 |
|
|
}), |
|
|
}, |
|
|
// 感知事件 |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/perceivedEvents/warning/warningTotal`, |
|
|
|
|
|
method: "post", |
|
|
|
|
|
data: {} |
|
|
|
|
|
}), |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/business/device/abnormalDevice`, |
|
|
|
|
|
method: "get", |
|
|
|
|
|
data: {} |
|
|
|
|
|
}), |
|
|
|
|
|
// 首页天气预报 |
|
|
|
|
|
request({url: '/weatherForecast/currentWeatherWarningInformationQuery', |
|
|
|
|
|
method: 'post', |
|
|
|
|
|
data: { |
|
|
|
|
|
"roadId":"G003537", |
|
|
|
|
|
"earlyWorningLevel":"1|2|3" |
|
|
|
|
|
} |
|
|
|
|
|
}), |
|
|
|
|
|
]) |
|
|
|
|
|
.then(([trafficIncidents, perceiveEvent, abnormalDeviceNum, weatherForecast]) => { |
|
|
|
|
|
if (trafficIncidents.status === 'fulfilled' && trafficIncidents.value.code == 200) { |
|
|
|
|
|
const data = trafficIncidents.value.data; |
|
|
|
|
|
|
|
|
|
|
|
this.trafficIncidents = [ |
|
|
methods: { |
|
|
data.processing || 0, |
|
|
initData(){ |
|
|
data.total || 0 |
|
|
Promise.allSettled([ |
|
|
]; |
|
|
// 交通事件, 施工路段 |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/business/trafficIncidents/getKeyData`, |
|
|
|
|
|
method: "get", |
|
|
|
|
|
}), |
|
|
|
|
|
// 感知事件 |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/perceivedEvents/warning/warningTotal`, |
|
|
|
|
|
method: "post", |
|
|
|
|
|
data: {} |
|
|
|
|
|
}), |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/business/device/abnormalDevice`, |
|
|
|
|
|
method: "get", |
|
|
|
|
|
data: {} |
|
|
|
|
|
}), |
|
|
|
|
|
// 首页天气预报 |
|
|
|
|
|
request({url: '/weatherForecast/currentWeatherWarningInformationQuery', |
|
|
|
|
|
method: 'post', |
|
|
|
|
|
data: { |
|
|
|
|
|
"roadId":"G003537", |
|
|
|
|
|
"earlyWorningLevel":"1|2|3" |
|
|
|
|
|
} |
|
|
|
|
|
}), |
|
|
|
|
|
]) |
|
|
|
|
|
.then(([trafficIncidents, perceiveEvent, abnormalDeviceNum, weatherForecast]) => { |
|
|
|
|
|
if (trafficIncidents.status === 'fulfilled' && trafficIncidents.value.code == 200) { |
|
|
|
|
|
const data = trafficIncidents.value.data; |
|
|
|
|
|
|
|
|
this.constructionSection = data.construction || 0 |
|
|
this.trafficIncidents = [ |
|
|
} |
|
|
data.processing || 0, |
|
|
|
|
|
data.total || 0 |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
if (perceiveEvent.status === 'fulfilled' && perceiveEvent.value.code == 200) { |
|
|
this.constructionSection = data.construction || 0 |
|
|
const data = perceiveEvent.value.data; |
|
|
} |
|
|
|
|
|
|
|
|
this.perceiveEvent = data.number || 0; |
|
|
if (perceiveEvent.status === 'fulfilled' && perceiveEvent.value.code == 200) { |
|
|
} |
|
|
const data = perceiveEvent.value.data; |
|
|
if (abnormalDeviceNum.status === 'fulfilled' && abnormalDeviceNum.value.code == 200) { |
|
|
|
|
|
const data = abnormalDeviceNum.value.data; |
|
|
this.perceiveEvent = data.number || 0; |
|
|
this.abnormalDeviceNum = data || 0; |
|
|
} |
|
|
} |
|
|
if (abnormalDeviceNum.status === 'fulfilled' && abnormalDeviceNum.value.code == 200) { |
|
|
if (weatherForecast && weatherForecast.status === 'fulfilled' && weatherForecast.value.code == 200) { |
|
|
const data = abnormalDeviceNum.value.data; |
|
|
const data = weatherForecast.value.data; |
|
|
this.abnormalDeviceNum = data || 0; |
|
|
this.weatherForecast = data.length; |
|
|
} |
|
|
} |
|
|
if (weatherForecast && weatherForecast.status === 'fulfilled' && weatherForecast.value.code == 200) { |
|
|
}) |
|
|
const data = weatherForecast.value.data; |
|
|
//-----当前在途车辆 |
|
|
this.weatherForecast = data.length; |
|
|
request({ |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
//-----当前在途车辆 |
|
|
|
|
|
request({ |
|
|
url: `/business/traffic-statistics/current/in-transit-vehicles`, |
|
|
url: `/business/traffic-statistics/current/in-transit-vehicles`, |
|
|
method: "get", |
|
|
method: "get", |
|
|
}).then((result) => { |
|
|
}).then((result) => { |
|
@ -134,19 +143,19 @@ export default { |
|
|
this.transitVehicles = _count; |
|
|
this.transitVehicles = _count; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
//-----日累计车流量 |
|
|
//-----日累计车流量 |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/traffic-statistics/history/trafficFlowAtToll`, |
|
|
url: `/business/traffic-statistics/history/trafficFlowAtToll`, |
|
|
method: "get", |
|
|
method: "get", |
|
|
params: { |
|
|
params: { |
|
|
startDate:moment().format('YYYY-MM-DD') |
|
|
startDate:moment().format('YYYY-MM-DD') |
|
|
} |
|
|
} |
|
|
}).then((result) => { |
|
|
}).then((result) => { |
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
this.trafficVolume = result.data; |
|
|
this.trafficVolume = result.data; |
|
|
}) |
|
|
}) |
|
|
//-----平均车速 |
|
|
//-----平均车速 |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/traffic-statistics/current/average-speed`, |
|
|
url: `/business/traffic-statistics/current/average-speed`, |
|
|
method: "get", |
|
|
method: "get", |
|
|
}).then((result) => { |
|
|
}).then((result) => { |
|
@ -157,6 +166,7 @@ export default { |
|
|
this.averageSpeed = toDecimal(_count/result.data.length) |
|
|
this.averageSpeed = toDecimal(_count/result.data.length) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|