Browse Source

高速云事件改版

develop
lau572 1 month ago
parent
commit
d4f2018b0d
  1. 334
      ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/index.vue
  2. 21
      ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue

334
ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/index.vue

@ -25,11 +25,11 @@
<div class="cright">
<div style="display: flex;justify-content: flex-end;padding-right: 20px;"><Search ref="search" /></div>
<div v-if="curid === ''" style="height:300px"></div>
<div class="tag1A" v-if="curid==='8' ">方向济南<span></span></div>
<div class="tag2A" v-if="curid==='8' "><span></span>方向菏泽</div>
<div class="tag1A" v-if=" curid==='9'">方向出口<span></span></div>
<div class="tag2A" v-if=" curid==='9'"><span></span>方向入口</div>
<div :hidden="curid==='' || curid==='7'" class="charts "id="charts"></div>
<div class="tag1A" v-if="curid==='7' ">方向济南<span></span></div>
<div class="tag2A" v-if="curid==='7' "><span></span>方向菏泽</div>
<div class="tag1A" v-if=" curid==='8'">方向出口<span></span></div>
<div class="tag2A" v-if=" curid==='8'"><span></span>方向入口</div>
<div :hidden="curid==='' || curid==='6'" class="charts "id="charts"></div>
<div style="overflow: none;height: 450px">
<Table :data="tableData" style="width: 99%;margin-top: 30px;" height="430px">
@ -70,38 +70,41 @@ export default {
id:'a',
label:'交通事件',
children:[
{ id:'1', label:'事多发路段'},
{ id:'1', label:'事多发路段'},
{ id:'2', label:'事件类型分析'},
{ id:'3', label:'事故车型分析'},
{ id:'4', label:'事故时间分析'},
{ id:'5', label:'事故地市分布'},
{ id:'6', label:'交通管制情况统计'},
{ id:'3', label:'事件时间分析'},
{ id:'4', label:'事件地市分布'},
{ id:'5', label:'交通管制情况统计'},
]
},{
id:'b',
label:'天气情况统计',
children:[
{ id:'7', label:'天气情况统计'},
{ id:'6', label:'天气情况统计'},
]
},{
id:'c',
label:'交通量统计',
children:[
{ id:'8', label:'门架车流量'},
{ id:'9', label:'收费站车流量'},
{ id:'7', label:'门架车流量'},
{ id:'8', label:'收费站车流量'},
]
},{
id:'d',
label:'交通事故情况',
children:[
{ id:'10', label:'事故类型统计'},
{ id:'9', label:'事故类型统计'},
{ id:'10', label:'事故车型分析'},
{ id:'11', label:'事故时间分析'},
{ id:'12', label:'事故地市分布'},
{ id:'13', label:'事故路段分布'},
]
},{
id:'e',
label:'拥堵情况',
children:[
{ id:'11', label:'拥堵地点统计'},
{ id:'12', label:'路段平均拥堵时长'},
{ id:'14', label:'拥堵地点统计'},
{ id:'15', label:'路段平均拥堵时长'},
]
}
],
@ -139,7 +142,7 @@ export default {
bind(){
let id = this.$refs.menu.getCurrentKey();
let query = this.$refs.search.searchQuery();
const {thisTime,lastTime} = query;
const {lastTime,thisTime} = query;
if(id==='1'){
request({
url: '/business/sdhsEvent/sectionAnalysis',
@ -201,105 +204,42 @@ export default {
}, 200)
})
} else if(id==='3'){
let unit = '时';
if(query.type === '1'){unit='日'}
else if(query.type === '0'){unit='月'}
request({
url: '/business/sdhsEvent/accidentModelAnalysis',
url: '/business/sdhsEvent/eventTimeAnalysis',
method: 'post',
data: query
}).then(result=>{
if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [
{label:'事故类型',value:'name'},
{label:'货车'+thisTime,value:'货车'+thisTime},
{label:'小型车'+thisTime,value:'小型车'+thisTime},
{label:'客车'+thisTime,value:'客车'+thisTime},
{label:'货车'+lastTime,value:'货车'+lastTime},
{label:'小型车'+lastTime,value:'小型车'+lastTime},
{label:'客车'+lastTime,value:'客车'+lastTime}
]
chartsOptions3.series[0].name = '货车'+thisTime
chartsOptions3.series[1].name = '小型车'+thisTime
chartsOptions3.series[2].name = '客车'+thisTime
chartsOptions3.series[3].name = '货车'+lastTime
chartsOptions3.series[4].name = '小型车'+lastTime
chartsOptions3.series[5].name = '客车'+lastTime
if(_.keys(result.data).length === 0){
this.tableCols = [{label:'事件时间',value:'time'},{label:thisTime+'事件总量(起)',value:'num'},{label:lastTime+'事件总量(起)',value:'numYes'}]
let _tableData = []
chartsOptions3.series[0].data = []
chartsOptions3.series[1].data = []
chartsOptions3.series[2].data = []
chartsOptions3.series[3].data = []
chartsOptions3.series[4].data = []
chartsOptions3.series[5].data = []
this.myChart.setOption(chartsOptions3);
chartsOptions4.series[0].name = thisTime;
chartsOptions4.series[1].name = lastTime;
this.curid = id;
if(_.keys(result.data[thisTime]).length === 0){
chartsOptions4.series[0].data = []
chartsOptions4.series[1].data = []
chartsOptions4.xAxis.data = [];
this.myChart.setOption(chartsOptions4);
this.myChart.resize();
this.tableData = []
this.$message.warning('暂无数据')
return;
}
let _tableData = []
for(let i in result.data[thisTime]){
const _row = {name:i}
_row['货车'+thisTime] = result.data[thisTime][i]['货车']||0
_row['小型车'+thisTime] = result.data[thisTime][i]['小型车']||0
_row['客车'+thisTime] = result.data[thisTime][i]['客车']||0
_row['货车'+lastTime] = result.data[lastTime][i]['货车']||0
_row['小型车'+lastTime] = result.data[lastTime][i]['小型车']||0
_row['客车'+lastTime] = result.data[lastTime][i]['客车']||0
_tableData.push(_row)
_tableData.push({
idx:parseInt(i),
time:i.toString()+ unit,
num:result.data[thisTime][i.toString()],
numYes:result.data[lastTime][i.toString()]
})
}
_tableData.sort(function(a,b){return a.idx-b.idx})
this.tableData = _tableData;
this.curid = id;
setTimeout(() => {
chartsOptions3.xAxis.data = _tableData.map(x=>x.name);
chartsOptions3.series[0].data = _tableData.map(x=>x['货车'+thisTime])
chartsOptions3.series[1].data = _tableData.map(x=>x['小型车'+thisTime])
chartsOptions3.series[2].data = _tableData.map(x=>x['客车'+thisTime])
chartsOptions3.series[3].data = _tableData.map(x=>x['货车'+lastTime])
chartsOptions3.series[4].data = _tableData.map(x=>x['小型车'+lastTime])
chartsOptions3.series[5].data = _tableData.map(x=>x['客车'+lastTime])
this.myChart.setOption(chartsOptions3);
this.myChart.resize();
}, 200);
})
} else if(id==='4'){
let unit = '时';
if(query.type === '1'){unit='日'}
else if(query.type === '0'){unit='月'}
request({
url: '/business/sdhsEvent/accidentTimeAnalysis',
method: 'post',
data: query
}).then(result=>{
if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [{label:'事故时间',value:'time'},{label:thisTime+'事故总量(起)',value:'num'},{label:lastTime+'事故总量(起)',value:'numYes'}]
let _tableData = []
chartsOptions4.series[0].name = thisTime;
chartsOptions4.series[1].name = lastTime;
this.curid = id;
if(_.keys(result.data[thisTime]).length === 0){
chartsOptions4.series[0].data = []
chartsOptions4.series[1].data = []
chartsOptions4.xAxis.data = [];
this.myChart.setOption(chartsOptions4);
this.myChart.resize();
this.tableData = []
this.$message.warning('暂无数据')
return;
}
for(let i in result.data[thisTime]){
_tableData.push({
idx:parseInt(i),
time:i.toString()+ unit,
num:result.data[thisTime][i.toString()],
numYes:result.data[lastTime][i.toString()]
})
}
_tableData.sort(function(a,b){return a.idx-b.idx})
this.tableData = _tableData;
setTimeout(() => {
chartsOptions4.series[0].data = _tableData.map(x=>x.num)
@ -307,11 +247,11 @@ export default {
chartsOptions4.xAxis.data = _tableData.map(x=>x.time);
this.myChart.setOption(chartsOptions4);
this.myChart.resize();
},200)
},200)
})
} else if(id==='5'){
} else if(id==='4'){
request({
url: '/business/sdhsEvent/selectRegionAnalysis',
url: '/business/sdhsEvent/selectEventRegionAnalysis',
method: 'post',
data: query
}).then(result=>{
@ -332,7 +272,7 @@ export default {
this.tableData = result.data;
this.curid = id;
setTimeout(() => {
chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime])
chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime])
chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime])
chartsOptions.xAxis.data = result.data.map(x=>x.city);
@ -340,7 +280,7 @@ export default {
this.myChart.resize();
}, 200);
})
} else if(id==='6'){
} else if(id==='5'){
request({
url: '/business/sdhsEvent/selectStationAnalysis',
method: 'post',
@ -383,7 +323,7 @@ export default {
}, 200);
})
} else if(id==='7'){
} else if(id==='6'){
request({
url: '/business/sdhsEvent/selectWeather',
method: 'post'
@ -405,7 +345,7 @@ export default {
})
} else if(id==='8'){
} else if(id==='7'){
request({
url: '/business/sdhsEvent/gantryAnalysis',
method: 'post',
@ -459,7 +399,7 @@ export default {
this.myChart.resize();
}, 200);
})
} else if(id==='9'){
} else if(id==='8'){
request({
url: '/business/sdhsEvent/TollBoothStatisticsList',
method: 'post',
@ -514,7 +454,7 @@ export default {
this.myChart.resize();
}, 200);
})
} else if(id==='10'){
} else if(id==='9'){
request({
url: '/business/sdhsEvent/selectAccidentType',
method: 'post',
@ -536,7 +476,7 @@ export default {
this.tableData = result.data;
this.curid = id;
setTimeout(() => {
chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime])
chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime])
chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime])
chartsOptions.xAxis.data = this.tableData.map(x=>x.eventSubclass);
@ -544,7 +484,177 @@ export default {
this.myChart.resize();
}, 200);
})
} else if(id==='10'){
request({
url: '/business/sdhsEvent/accidentModelAnalysis',
method: 'post',
data: query
}).then(result=>{
if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [
{label:'事故类型',value:'name'},
{label:'货车'+thisTime,value:'货车'+thisTime},
{label:'小型车'+thisTime,value:'小型车'+thisTime},
{label:'客车'+thisTime,value:'客车'+thisTime},
{label:'货车'+lastTime,value:'货车'+lastTime},
{label:'小型车'+lastTime,value:'小型车'+lastTime},
{label:'客车'+lastTime,value:'客车'+lastTime}
]
chartsOptions3.series[0].name = '货车'+thisTime
chartsOptions3.series[1].name = '小型车'+thisTime
chartsOptions3.series[2].name = '客车'+thisTime
chartsOptions3.series[3].name = '货车'+lastTime
chartsOptions3.series[4].name = '小型车'+lastTime
chartsOptions3.series[5].name = '客车'+lastTime
if(_.keys(result.data).length === 0){
chartsOptions3.series[0].data = []
chartsOptions3.series[1].data = []
chartsOptions3.series[2].data = []
chartsOptions3.series[3].data = []
chartsOptions3.series[4].data = []
chartsOptions3.series[5].data = []
this.myChart.setOption(chartsOptions3);
this.myChart.resize();
this.tableData = []
this.$message.warning('暂无数据')
return;
}
let _tableData = []
for(let i in result.data[thisTime]){
const _row = {name:i}
_row['货车'+thisTime] = result.data[thisTime][i]['货车']||0
_row['小型车'+thisTime] = result.data[thisTime][i]['小型车']||0
_row['客车'+thisTime] = result.data[thisTime][i]['客车']||0
_row['货车'+lastTime] = result.data[lastTime][i]['货车']||0
_row['小型车'+lastTime] = result.data[lastTime][i]['小型车']||0
_row['客车'+lastTime] = result.data[lastTime][i]['客车']||0
_tableData.push(_row)
}
this.tableData = _tableData;
this.curid = id;
setTimeout(() => {
chartsOptions3.xAxis.data = _tableData.map(x=>x.name);
chartsOptions3.series[0].data = _tableData.map(x=>x['货车'+thisTime])
chartsOptions3.series[1].data = _tableData.map(x=>x['小型车'+thisTime])
chartsOptions3.series[2].data = _tableData.map(x=>x['客车'+thisTime])
chartsOptions3.series[3].data = _tableData.map(x=>x['货车'+lastTime])
chartsOptions3.series[4].data = _tableData.map(x=>x['小型车'+lastTime])
chartsOptions3.series[5].data = _tableData.map(x=>x['客车'+lastTime])
this.myChart.setOption(chartsOptions3);
this.myChart.resize();
}, 200);
})
} else if(id==='11'){
let unit = '时';
if(query.type === '1'){unit='日'}
else if(query.type === '0'){unit='月'}
request({
url: '/business/sdhsEvent/accidentTimeAnalysis',
method: 'post',
data: query
}).then(result=>{
if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [{label:'事故时间',value:'time'},{label:thisTime+'事故总量(起)',value:'num'},{label:lastTime+'事故总量(起)',value:'numYes'}]
let _tableData = []
chartsOptions4.series[0].name = thisTime;
chartsOptions4.series[1].name = lastTime;
this.curid = id;
if(_.keys(result.data[thisTime]).length === 0){
chartsOptions4.series[0].data = []
chartsOptions4.series[1].data = []
chartsOptions4.xAxis.data = [];
this.myChart.setOption(chartsOptions4);
this.myChart.resize();
this.tableData = []
this.$message.warning('暂无数据')
return;
}
for(let i in result.data[thisTime]){
_tableData.push({
idx:parseInt(i),
time:i.toString()+ unit,
num:result.data[thisTime][i.toString()],
numYes:result.data[lastTime][i.toString()]
})
}
_tableData.sort(function(a,b){return a.idx-b.idx})
this.tableData = _tableData;
setTimeout(() => {
chartsOptions4.series[0].data = _tableData.map(x=>x.num)
chartsOptions4.series[1].data = _tableData.map(x=>x.numYes)
chartsOptions4.xAxis.data = _tableData.map(x=>x.time);
this.myChart.setOption(chartsOptions4);
this.myChart.resize();
},200)
})
} else if(id==='12'){
request({
url: '/business/sdhsEvent/selectRegionAnalysis',
method: 'post',
data: query
}).then(result=>{
console.log(result)
if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [{label:'发生地区',value:'city'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}]
chartsOptions.series[0].name = thisTime;
chartsOptions.series[1].name = lastTime;
if(result.data.length===0){
chartsOptions.series[0].data = []
chartsOptions.series[1].data = []
this.myChart.setOption(chartsOptions);
this.myChart.resize();
this.tableData = []
this.$message.warning('暂无数据')
return;
}
this.tableData = result.data;
this.curid = id;
setTimeout(() => {
chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime])
chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime])
chartsOptions.xAxis.data = result.data.map(x=>x.city);
this.myChart.setOption(chartsOptions);
this.myChart.resize();
}, 200);
})
} else if(id==='13'){
request({
url: '/business/sdhsEvent/accidentSectionAnalysis',
method: 'post',
data: query
}).then(result=>{
if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [{label:'路段桩号',value:'stakeMark'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}]
chartsOptions.series[0].name = thisTime;
chartsOptions.series[1].name = lastTime;
if(result.data.length === 0){
this.tableData = []
chartsOptions.series[0].data = []
chartsOptions.series[1].data = []
this.myChart.setOption(chartsOptions);
this.myChart.resize();
this.$message.warning('暂无数据')
return;
}
this.tableData = result.data;
this.curid = id;
setTimeout(() => {
chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime])
chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime])
chartsOptions.xAxis.data = this.tableData.map(x=>x.stakeMark);
this.myChart.setOption(chartsOptions);
this.myChart.resize();
}, 200);
})
} else if(id==='14'){
request({
url: '/business/sdhsEvent/congestedLocation',
method: 'post',
@ -576,7 +686,7 @@ export default {
})
} else if(id==='12'){
} else if(id==='15'){
request({
url: '/business/sdhsEvent/congestedTime',
method: 'post',

21
ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue

@ -156,17 +156,18 @@ export default {
this.dateTime.unshift(moment(this.dateTime[0]).subtract(1,'years').subtract.format("YYYY-MM-DD"))
}
}
let thisTime = this.dateTime[0];
let lastTime = this.dateTime[1];
this.dateTime.sort((a, b) => a - b);
let lastTime = this.dateTime[0];
let thisTime = this.dateTime[1];
if (this.type == 2) { //
thisTime = moment(this.dateTime[0]).format("YYYY-MM-DD");
lastTime = moment(this.dateTime[1]).format("YYYY-MM-DD");
lastTime = moment(this.dateTime[0]).format("YYYY-MM-DD");
thisTime = moment(this.dateTime[1]).format("YYYY-MM-DD");
} else if (this.type == 1) { //
thisTime = moment(this.dateTime[0]).format("YYYY-MM");
lastTime = moment(this.dateTime[1]).format("YYYY-MM");
lastTime = moment(this.dateTime[0]).format("YYYY-MM");
thisTime = moment(this.dateTime[1]).format("YYYY-MM");
} else if (this.type == 0) { //
thisTime = moment(this.dateTime[0]).format("YYYY");
lastTime = moment(this.dateTime[1]).format("YYYY");
lastTime = moment(this.dateTime[0]).format("YYYY");
thisTime = moment(this.dateTime[1]).format("YYYY");
}
return {type: this.type, thisTime,lastTime}
},
@ -175,8 +176,8 @@ export default {
this.selectIndex = 1;
this.reset = true;
this.direction = "1";
this.type = "1";
this.dateTime = [moment().subtract(1,'years').format("YYYY-MM-DD"),moment().format("YYYY-MM-DD")];
this.type = "0";
this.dateTime = [moment().subtract(1,'years').format("YYYY"),moment().format("YYYY")];
this.$parent.bind()
},
onQuery(){

Loading…
Cancel
Save