Commit 3aa6f4b2 authored by zhanglw's avatar zhanglw

首页运载量图表

parent 239d6ee4
......@@ -2062,7 +2062,8 @@ var HttpReq = function(){
//大屏——数据总览——中间下方图表
apiPlanTime1Query: function(param){
return request({
url: '/api/Plan/time',
// url: '/api/Plan/time',
url: '/api/carManager/productionByHour',
method: 'get',
params:param,
})
......
......@@ -134,7 +134,7 @@
<div class="voiceAppContent_4">
<button class="voiceAppContent_4_btns" @click="openVoiceView('广播')">广播</button>
<button class="voiceAppContent_4_btns" @click="openVoiceView('紧急通知')">紧急通知</button>
<button class="voiceAppContent_4_btns">下班</button>
<button class="voiceAppContent_4_btns" @click="openVoiceView('下班')">下班</button>
</div>
</div>
</div>
......@@ -188,7 +188,9 @@
</div>
<!-- 录音弹窗 -->
<div class="peopleScheAssembly" v-if="voiceViewShow">
<div style="color:white;font-size:14px;margin-bottom:1vh;font-size: 18px;font-weight: 600;">车辆调度<span style="font-size:14px">{{curPaItem.pointName}}</span></div>
<div style="color:white;font-size:14px;margin-bottom:1vh;font-size: 18px;font-weight: 600;">{{actionType==='下班'?'车辆下班':'车辆调度'}}
<!-- <span style="font-size:14px">{{curPaItem.pointName}}</span>-->
</div>
<el-select v-show="actionType!=='通话'" v-model="selectCarFleet" placeholder="请选择车队" style="width:100%;margin:5px" @change="toSearchFn()" :popper-append-to-body="false">
<el-option v-for="(item,index) in carFleetData" :key="index" :label="item.name" :value="item.name" style="font-size:14px;"></el-option>
</el-select>
......@@ -238,7 +240,8 @@
</div>
</div>
<div class="voiceAppContent_4">
<button class="voiceAppContent_4_btns" @click="closeVoiceView()">关闭录音</button>
<button v-show="actionType==='下班'" class="voiceAppContent_4_btns" @click="closeVoiceView(1)">下班</button>
<button class="voiceAppContent_4_btns" @click="closeVoiceView()">关闭</button>
</div>
</div>
</div>
......@@ -366,8 +369,11 @@ export default {
//开启录音
this.recOpen();
},
closeVoiceView(){
closeVoiceView(isXb){
this.voiceViewShow=false;
if(isXb){
}
//结束录音
this.recClose()
},
......
......@@ -4,7 +4,7 @@
<div class="dataScrView_centerView_title">
<div :class="centerViewData.moduleText == 'centerModule1' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule1')">产量数据</div>
<div :class="centerViewData.moduleText == 'centerModule2' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule2')">运载数据</div>
<div :class="centerViewData.moduleText == 'centerModule3' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule3')">装载数据</div>
<!-- <div :class="centerViewData.moduleText == 'centerModule3' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule3')">装载数据</div>-->
</div>
<div class="dataScrView_centerView_planNum" v-if="centerViewData.moduleText == 'centerModule1'">
<div>
......@@ -162,7 +162,7 @@ export default {
//中间模块选择
centerViewData:{
moduleText:'centerModule1',
xAxisData:['7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00'],
xAxisData:['00:00','01:00','02:00','03:00','04:00','05:00','06:00','07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00','20:00','21:00','22:00','23:00'],
seriesData:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
},
}
......@@ -171,20 +171,20 @@ export default {
this.loadData();
},
methods:{
loadData(){
loadData() {
//获取采区当前日产量
HttpReq.truckDispatching.apiPlanDayQuery().then((res) => {
let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){
if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0;
undueArray.finish = 0;
undueArray.plan = 0;
}else{
if(res[0].eff == ''){
} else {
if (res[0].eff == '') {
undueArray.eff = 0;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
}else{
} else {
undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
......@@ -195,16 +195,16 @@ export default {
//获取采区当前月产量
HttpReq.truckDispatching.apiPlanMonthQuery().then((res) => {
let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){
if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0;
undueArray.finish = 0;
undueArray.plan = 0;
}else{
if(res[0].eff == ''){
} else {
if (res[0].eff == '') {
undueArray.eff = 0;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
}else{
} else {
undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
......@@ -215,16 +215,16 @@ export default {
//获取采区当前年产量
HttpReq.truckDispatching.apiPlanYearQuery().then((res) => {
let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){
if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0;
undueArray.finish = 0;
undueArray.plan = 0;
}else{
if(res[0].eff == ''){
} else {
if (res[0].eff == '') {
undueArray.eff = 0;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
}else{
} else {
undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
......@@ -234,16 +234,16 @@ export default {
})
//中间echarts图表
HttpReq.truckDispatching.apiPlanTime1Query().then((res) => {
let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
res.forEach((item,index)=>{
arr3.splice(parseInt(item.hour) - 7,1, parseFloat(item.finish));
})
this.centerViewData.seriesData = arr3;
// let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// res.forEach((item, index) => {
// arr3.splice(parseInt(item.hour) - 7, 1, parseFloat(item.finish));
// })
this.centerViewData.seriesData = res.data || [];
this.centerEcharts();
})
//中间echarts运载数据
HttpReq.truckDispatching.apiPlanZDay1Query().then((res) => {
if(res.length != 0){
if (res.length != 0) {
this.carryCenterData.dayAllCarry1 = res[0].finish;
this.carryCenterData.dayAverageCarry1 = parseFloat(res[0].pfin).toFixed(2);
this.carryCenterData.dayAllMil1 = res[0].allmil ? parseFloat(res[0].allmil).toFixed(3) : 0;
......@@ -254,7 +254,7 @@ export default {
})
//中间echarts装载数据
HttpReq.truckDispatching.apiPlanZMonth1Query().then((res) => {
if(res.length != 0){
if (res.length != 0) {
this.loadCenterData.dayAllLoad1 = res[0].finish;
this.loadCenterData.dayAverageLoad1 = parseFloat(res[0].pfin).toFixed(2);
this.loadCenterData.dayAllTime = res[0].time;
......@@ -266,16 +266,16 @@ export default {
//获取采区当前日产量
HttpReq.truckDispatching.apiPlanDayQuery().then((res) => {
let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){
if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0;
undueArray.finish = 0;
undueArray.plan = 0;
}else{
if(res[0].eff == ''){
} else {
if (res[0].eff == '') {
undueArray.eff = 0;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
}else{
} else {
undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
......@@ -286,16 +286,16 @@ export default {
//获取采区当前月产量
HttpReq.truckDispatching.apiPlanMonthQuery().then((res) => {
let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){
if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0;
undueArray.finish = 0;
undueArray.plan = 0;
}else{
if(res[0].eff == ''){
} else {
if (res[0].eff == '') {
undueArray.eff = 0;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
}else{
} else {
undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
......@@ -306,16 +306,16 @@ export default {
//获取采区当前年产量
HttpReq.truckDispatching.apiPlanYearQuery().then((res) => {
let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){
if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0;
undueArray.finish = 0;
undueArray.plan = 0;
}else{
if(res[0].eff == ''){
} else {
if (res[0].eff == '') {
undueArray.eff = 0;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
}else{
} else {
undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan;
......@@ -325,16 +325,16 @@ export default {
})
//中间echarts图表
HttpReq.truckDispatching.apiPlanTime1Query().then((res) => {
let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
res.forEach((item,index)=>{
arr3.splice(parseInt(item.hour) - 7,1, parseFloat(item.finish));
})
this.centerViewData.seriesData = arr3;
// let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// res.forEach((item,index)=>{
// arr3.splice(parseInt(item.hour) - 7,1, parseFloat(item.finish));
// })
this.centerViewData.seriesData = res.data || [];
this.centerEcharts();
})
//中间echarts运载数据
HttpReq.truckDispatching.apiPlanZDay1Query().then((res) => {
if(res.length != 0){
if (res.length != 0) {
this.carryCenterData.dayAllCarry1 = res[0].finish;
this.carryCenterData.dayAverageCarry1 = parseFloat(res[0].pfin).toFixed(2);
this.carryCenterData.dayAllMil1 = res[0].allmil ? parseFloat(res[0].allmil).toFixed(3) : 0;
......@@ -345,7 +345,7 @@ export default {
})
//中间echarts装载数据
HttpReq.truckDispatching.apiPlanZMonth1Query().then((res) => {
if(res.length != 0){
if (res.length != 0) {
this.loadCenterData.dayAllLoad1 = res[0].finish;
this.loadCenterData.dayAverageLoad1 = parseFloat(res[0].pfin).toFixed(2);
this.loadCenterData.dayAllTime = res[0].time;
......@@ -353,15 +353,15 @@ export default {
}
})
},10000)
}, 10000)
},
//中间模块选择
centerSelectFn(text){
centerSelectFn(text) {
this.centerViewData.moduleText = text;
},
//中间模块Echarts
centerEcharts(){
centerEcharts() {
echarts.init(document.getElementById('centerEchartsView')).dispose();
var myChart = echarts.init(document.getElementById('centerEchartsView'));
var option = {
......@@ -382,12 +382,12 @@ export default {
{
type: 'category',
data: this.centerViewData.xAxisData,
axisTick: {
alignWithLabel: true
},
axisPointer: {
type: 'shadow'
},
// axisTick: {
// alignWithLabel: true
// },
// axisPointer: {
// type: 'shadow'
// },
axisLabel: {
show: true,
textStyle: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment