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

Lvtianfang
吕天方 11 months ago
parent a26614ba14
commit c7e9b3d0db

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

Loading…
Cancel
Save