网格、区域、路段、统计数据

Lvtianfang
吕天方 11 months ago
parent a26614ba14
commit c7e9b3d0db

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-08-15 11:09:57 * @Date: 2023-08-15 11:09:57
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2024-03-08 10:15:01 * @LastEditTime: 2024-04-01 10:14:26
--> -->
<template> <template>
<div class="right-box"> <div class="right-box">
@ -159,72 +159,84 @@ export default {
} }
}) })
}, },
getWangge(newWange){ async getWangge(newWange){
let data = newWange.map((item)=>{ try {
let wagearr = [...newWange]
let promises = wagearr.map(async (item)=>{
let data = { let data = {
startTime: this.getCurrentTime(), startTime: this.getCurrentTime(),
// startTime: '2024-01-01',
endTime: this.getCurrentTime(1), endTime: this.getCurrentTime(1),
gridld: item.id // endTime: '2024-04-01',
gridId: item.id
} }
statgrid(data).then(res=>{ const result = await statgrid(data);
this.$set(item,'total',res.data.total); item.total = result.data.total;
item.total = res.data.total; item.handled = result.data.handled;
item.handled = res.data.handled; item.unhandled = result.data.unhandled;
item.unhandled = res.data.unhandled;
})
return item; return item;
}) })
this.wanggeArray = data; const combinedData = await Promise.all(promises);
// let grids = [] this.wanggeArray = combinedData;
// newWange.map((item)=>{ } catch {
// grids.push(item.id);
// }) }
// let data = {
// startTime: this.getCurrentTime(),
// endTime: this.getCurrentTime(1),
// gridld: grids.join(",")
// }
// statgrid(data).then(res=>{
// this.$set(item,'total',res.data.total);
// item.total = res.data.total;
// item.handled = res.data.handled;
// item.unhandled = res.data.unhandled;
// console.log(res,"");
// })
}, },
getquyu(newQuyu){ async getquyu(newQuyu){
let data = newQuyu.map((item)=>{ try {
let quyuarr = [...newQuyu]
let promises = quyuarr.map(async(item)=>{
let data = { let data = {
startTime: this.getCurrentTime(), startTime: this.getCurrentTime(),
endTime: this.getCurrentTime(1), endTime: this.getCurrentTime(1),
gridld: item.id gridId: item.id
} }
statroad(data).then(res=>{ // setTimeout(async()=>{
this.$set(item,'total',res.data.total); const result = await statroad(data);
item.total = res.data.total; item.total = result.data.total;
item.handled = res.data.handled; item.handled = result.data.handled;
item.unhandled = res.data.unhandled; item.unhandled = result.data.unhandled;
}) // },500)
// statroad(data).then(res=>{
// this.$set(item,'total',res.data.total);
// item.total = res.data.total;
// item.handled = res.data.handled;
// item.unhandled = res.data.unhandled;
// })
return item; return item;
}) })
this.quyuArray = data; const combinedData = await Promise.all(promises);
this.quyuArray = combinedData;
} catch (error) {
}
}, },
getLuduan(newLuduan){ async getLuduan(newLuduan){
let data = newLuduan.map((item)=>{ try {
let promises = newLuduan.map(async (item)=>{
let data = { let data = {
startTime: this.getCurrentTime(), startTime: this.getCurrentTime(),
endTime: this.getCurrentTime(1), endTime: this.getCurrentTime(1),
gridld: item.id gridId: item.id
} }
statregion(data).then(res=>{ const result = await statregion(data);
this.$set(item,'total',res.data.total); item.total = result.data.total;
item.total = res.data.total; item.handled = result.data.handled;
item.handled = res.data.handled; item.unhandled = result.data.unhandled;
item.unhandled = res.data.unhandled; // statregion(data).then(res=>{
}) // this.$set(item,'total',res.data.total);
// item.total = res.data.total;
// item.handled = res.data.handled;
// item.unhandled = res.data.unhandled;
// })
return item; return item;
}) })
this.luduanArray = data; const combinedData = await Promise.all(promises);
this.luduanArray = combinedData;
} catch (error) {
}
}, },
getCurrentTime(id) { getCurrentTime(id) {
const currentDate = new Date(); const currentDate = new Date();

Loading…
Cancel
Save