Commit 3aa6f4b2 authored by zhanglw's avatar zhanglw

首页运载量图表

parent 239d6ee4
...@@ -2062,7 +2062,8 @@ var HttpReq = function(){ ...@@ -2062,7 +2062,8 @@ var HttpReq = function(){
//大屏——数据总览——中间下方图表 //大屏——数据总览——中间下方图表
apiPlanTime1Query: function(param){ apiPlanTime1Query: function(param){
return request({ return request({
url: '/api/Plan/time', // url: '/api/Plan/time',
url: '/api/carManager/productionByHour',
method: 'get', method: 'get',
params:param, params:param,
}) })
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<div class="voiceAppContent_4"> <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" @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> </div>
</div> </div>
...@@ -188,7 +188,9 @@ ...@@ -188,7 +188,9 @@
</div> </div>
<!-- 录音弹窗 --> <!-- 录音弹窗 -->
<div class="peopleScheAssembly" v-if="voiceViewShow"> <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-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-option v-for="(item,index) in carFleetData" :key="index" :label="item.name" :value="item.name" style="font-size:14px;"></el-option>
</el-select> </el-select>
...@@ -238,7 +240,8 @@ ...@@ -238,7 +240,8 @@
</div> </div>
</div> </div>
<div class="voiceAppContent_4"> <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> </div>
</div> </div>
...@@ -366,8 +369,11 @@ export default { ...@@ -366,8 +369,11 @@ export default {
//开启录音 //开启录音
this.recOpen(); this.recOpen();
}, },
closeVoiceView(){ closeVoiceView(isXb){
this.voiceViewShow=false; this.voiceViewShow=false;
if(isXb){
}
//结束录音 //结束录音
this.recClose() this.recClose()
}, },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="dataScrView_centerView_title"> <div class="dataScrView_centerView_title">
<div :class="centerViewData.moduleText == 'centerModule1' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule1')">产量数据</div> <div :class="centerViewData.moduleText == 'centerModule1' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule1')">产量数据</div>
<div :class="centerViewData.moduleText == 'centerModule2' ? 'centerModuleSelectStyle' : ''" @click="centerSelectFn('centerModule2')">运载数据</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>
<div class="dataScrView_centerView_planNum" v-if="centerViewData.moduleText == 'centerModule1'"> <div class="dataScrView_centerView_planNum" v-if="centerViewData.moduleText == 'centerModule1'">
<div> <div>
...@@ -162,7 +162,7 @@ export default { ...@@ -162,7 +162,7 @@ export default {
//中间模块选择 //中间模块选择
centerViewData:{ centerViewData:{
moduleText:'centerModule1', 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], seriesData:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
}, },
} }
...@@ -171,20 +171,20 @@ export default { ...@@ -171,20 +171,20 @@ export default {
this.loadData(); this.loadData();
}, },
methods:{ methods:{
loadData(){ loadData() {
//获取采区当前日产量 //获取采区当前日产量
HttpReq.truckDispatching.apiPlanDayQuery().then((res) => { HttpReq.truckDispatching.apiPlanDayQuery().then((res) => {
let undueArray = {}; let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){ if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = 0; undueArray.finish = 0;
undueArray.plan = 0; undueArray.plan = 0;
}else{ } else {
if(res[0].eff == ''){ if (res[0].eff == '') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
}else{ } else {
undueArray.eff = parseFloat(res[0].eff) * 100; undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
...@@ -195,16 +195,16 @@ export default { ...@@ -195,16 +195,16 @@ export default {
//获取采区当前月产量 //获取采区当前月产量
HttpReq.truckDispatching.apiPlanMonthQuery().then((res) => { HttpReq.truckDispatching.apiPlanMonthQuery().then((res) => {
let undueArray = {}; let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){ if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = 0; undueArray.finish = 0;
undueArray.plan = 0; undueArray.plan = 0;
}else{ } else {
if(res[0].eff == ''){ if (res[0].eff == '') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
}else{ } else {
undueArray.eff = parseFloat(res[0].eff) * 100; undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
...@@ -215,16 +215,16 @@ export default { ...@@ -215,16 +215,16 @@ export default {
//获取采区当前年产量 //获取采区当前年产量
HttpReq.truckDispatching.apiPlanYearQuery().then((res) => { HttpReq.truckDispatching.apiPlanYearQuery().then((res) => {
let undueArray = {}; let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){ if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = 0; undueArray.finish = 0;
undueArray.plan = 0; undueArray.plan = 0;
}else{ } else {
if(res[0].eff == ''){ if (res[0].eff == '') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
}else{ } else {
undueArray.eff = parseFloat(res[0].eff) * 100; undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
...@@ -234,16 +234,16 @@ export default { ...@@ -234,16 +234,16 @@ export default {
}) })
//中间echarts图表 //中间echarts图表
HttpReq.truckDispatching.apiPlanTime1Query().then((res) => { HttpReq.truckDispatching.apiPlanTime1Query().then((res) => {
let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; // let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
res.forEach((item,index)=>{ // res.forEach((item, index) => {
arr3.splice(parseInt(item.hour) - 7,1, parseFloat(item.finish)); // arr3.splice(parseInt(item.hour) - 7, 1, parseFloat(item.finish));
}) // })
this.centerViewData.seriesData = arr3; this.centerViewData.seriesData = res.data || [];
this.centerEcharts(); this.centerEcharts();
}) })
//中间echarts运载数据 //中间echarts运载数据
HttpReq.truckDispatching.apiPlanZDay1Query().then((res) => { HttpReq.truckDispatching.apiPlanZDay1Query().then((res) => {
if(res.length != 0){ if (res.length != 0) {
this.carryCenterData.dayAllCarry1 = res[0].finish; this.carryCenterData.dayAllCarry1 = res[0].finish;
this.carryCenterData.dayAverageCarry1 = parseFloat(res[0].pfin).toFixed(2); this.carryCenterData.dayAverageCarry1 = parseFloat(res[0].pfin).toFixed(2);
this.carryCenterData.dayAllMil1 = res[0].allmil ? parseFloat(res[0].allmil).toFixed(3) : 0; this.carryCenterData.dayAllMil1 = res[0].allmil ? parseFloat(res[0].allmil).toFixed(3) : 0;
...@@ -254,7 +254,7 @@ export default { ...@@ -254,7 +254,7 @@ export default {
}) })
//中间echarts装载数据 //中间echarts装载数据
HttpReq.truckDispatching.apiPlanZMonth1Query().then((res) => { HttpReq.truckDispatching.apiPlanZMonth1Query().then((res) => {
if(res.length != 0){ if (res.length != 0) {
this.loadCenterData.dayAllLoad1 = res[0].finish; this.loadCenterData.dayAllLoad1 = res[0].finish;
this.loadCenterData.dayAverageLoad1 = parseFloat(res[0].pfin).toFixed(2); this.loadCenterData.dayAverageLoad1 = parseFloat(res[0].pfin).toFixed(2);
this.loadCenterData.dayAllTime = res[0].time; this.loadCenterData.dayAllTime = res[0].time;
...@@ -266,16 +266,16 @@ export default { ...@@ -266,16 +266,16 @@ export default {
//获取采区当前日产量 //获取采区当前日产量
HttpReq.truckDispatching.apiPlanDayQuery().then((res) => { HttpReq.truckDispatching.apiPlanDayQuery().then((res) => {
let undueArray = {}; let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){ if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = 0; undueArray.finish = 0;
undueArray.plan = 0; undueArray.plan = 0;
}else{ } else {
if(res[0].eff == ''){ if (res[0].eff == '') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
}else{ } else {
undueArray.eff = parseFloat(res[0].eff) * 100; undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
...@@ -286,16 +286,16 @@ export default { ...@@ -286,16 +286,16 @@ export default {
//获取采区当前月产量 //获取采区当前月产量
HttpReq.truckDispatching.apiPlanMonthQuery().then((res) => { HttpReq.truckDispatching.apiPlanMonthQuery().then((res) => {
let undueArray = {}; let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){ if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = 0; undueArray.finish = 0;
undueArray.plan = 0; undueArray.plan = 0;
}else{ } else {
if(res[0].eff == ''){ if (res[0].eff == '') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
}else{ } else {
undueArray.eff = parseFloat(res[0].eff) * 100; undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
...@@ -306,16 +306,16 @@ export default { ...@@ -306,16 +306,16 @@ export default {
//获取采区当前年产量 //获取采区当前年产量
HttpReq.truckDispatching.apiPlanYearQuery().then((res) => { HttpReq.truckDispatching.apiPlanYearQuery().then((res) => {
let undueArray = {}; let undueArray = {};
if(res.length == 0 || JSON.stringify(res[0]) == '{}'){ if (res.length == 0 || JSON.stringify(res[0]) == '{}') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = 0; undueArray.finish = 0;
undueArray.plan = 0; undueArray.plan = 0;
}else{ } else {
if(res[0].eff == ''){ if (res[0].eff == '') {
undueArray.eff = 0; undueArray.eff = 0;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
}else{ } else {
undueArray.eff = parseFloat(res[0].eff) * 100; undueArray.eff = parseFloat(res[0].eff) * 100;
undueArray.finish = res[0].finish; undueArray.finish = res[0].finish;
undueArray.plan = res[0].plan; undueArray.plan = res[0].plan;
...@@ -325,16 +325,16 @@ export default { ...@@ -325,16 +325,16 @@ export default {
}) })
//中间echarts图表 //中间echarts图表
HttpReq.truckDispatching.apiPlanTime1Query().then((res) => { HttpReq.truckDispatching.apiPlanTime1Query().then((res) => {
let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; // let arr3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
res.forEach((item,index)=>{ // res.forEach((item,index)=>{
arr3.splice(parseInt(item.hour) - 7,1, parseFloat(item.finish)); // arr3.splice(parseInt(item.hour) - 7,1, parseFloat(item.finish));
}) // })
this.centerViewData.seriesData = arr3; this.centerViewData.seriesData = res.data || [];
this.centerEcharts(); this.centerEcharts();
}) })
//中间echarts运载数据 //中间echarts运载数据
HttpReq.truckDispatching.apiPlanZDay1Query().then((res) => { HttpReq.truckDispatching.apiPlanZDay1Query().then((res) => {
if(res.length != 0){ if (res.length != 0) {
this.carryCenterData.dayAllCarry1 = res[0].finish; this.carryCenterData.dayAllCarry1 = res[0].finish;
this.carryCenterData.dayAverageCarry1 = parseFloat(res[0].pfin).toFixed(2); this.carryCenterData.dayAverageCarry1 = parseFloat(res[0].pfin).toFixed(2);
this.carryCenterData.dayAllMil1 = res[0].allmil ? parseFloat(res[0].allmil).toFixed(3) : 0; this.carryCenterData.dayAllMil1 = res[0].allmil ? parseFloat(res[0].allmil).toFixed(3) : 0;
...@@ -345,7 +345,7 @@ export default { ...@@ -345,7 +345,7 @@ export default {
}) })
//中间echarts装载数据 //中间echarts装载数据
HttpReq.truckDispatching.apiPlanZMonth1Query().then((res) => { HttpReq.truckDispatching.apiPlanZMonth1Query().then((res) => {
if(res.length != 0){ if (res.length != 0) {
this.loadCenterData.dayAllLoad1 = res[0].finish; this.loadCenterData.dayAllLoad1 = res[0].finish;
this.loadCenterData.dayAverageLoad1 = parseFloat(res[0].pfin).toFixed(2); this.loadCenterData.dayAverageLoad1 = parseFloat(res[0].pfin).toFixed(2);
this.loadCenterData.dayAllTime = res[0].time; this.loadCenterData.dayAllTime = res[0].time;
...@@ -353,15 +353,15 @@ export default { ...@@ -353,15 +353,15 @@ export default {
} }
}) })
},10000) }, 10000)
}, },
//中间模块选择 //中间模块选择
centerSelectFn(text){ centerSelectFn(text) {
this.centerViewData.moduleText = text; this.centerViewData.moduleText = text;
}, },
//中间模块Echarts //中间模块Echarts
centerEcharts(){ centerEcharts() {
echarts.init(document.getElementById('centerEchartsView')).dispose(); echarts.init(document.getElementById('centerEchartsView')).dispose();
var myChart = echarts.init(document.getElementById('centerEchartsView')); var myChart = echarts.init(document.getElementById('centerEchartsView'));
var option = { var option = {
...@@ -382,12 +382,12 @@ export default { ...@@ -382,12 +382,12 @@ export default {
{ {
type: 'category', type: 'category',
data: this.centerViewData.xAxisData, data: this.centerViewData.xAxisData,
axisTick: { // axisTick: {
alignWithLabel: true // alignWithLabel: true
}, // },
axisPointer: { // axisPointer: {
type: 'shadow' // type: 'shadow'
}, // },
axisLabel: { axisLabel: {
show: true, show: true,
textStyle: { 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