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

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 data = { let wagearr = [...newWange]
startTime: this.getCurrentTime(), let promises = wagearr.map(async (item)=>{
endTime: this.getCurrentTime(1), let data = {
gridld: item.id startTime: this.getCurrentTime(),
} // startTime: '2024-01-01',
statgrid(data).then(res=>{ endTime: this.getCurrentTime(1),
this.$set(item,'total',res.data.total); // endTime: '2024-04-01',
item.total = res.data.total; gridId: item.id
item.handled = res.data.handled; }
item.unhandled = res.data.unhandled; const result = await statgrid(data);
item.total = result.data.total;
item.handled = result.data.handled;
item.unhandled = result.data.unhandled;
return item;
}) })
return item; const combinedData = await Promise.all(promises);
}) this.wanggeArray = combinedData;
this.wanggeArray = data; } catch {
// let grids = []
// newWange.map((item)=>{ }
// 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 data = { let quyuarr = [...newQuyu]
startTime: this.getCurrentTime(), let promises = quyuarr.map(async(item)=>{
endTime: this.getCurrentTime(1), let data = {
gridld: item.id startTime: this.getCurrentTime(),
} endTime: this.getCurrentTime(1),
statroad(data).then(res=>{ gridId: item.id
this.$set(item,'total',res.data.total); }
item.total = res.data.total; // setTimeout(async()=>{
item.handled = res.data.handled; const result = await statroad(data);
item.unhandled = res.data.unhandled; item.total = result.data.total;
item.handled = result.data.handled;
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; const combinedData = await Promise.all(promises);
}) this.quyuArray = combinedData;
this.quyuArray = data; } catch (error) {
}
}, },
getLuduan(newLuduan){ async getLuduan(newLuduan){
let data = newLuduan.map((item)=>{ try {
let data = { let promises = newLuduan.map(async (item)=>{
startTime: this.getCurrentTime(), let data = {
endTime: this.getCurrentTime(1), startTime: this.getCurrentTime(),
gridld: item.id endTime: this.getCurrentTime(1),
} gridId: item.id
statregion(data).then(res=>{ }
this.$set(item,'total',res.data.total); const result = await statregion(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;
// 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; const combinedData = await Promise.all(promises);
}) this.luduanArray = combinedData;
this.luduanArray = data; } catch (error) {
}
}, },
getCurrentTime(id) { getCurrentTime(id) {
const currentDate = new Date(); const currentDate = new Date();

Loading…
Cancel
Save