Browse Source

高速云事件改版

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

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

@ -25,11 +25,11 @@
<div class="cright"> <div class="cright">
<div style="display: flex;justify-content: flex-end;padding-right: 20px;"><Search ref="search" /></div> <div style="display: flex;justify-content: flex-end;padding-right: 20px;"><Search ref="search" /></div>
<div v-if="curid === ''" style="height:300px"></div> <div v-if="curid === ''" style="height:300px"></div>
<div class="tag1A" v-if="curid==='8' ">方向济南<span></span></div> <div class="tag1A" v-if="curid==='7' ">方向济南<span></span></div>
<div class="tag2A" v-if="curid==='8' "><span></span>方向菏泽</div> <div class="tag2A" v-if="curid==='7' "><span></span>方向菏泽</div>
<div class="tag1A" v-if=" curid==='9'">方向出口<span></span></div> <div class="tag1A" v-if=" curid==='8'">方向出口<span></span></div>
<div class="tag2A" v-if=" curid==='9'"><span></span>方向入口</div> <div class="tag2A" v-if=" curid==='8'"><span></span>方向入口</div>
<div :hidden="curid==='' || curid==='7'" class="charts "id="charts"></div> <div :hidden="curid==='' || curid==='6'" class="charts "id="charts"></div>
<div style="overflow: none;height: 450px"> <div style="overflow: none;height: 450px">
<Table :data="tableData" style="width: 99%;margin-top: 30px;" height="430px"> <Table :data="tableData" style="width: 99%;margin-top: 30px;" height="430px">
@ -70,38 +70,41 @@ export default {
id:'a', id:'a',
label:'交通事件', label:'交通事件',
children:[ children:[
{ id:'1', label:'事多发路段'}, { id:'1', label:'事多发路段'},
{ id:'2', label:'事件类型分析'}, { id:'2', label:'事件类型分析'},
{ id:'3', label:'事故车型分析'}, { id:'3', label:'事件时间分析'},
{ id:'4', label:'事故时间分析'}, { id:'4', label:'事件地市分布'},
{ id:'5', label:'事故地市分布'}, { id:'5', label:'交通管制情况统计'},
{ id:'6', label:'交通管制情况统计'},
] ]
},{ },{
id:'b', id:'b',
label:'天气情况统计', label:'天气情况统计',
children:[ children:[
{ id:'7', label:'天气情况统计'}, { id:'6', label:'天气情况统计'},
] ]
},{ },{
id:'c', id:'c',
label:'交通量统计', label:'交通量统计',
children:[ children:[
{ id:'8', label:'门架车流量'}, { id:'7', label:'门架车流量'},
{ id:'9', label:'收费站车流量'}, { id:'8', label:'收费站车流量'},
] ]
},{ },{
id:'d', id:'d',
label:'交通事故情况', label:'交通事故情况',
children:[ children:[
{ id:'10', label:'事故类型统计'}, { id:'9', label:'事故类型统计'},
{ id:'10', label:'事故车型分析'},
{ id:'11', label:'事故时间分析'},
{ id:'12', label:'事故地市分布'},
{ id:'13', label:'事故路段分布'},
] ]
},{ },{
id:'e', id:'e',
label:'拥堵情况', label:'拥堵情况',
children:[ children:[
{ id:'11', label:'拥堵地点统计'}, { id:'14', label:'拥堵地点统计'},
{ id:'12', label:'路段平均拥堵时长'}, { id:'15', label:'路段平均拥堵时长'},
] ]
} }
], ],
@ -139,7 +142,7 @@ export default {
bind(){ bind(){
let id = this.$refs.menu.getCurrentKey(); let id = this.$refs.menu.getCurrentKey();
let query = this.$refs.search.searchQuery(); let query = this.$refs.search.searchQuery();
const {thisTime,lastTime} = query; const {lastTime,thisTime} = query;
if(id==='1'){ if(id==='1'){
request({ request({
url: '/business/sdhsEvent/sectionAnalysis', url: '/business/sdhsEvent/sectionAnalysis',
@ -201,79 +204,16 @@ export default {
}, 200) }, 200)
}) })
} else if(id==='3'){ } else if(id==='3'){
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==='4'){
let unit = '时'; let unit = '时';
if(query.type === '1'){unit='日'} if(query.type === '1'){unit='日'}
else if(query.type === '0'){unit='月'} else if(query.type === '0'){unit='月'}
request({ request({
url: '/business/sdhsEvent/accidentTimeAnalysis', url: '/business/sdhsEvent/eventTimeAnalysis',
method: 'post', method: 'post',
data: query data: query
}).then(result=>{ }).then(result=>{
if (result.code != 200) return this.$message.error(result?.msg); if (result.code != 200) return this.$message.error(result?.msg);
this.tableCols = [{label:'事时间',value:'time'},{label:thisTime+'事总量(起)',value:'num'},{label:lastTime+'事总量(起)',value:'numYes'}] this.tableCols = [{label:'事件时间',value:'time'},{label:thisTime+'事件总量(起)',value:'num'},{label:lastTime+'事件总量(起)',value:'numYes'}]
let _tableData = [] let _tableData = []
chartsOptions4.series[0].name = thisTime; chartsOptions4.series[0].name = thisTime;
@ -309,9 +249,9 @@ export default {
this.myChart.resize(); this.myChart.resize();
},200) },200)
}) })
} else if(id==='5'){ } else if(id==='4'){
request({ request({
url: '/business/sdhsEvent/selectRegionAnalysis', url: '/business/sdhsEvent/selectEventRegionAnalysis',
method: 'post', method: 'post',
data: query data: query
}).then(result=>{ }).then(result=>{
@ -340,7 +280,7 @@ export default {
this.myChart.resize(); this.myChart.resize();
}, 200); }, 200);
}) })
} else if(id==='6'){ } else if(id==='5'){
request({ request({
url: '/business/sdhsEvent/selectStationAnalysis', url: '/business/sdhsEvent/selectStationAnalysis',
method: 'post', method: 'post',
@ -383,7 +323,7 @@ export default {
}, 200); }, 200);
}) })
} else if(id==='7'){ } else if(id==='6'){
request({ request({
url: '/business/sdhsEvent/selectWeather', url: '/business/sdhsEvent/selectWeather',
method: 'post' method: 'post'
@ -405,7 +345,7 @@ export default {
}) })
} else if(id==='8'){ } else if(id==='7'){
request({ request({
url: '/business/sdhsEvent/gantryAnalysis', url: '/business/sdhsEvent/gantryAnalysis',
method: 'post', method: 'post',
@ -459,7 +399,7 @@ export default {
this.myChart.resize(); this.myChart.resize();
}, 200); }, 200);
}) })
} else if(id==='9'){ } else if(id==='8'){
request({ request({
url: '/business/sdhsEvent/TollBoothStatisticsList', url: '/business/sdhsEvent/TollBoothStatisticsList',
method: 'post', method: 'post',
@ -514,7 +454,7 @@ export default {
this.myChart.resize(); this.myChart.resize();
}, 200); }, 200);
}) })
} else if(id==='10'){ } else if(id==='9'){
request({ request({
url: '/business/sdhsEvent/selectAccidentType', url: '/business/sdhsEvent/selectAccidentType',
method: 'post', method: 'post',
@ -544,7 +484,177 @@ export default {
this.myChart.resize(); this.myChart.resize();
}, 200); }, 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'){ } 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({ request({
url: '/business/sdhsEvent/congestedLocation', url: '/business/sdhsEvent/congestedLocation',
method: 'post', method: 'post',
@ -576,7 +686,7 @@ export default {
}) })
} else if(id==='12'){ } else if(id==='15'){
request({ request({
url: '/business/sdhsEvent/congestedTime', url: '/business/sdhsEvent/congestedTime',
method: 'post', 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")) this.dateTime.unshift(moment(this.dateTime[0]).subtract(1,'years').subtract.format("YYYY-MM-DD"))
} }
} }
let thisTime = this.dateTime[0]; this.dateTime.sort((a, b) => a - b);
let lastTime = this.dateTime[1]; let lastTime = this.dateTime[0];
let thisTime = this.dateTime[1];
if (this.type == 2) { // if (this.type == 2) { //
thisTime = moment(this.dateTime[0]).format("YYYY-MM-DD"); lastTime = moment(this.dateTime[0]).format("YYYY-MM-DD");
lastTime = moment(this.dateTime[1]).format("YYYY-MM-DD"); thisTime = moment(this.dateTime[1]).format("YYYY-MM-DD");
} else if (this.type == 1) { // } else if (this.type == 1) { //
thisTime = moment(this.dateTime[0]).format("YYYY-MM"); lastTime = moment(this.dateTime[0]).format("YYYY-MM");
lastTime = moment(this.dateTime[1]).format("YYYY-MM"); thisTime = moment(this.dateTime[1]).format("YYYY-MM");
} else if (this.type == 0) { // } else if (this.type == 0) { //
thisTime = moment(this.dateTime[0]).format("YYYY"); lastTime = moment(this.dateTime[0]).format("YYYY");
lastTime = moment(this.dateTime[1]).format("YYYY"); thisTime = moment(this.dateTime[1]).format("YYYY");
} }
return {type: this.type, thisTime,lastTime} return {type: this.type, thisTime,lastTime}
}, },
@ -175,8 +176,8 @@ export default {
this.selectIndex = 1; this.selectIndex = 1;
this.reset = true; this.reset = true;
this.direction = "1"; this.direction = "1";
this.type = "1"; this.type = "0";
this.dateTime = [moment().subtract(1,'years').format("YYYY-MM-DD"),moment().format("YYYY-MM-DD")]; this.dateTime = [moment().subtract(1,'years').format("YYYY"),moment().format("YYYY")];
this.$parent.bind() this.$parent.bind()
}, },
onQuery(){ onQuery(){

Loading…
Cancel
Save