|
|
@ -43,6 +43,13 @@ export default { |
|
|
|
params |
|
|
|
}) |
|
|
|
}, |
|
|
|
getTrafficFlowAtToll(params){ |
|
|
|
return request({ |
|
|
|
url: `/business/traffic-statistics/history/trafficFlowAtToll`, |
|
|
|
method: "get", |
|
|
|
params |
|
|
|
}) |
|
|
|
}, |
|
|
|
toDecimal(x){ |
|
|
|
var f = parseFloat(x) |
|
|
|
if(isNaN(f)){ |
|
|
@ -68,12 +75,10 @@ export default { |
|
|
|
|
|
|
|
//日累计车流量 |
|
|
|
request({ |
|
|
|
url: `/business/traffic-statistics/history/trafficFlowAtToll`, |
|
|
|
method: "get", |
|
|
|
params: { |
|
|
|
periodType: 4, |
|
|
|
startTime: moment().format('YYYY-MM-DD')+ ' 00:00:00', |
|
|
|
endTime: moment().format('YYYY-MM-DD')+ ' 23:59:59', |
|
|
|
url: `/business/traffic-statistics/history/trafficFlowAtToll`, |
|
|
|
method: "get", |
|
|
|
params: { |
|
|
|
startDate:moment().format('YYYY-MM-DD') |
|
|
|
} |
|
|
|
}).then((result) => { |
|
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
@ -81,36 +86,26 @@ export default { |
|
|
|
this.list[1].value = this.toDecimal(_count/10000) |
|
|
|
}) |
|
|
|
|
|
|
|
this.getAccumulatedFlow({ |
|
|
|
periodType: 4, |
|
|
|
startTime: moment().subtract(1,'day').format('YYYY-MM-DD')+ ' 00:00:00', |
|
|
|
endTime: moment().subtract(1,'day').format('YYYY-MM-DD')+ ' 23:59:59', |
|
|
|
this.getTrafficFlowAtToll({ |
|
|
|
startDate: moment().subtract(1,'day').format('YYYY-MM-DD') |
|
|
|
}).then((resultYes) => { |
|
|
|
this.getAccumulatedFlow({ |
|
|
|
periodType: 4, |
|
|
|
startTime: moment().subtract(2,'day').format('YYYY-MM-DD')+ ' 00:00:00', |
|
|
|
endTime: moment().subtract(2,'day').format('YYYY-MM-DD')+ ' 23:59:59', |
|
|
|
this.getTrafficFlowAtToll({ |
|
|
|
startDate: moment().subtract(2,'day').format('YYYY-MM-DD') |
|
|
|
}).then((resultYes2) => { |
|
|
|
if(resultYes.data.length > 0){ |
|
|
|
let _countYes = resultYes.data[0].trafficVolume; |
|
|
|
let _countYes = resultYes.data; |
|
|
|
this.list[2].value = this.toDecimal(_countYes/10000) |
|
|
|
|
|
|
|
if(resultYes2.data.length > 0){ |
|
|
|
|
|
|
|
let _countYes2 = resultYes2.data[0].trafficVolume; |
|
|
|
let num = ((_countYes - _countYes2)/_countYes2 * 100) |
|
|
|
let _countYes2 = resultYes2.data; |
|
|
|
let num = ((_countYes - _countYes2)/_countYes2 * 100) |
|
|
|
|
|
|
|
if(num > 0){ |
|
|
|
this.list[3].color = '#22cd39' |
|
|
|
num = `↑ +${ this.toDecimal(num)}%` |
|
|
|
} else { |
|
|
|
this.list[3].color = '#D9001B' |
|
|
|
num = `↓ ${ this.toDecimal(num)}%` |
|
|
|
} |
|
|
|
this.list[3].value = num |
|
|
|
if(num > 0){ |
|
|
|
this.list[3].color = '#22cd39' |
|
|
|
num = `↑ +${ this.toDecimal(num)}%` |
|
|
|
} else { |
|
|
|
this.list[3].color = '#D9001B' |
|
|
|
num = `↓ ${ this.toDecimal(num)}%` |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.list[3].value = num |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|