<template>
    <div class="carManScrView" v-if="whetherShow">

        <div class="carManScrView_leftView">
            <!-- 车辆运行状况 -->
            <div>
                <div class="carManScrView_leftView_title">车辆运行状况</div>
                <div class="carManScrView_leftView_content" style="position: relative;">
                    <div id="carWorkingStateEcharts"></div>
                </div>
            </div>
            <!-- 卡车排行榜-->
            <div>
                <div class="carManScrView_leftView_title truck_titleStyle">
                    <div>卡车排行榜</div>
                    <div class="driverTitleDateStyle">
                        <div :class="truckRankListData.selectTimeText == 'day' ? 'driverTitleDateStyle_son1' : 'driverTitleDateStyle_son2' " @click="truckChangeTime('day')">日</div>
                        <div :class="truckRankListData.selectTimeText == 'week' ? 'driverTitleDateStyle_son1' : 'driverTitleDateStyle_son2' " @click="truckChangeTime('week')">周</div>
                        <div :class="truckRankListData.selectTimeText == 'month' ? 'driverTitleDateStyle_son1' : 'driverTitleDateStyle_son2' " @click="truckChangeTime('month')">月</div>
                    </div>
                </div>
                <div class="carManScrView_leftView_content">
                    <div class="carManScrView_leftView_content_views2">
                        <div :class="truckRankListData.selectFieldText == 'juli' ? '' : 'selectFieldStyle' "  @click="truckChangeField('juli')">运输距离</div>
                        <div :class="truckRankListData.selectFieldText == 'time' ? '' : 'selectFieldStyle' "  @click="truckChangeField('time')">工作时长</div>
                        <div :class="truckRankListData.selectFieldText == 'yunzai' ? '' : 'selectFieldStyle' "  @click="truckChangeField('yunzai')">运载量</div>
                        <div :class="truckRankListData.selectFieldText == 'jiedan' ? '' : 'selectFieldStyle' "  @click="truckChangeField('jiedan')">接单数</div>
                    </div>
                    <div class="carManScrView_leftView_content_views3">
                        <div v-if="truckRankListData.selectFieldText == 'juli'">
                            <div v-for="(item,index) in truckRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.juli}}KM</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                        <div v-if="truckRankListData.selectFieldText == 'time'">
                            <div v-for="(item,index) in truckRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.time}}H</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                        <div v-if="truckRankListData.selectFieldText == 'yunzai'">
                            <div v-for="(item,index) in truckRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.yunzai}}</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                        <div v-if="truckRankListData.selectFieldText == 'jiedan'">
                            <div v-for="(item,index) in truckRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.jiedan}}</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 铲车排行榜-->
            <div>
                <div class="carManScrView_leftView_title truck_titleStyle">
                    <div>铲车排行榜</div>
                    <div class="driverTitleDateStyle">
                        <div :class="forkLiftRankListData.selectTimeText == 'day' ? 'driverTitleDateStyle_son1' : 'driverTitleDateStyle_son2' " @click="forkLiftChangeTime('day')">日</div>
                        <div :class="forkLiftRankListData.selectTimeText == 'week' ? 'driverTitleDateStyle_son1' : 'driverTitleDateStyle_son2' " @click="forkLiftChangeTime('week')">周</div>
                        <div :class="forkLiftRankListData.selectTimeText == 'month' ? 'driverTitleDateStyle_son1' : 'driverTitleDateStyle_son2' " @click="forkLiftChangeTime('month')">月</div>
                    </div>
                </div>
                <div class="carManScrView_leftView_content">
                    <div class="carManScrView_leftView_content_views2">
                        <div :class="forkLiftRankListData.selectFieldText == 'time' ? '' : 'selectFieldStyle' "  @click="forkLiftChangeField('time')">工作时长</div>
                        <div :class="forkLiftRankListData.selectFieldText == 'yunzai' ? '' : 'selectFieldStyle' "  @click="forkLiftChangeField('yunzai')">装车量</div>
                        <div :class="forkLiftRankListData.selectFieldText == 'jiedan' ? '' : 'selectFieldStyle' "  @click="forkLiftChangeField('jiedan')">装车数</div>
                    </div>
                    <div class="carManScrView_leftView_content_views3">
                        <div v-if="forkLiftRankListData.selectFieldText == 'time'">
                            <div v-for="(item,index) in forkLiftRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.time}}H</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                        <div v-if="forkLiftRankListData.selectFieldText == 'yunzai'">
                            <div v-for="(item,index) in forkLiftRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.yunzai}}</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                        <div v-if="forkLiftRankListData.selectFieldText == 'jiedan'">
                            <div v-for="(item,index) in forkLiftRankListData.listData" :key="index">
                                <div style="color:#1DF9FC;">{{index + 1}}</div>
                                <div style="color:#BCF0FE;">{{item.car}}</div>
                                <div style="color:#1AC9FF;">{{item.jiedan}}</div>
                                <div style="color:#BCF0FE;">{{item.createTime}}</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="carManScrView_rightView">
            <!-- 卡车动态 -->
            <div>
                <div class="carManScrView_rightView_title">卡车动态</div>
                <div class="carManScrView_rightView_content">
                    <div class="carDynamicTitleStyle">
                        <img src="../../../../assets/images/cutGraph/huoche11.png" height="28">
                        <div>{{truckDynamicListData.number}}</div>
                    </div>
                    <div class="truckDynamicContent1">
                        <div class="truckDynamicRateStyle">
                            <div style="color:white;font-size:20px;">{{truckDynamicListData.rate}}%</div>
                            <div style="color:white;font-size:15px;">完成度</div>
                        </div>
                        <el-progress type="circle" :percentage="parseInt(truckDynamicListData.rate)" :stroke-width="7" :width="90" :height="90" :show-text='false'></el-progress>
                        <div style="text-align: center;">
                            <div style="font-size:14px;color:white;">今日运载量</div>
                            <div style="font-size:20px;color:#05F7FC;">{{truckDynamicListData.carry}}<span style="font-size:14px;">T</span></div>
                            <div style="font-size:14px;color:white;">今日工时</div>
                            <div style="font-size:20px;color:#05F7FC;">{{truckDynamicListData.workTime}}<span style="font-size:14px;">H</span></div>
                        </div>
                        <div style="text-align: center;">
                            <div style="font-size:14px;color:white;">今日完成度</div>
                            <div style="font-size:20px;color:#05F7FC;">{{truckDynamicListData.rate}}<span style="font-size:14px;">%</span></div>
                            <div style="font-size:14px;color:white;">今日里程</div>
                            <div style="font-size:20px;color:#05F7FC;">{{truckDynamicListData.mileage}}<span style="font-size:14px;">KM</span></div>
                        </div>
                    </div>
                    <div class="carDynamicContent1">
                        <div>
                            <img src="../../../../assets/images/cutGraph/mokuaikaobei4.png">
                            <div>开始工作时间</div>
                            <div>{{truckDynamicListData.startTime}}</div>
                        </div>
                        <div>
                            <img src="../../../../assets/images/cutGraph/mokuaikaobei4.png">
                            <div>结束工作时间</div>
                            <div>{{truckDynamicListData.endTime}}</div>
                        </div>
                    </div>
                    <div class="carDynamicContent2">
                        <img src="../../../../assets/images/cutGraph/tuiyuan1.png">
                        <span class="el-icon-sort"></span>
                        <div>
                            <div style="color:white;">{{truckDynamicListData.loadArea}}</div>
                            <div style="color:white;">{{truckDynamicListData.unloadArea}}</div>
                        </div>
                        <span class="el-icon-sort"></span>
                        <img src="../../../../assets/images/cutGraph/tuiyuan2.png">
                    </div>
                </div>
            </div>
            <!-- 铲车动态-->
            <div>
                <div class="carManScrView_rightView_title">铲车动态</div>
                <div class="carManScrView_rightView_content">
                    <div class="carDynamicTitleStyle">
                        <img src="../../../../assets/images/cutGraph/huoche11.png" height="28">
                        <div>{{forkliftkDynamicListData.number}}</div>
                    </div>
                    <div class="ForkliftDynamicContent1">
                        <div>
                            <div>今日完成量</div>
                            <div class="ForkliftDynamicContent1_son1">{{forkliftkDynamicListData.rate}}%</div>
                        </div>
                        <div>
                            <div>今日工时/H</div>
                            <div class="ForkliftDynamicContent1_son1">{{forkliftkDynamicListData.workTime}}</div>
                        </div>
                        <div>
                            <div>今日里程/Km</div>
                            <div class="ForkliftDynamicContent1_son1">{{forkliftkDynamicListData.mileage}}</div>
                        </div>
                    </div>
                    <div class="carDynamicContent1">
                        <div>
                            <img src="../../../../assets/images/cutGraph/mokuaikaobei4.png">
                            <div>开始工作时间</div>
                            <div>{{forkliftkDynamicListData.startTime}}</div>
                        </div>
                        <div>
                            <img src="../../../../assets/images/cutGraph/mokuaikaobei4.png">
                            <div>结束工作时间</div>
                            <div>{{forkliftkDynamicListData.endTime}}</div>
                        </div>
                    </div>
                    <div class="carDynamicContent2">
                        <img src="../../../../assets/images/cutGraph/tuiyuan1.png">
                        <span class="el-icon-sort"></span>
                        <div>
                            <div style="color:white;">{{forkliftkDynamicListData.loadArea}}</div>
                            <div style="color:white;">{{forkliftkDynamicListData.unloadArea}}</div>
                        </div>
                        <span class="el-icon-sort"></span>
                        <img src="../../../../assets/images/cutGraph/tuiyuan2.png">
                    </div>
                </div>
            </div>
            <!-- 其他车动态 -->
            <div>
                <div class="carManScrView_rightView_title">其他车动态</div>
                <div class="carManScrView_rightView_content">
                    <div class="carDynamicTitleStyle">
                        <img src="../../../../assets/images/cutGraph/huoche11.png" height="28">
                        <div>{{otherCarDynamicListData.number}}</div>
                    </div>
                    <div class="otherCarDynamicContent1">
                        <div>
                            <div>今日完成量</div>
                            <div class="otherCarDynamicContent1_son1">{{otherCarDynamicListData.rate}}%</div>
                        </div>
                        <div>
                            <div>今日工时/H</div>
                            <div class="otherCarDynamicContent1_son1">{{otherCarDynamicListData.workTime}}</div>
                        </div>
                        <div>
                            <div>今日里程/Km</div>
                            <div class="otherCarDynamicContent1_son1">{{otherCarDynamicListData.mileage}}</div>
                        </div>
                    </div>
                    <div class="carDynamicContent1">
                        <div>
                            <img src="../../../../assets/images/cutGraph/mokuaikaobei4.png">
                            <div>开始工作时间</div>
                            <div>{{otherCarDynamicListData.startTime}}</div>
                        </div>
                        <div>
                            <img src="../../../../assets/images/cutGraph/mokuaikaobei4.png">
                            <div>结束工作时间</div>
                            <div>{{otherCarDynamicListData.endTime}}</div>
                        </div>
                    </div>
                    <div class="carDynamicContent2">
                        <img src="../../../../assets/images/cutGraph/tuiyuan1.png">
                        <span class="el-icon-sort"></span>
                        <div>
                            <div style="color:white;">{{otherCarDynamicListData.loadArea}}</div>
                            <div style="color:white;">{{otherCarDynamicListData.unloadArea}}</div>
                        </div>
                        <span class="el-icon-sort"></span>
                        <img src="../../../../assets/images/cutGraph/tuiyuan2.png">
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>

<script>
import { Tools, HttpReq, Dates} from '@/assets/js/common.js';
import * as echarts from 'echarts';

export default {
    data() {
		return {
			whetherShow:false,
            carDongTaiQieHuanTimer:null,
            //时间
            currentTime:{
                day:'',
                month:'',
                year:'',
            },
            //车辆运行状况
            carWorkingStateData:{
                online:[],
                offline:[],
            },
            //卡车排行榜
            truckRankListData:{
                carclass:'卡车',
                selectTimeText:'day',
                selectFieldText:'juli',
                listData:[],
                selectTimeDate:'',
            },
            //铲车排行榜
            forkLiftRankListData:{
                carclass:'铲车',
                selectTimeText:'day',
                selectFieldText:'time',
                listData:[],
                selectTimeDate:'',
            },
            //卡车动态
            truckDynamicListData:{
                data:[],
                num2:0,
                number:'无',
                rate:0,
                carry:0,
                workTime:0,
                mileage:0,
                startTime:'无',
                endTime:'无',
                loadArea:'无',
                unloadArea:'无',
            },
            //铲车动态
            forkliftkDynamicListData:{
                data:[],
                num2:0,
                number:'无',
                rate:0,
                workTime:0,
                mileage:0,
                startTime:'无',
                endTime:'无',
                loadArea:'无',
                unloadArea:'无',
            },
            //其他车动态
            otherCarDynamicListData:{
                data:[],
                num2:0,
                number:'无',
                rate:0,
                workTime:0,
                mileage:0,
                startTime:'无',
                endTime:'无',
                loadArea:'无',
                unloadArea:'无',
            },
		}
	},
	methods: {
		loadData(text){
            if(text == true){
                this.whetherShow = true;
                this.dayCurrentTimeFn();
                this.monthCurrentTimeFn();
                this.yearCurrentTimeFn();

                this.$nextTick(()=>{
                    //获取车辆运行状况
                    HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res) => {
                        let kache1 = [];
                        let kachezaixian = [];
                        let kachelixian = [];
                        let dianchan1 = [];
                        let dianchanzaixian = [];
                        let dianchanlixian = [];
                        let qitache1 = [];
                        let qitachezaixian = [];
                        let qitachelixian = [];
                        let zaixianAllNum = [];
                        let lixianAllNum = [];
                        if(res.code == 200){
                            res.data.content.forEach((item)=>{
                                if(item.carclass == '卡车'){
                                    kache1.push(item);
                                }else if(item.carclass == '铲车'){
                                    dianchan1.push(item);
                                }else{
                                    qitache1.push(item);
                                }
                            })
                            kache1.forEach((item)=>{
                                if(item.status == 1){
                                    kachezaixian.push(item);
                                }else{
                                    kachelixian.push(item);
                                }
                            })
                            dianchan1.forEach((item)=>{
                                if(item.status == 1){
                                    dianchanzaixian.push(item);
                                }else{
                                    dianchanlixian.push(item);
                                }
                            })
                            qitache1.forEach((item)=>{
                                if(item.status == 1){
                                    qitachezaixian.push(item);
                                }else{
                                    qitachelixian.push(item);
                                }
                            })
                            zaixianAllNum.push(kachezaixian.length);
                            zaixianAllNum.push(dianchanzaixian.length);
                            zaixianAllNum.push(qitachezaixian.length);
                            lixianAllNum.push(kachelixian.length);
                            lixianAllNum.push(dianchanlixian.length);
                            lixianAllNum.push(qitachelixian.length);
                            this.carWorkingStateData.online = zaixianAllNum;
                            this.carWorkingStateData.offline = lixianAllNum;
                            //绘制车辆运行状况图表
                            this.$nextTick(()=>{
                                this.carWorkingStateEcharts();
                            })
                        }
                    })
                    //获取卡车排行榜
                    this.truckRankListData.selectTimeDate = this.currentTime.day;
                    let truckQuery1 = {};
                    truckQuery1.size = 10;
                    truckQuery1.sort = this.truckRankListData.selectFieldText + ',desc';
                    truckQuery1.carclass = this.truckRankListData.carclass;
                    truckQuery1.createTime = this.truckRankListData.selectTimeDate;
                    this.$nextTick(()=>{
                        HttpReq.truckDispatching.carInformationQuery(truckQuery1).then((res) => {
                            if(res.code == 200){
                                this.truckRankListData.listData = res.data.content;
                            }
                        })
                    })
                    //获取铲车排行榜
                    this.forkLiftRankListData.selectTimeDate = this.currentTime.day;
                    let forkLiftQuery1 = {};
                    forkLiftQuery1.size = 10;
                    forkLiftQuery1.sort = this.forkLiftRankListData.selectFieldText + ',desc';
                    forkLiftQuery1.carclass = this.forkLiftRankListData.carclass;
                    forkLiftQuery1.createTime = this.forkLiftRankListData.selectTimeDate;
                    this.$nextTick(()=>{
                        HttpReq.truckDispatching.carInformationQuery(forkLiftQuery1).then((res) => {
                            if(res.code == 200){
                                this.forkLiftRankListData.listData = res.data.content;
                            }
                        })
                    })
                    //获取车辆信息
                    HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res) => {
                        let arr1 = [];
                        let arr2 = [];
                        let arr3 = [];
                        if(res.code == 200){
                            res.data.content.forEach((item,index)=>{
                                if(item.carclass == '卡车'){
                                    arr1.push(item);
                                }else if(item.carclass == '铲车'){
                                    arr2.push(item);
                                }else{
                                    arr3.push(item);
                                }
                            })
                        }
                        this.truckDynamicListData.data = arr1;
                        this.truckDynamicListData.num2 = 0;
                        this.forkliftkDynamicListData.data = arr2;
                        this.forkliftkDynamicListData.num2 = 0;
                        this.otherCarDynamicListData.data = arr3;
                        this.otherCarDynamicListData.num2 = 0;
                        this.kachedongtai();
                        this.dianchandongtai();
                        this.qitachedongtai();
                        this.carDongTaiQieHuanTimer = setInterval(() => {
                            this.kachedongtai();
                            this.dianchandongtai();
                            this.qitachedongtai();
                            //获取车辆运行状况
                            HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res) => {
                                let kache1 = [];
                                let kachezaixian = [];
                                let kachelixian = [];
                                let dianchan1 = [];
                                let dianchanzaixian = [];
                                let dianchanlixian = [];
                                let qitache1 = [];
                                let qitachezaixian = [];
                                let qitachelixian = [];
                                let zaixianAllNum = [];
                                let lixianAllNum = [];
                                if(res.code == 200){
                                    res.data.content.forEach((item)=>{
                                        if(item.carclass == '卡车'){
                                            kache1.push(item);
                                        }else if(item.carclass == '铲车'){
                                            dianchan1.push(item);
                                        }else{
                                            qitache1.push(item);
                                        }
                                    })
                                    kache1.forEach((item)=>{
                                        if(item.status == 1){
                                            kachezaixian.push(item);
                                        }else{
                                            kachelixian.push(item);
                                        }
                                    })
                                    dianchan1.forEach((item)=>{
                                        if(item.status == 1){
                                            dianchanzaixian.push(item);
                                        }else{
                                            dianchanlixian.push(item);
                                        }
                                    })
                                    qitache1.forEach((item)=>{
                                        if(item.status == 1){
                                            qitachezaixian.push(item);
                                        }else{
                                            qitachelixian.push(item);
                                        }
                                    })
                                    zaixianAllNum.push(kachezaixian.length);
                                    zaixianAllNum.push(dianchanzaixian.length);
                                    zaixianAllNum.push(qitachezaixian.length);
                                    lixianAllNum.push(kachelixian.length);
                                    lixianAllNum.push(dianchanlixian.length);
                                    lixianAllNum.push(qitachelixian.length);
                                    this.carWorkingStateData.online = zaixianAllNum;
                                    this.carWorkingStateData.offline = lixianAllNum;
                                    //绘制车辆运行状况图表
                                    this.$nextTick(()=>{
                                        this.carWorkingStateEcharts();
                                    })
                                }
                            })
                            //获取卡车排行榜
                            this.truckRankListData.selectTimeDate = this.currentTime.day;
                            let truckQuery1 = {};
                            truckQuery1.size = 10;
                            truckQuery1.sort = this.truckRankListData.selectFieldText + ',desc';
                            truckQuery1.carclass = this.truckRankListData.carclass;
                            truckQuery1.createTime = this.truckRankListData.selectTimeDate;
                            this.$nextTick(()=>{
                                HttpReq.truckDispatching.carInformationQuery(truckQuery1).then((res) => {
                                    if(res.code == 200){
                                        this.truckRankListData.listData = res.data.content;
                                    }
                                })
                            })
                            //获取铲车排行榜
                            this.forkLiftRankListData.selectTimeDate = this.currentTime.day;
                            let forkLiftQuery1 = {};
                            forkLiftQuery1.size = 10;
                            forkLiftQuery1.sort = this.forkLiftRankListData.selectFieldText + ',desc';
                            forkLiftQuery1.carclass = this.forkLiftRankListData.carclass;
                            forkLiftQuery1.createTime = this.forkLiftRankListData.selectTimeDate;
                            this.$nextTick(()=>{
                                HttpReq.truckDispatching.carInformationQuery(forkLiftQuery1).then((res) => {
                                    if(res.code == 200){
                                        this.forkLiftRankListData.listData = res.data.content;
                                    }
                                })
                            })
                        }, 20000)
                    }) 
                })
            }else{
                if(this.carDongTaiQieHuanTimer) {
                    clearInterval(this.carDongTaiQieHuanTimer);
                }
                this.whetherShow = false;
            }
            
        },
        //车辆运行状况
        carWorkingStateEcharts(){
            let that = this;
            echarts.init(document.getElementById('carWorkingStateEcharts')).dispose();
            var myChart = echarts.init(document.getElementById('carWorkingStateEcharts'));
            var option = {
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                legend: {
                    textStyle:{
                        color: 'white',
                        fontSize:16,
                    }
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    data: ['卡车状态', '铲车状态', '其他车辆'],
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: 'white',
                            fontSize:16,
                        }
                    },
                    axisLine: {
                        lineStyle: {
                            color: 'white',
                            width: 1
                        }
                    },
                },
                yAxis: {
                    type: 'value',
                    axisLabel: {
					    show: true,
					    textStyle: {
						    color: 'white',
                            fontSize:16,
					    }
					},
					axisLine: {
					    lineStyle: {
						    color: 'white',
						    width: 0
					    }
					},
                },
                series: [
                    {
                        name: '车辆离线',
                        type: 'bar',
                        data: that.carWorkingStateData.offline,
                        barWidth: 20,
                        itemStyle: {
							color: '#14F3C5'
						},
                    },
                    {
                        name: '车辆在线',
                        type: 'bar',
                        data: that.carWorkingStateData.online,
                        barWidth: 20,
                        itemStyle: {
							color: '#2195FD'
						},
                    }
                ]
            };
            option && myChart.setOption(option);
        },
        //卡车切换时间
        truckChangeTime(text){
            this.truckRankListData.selectTimeText = text;
            if(text == 'day'){
                this.truckRankListData.selectTimeDate = this.currentTime.day;
            }
            if(text == 'month'){
                this.truckRankListData.selectTimeDate = this.currentTime.month;
            }
            if(text == 'year'){
                this.truckRankListData.selectTimeDate = this.currentTime.year;
            }
        },
        //卡车切换字段排序
        truckChangeField(text){
            this.truckRankListData.selectFieldText = text;
            let truckQuery1 = {};
            truckQuery1.size = 10;
            truckQuery1.sort = this.truckRankListData.selectFieldText + ',desc';
            truckQuery1.carclass = this.truckRankListData.carclass;
            truckQuery1.createTime = this.truckRankListData.selectTimeDate;
            this.$nextTick(()=>{
                HttpReq.truckDispatching.carInformationQuery(truckQuery1).then((res) => {
                    if(res.code == 200){
                        this.truckRankListData.listData = res.data.content;
                    }
                })
            })
        },
        //铲车切换时间
        forkLiftChangeTime(text){
            this.forkLiftRankListData.selectTimeText = text;
            if(text == 'day'){
                this.forkLiftRankListData.selectTimeDate = this.currentTime.day;
            }
            if(text == 'month'){
                this.forkLiftRankListData.selectTimeDate = this.currentTime.month;
            }
            if(text == 'year'){
                this.forkLiftRankListData.selectTimeDate = this.currentTime.year;
            }
        },
        //铲车切换字段排序
        forkLiftChangeField(text){
            this.forkLiftRankListData.selectFieldText = text;
            let forkLiftQuery1 = {};
            forkLiftQuery1.size = 10;
            forkLiftQuery1.sort = this.forkLiftRankListData.selectFieldText + ',desc';
            forkLiftQuery1.carclass = this.forkLiftRankListData.carclass;
            forkLiftQuery1.createTime = this.forkLiftRankListData.selectTimeDate;
            this.$nextTick(()=>{
                HttpReq.truckDispatching.carInformationQuery(forkLiftQuery1).then((res) => {
                    if(res.code == 200){
                        this.forkLiftRankListData.listData = res.data.content;
                    }
                })
            })
        },
        //卡车动态
        kachedongtai(){
            let num1 =  parseInt(this.truckDynamicListData.data.length) - 1;
            //获取车辆实时数据
            if(this.truckDynamicListData.num2 <= num1){
                
            }else{
                this.truckDynamicListData.num2 = 0;
            }
            if(this.truckDynamicListData.data == 0){
                return
            }
            this.truckDynamicListData.number = this.truckDynamicListData.data[this.truckDynamicListData.num2].number;
            HttpReq.truckDispatching.screenCarInforCarRealQuery({number:this.truckDynamicListData.number}).then((res) => {
                if(res.code == 200){
                    if(res.data.totalElements == 0){
                        this.truckDynamicListData.rate = 0;
                        this.truckDynamicListData.carry = 0;
                        this.truckDynamicListData.workTime = 0;
                        this.truckDynamicListData.mileage = 0;
                        this.truckDynamicListData.startTime = '无';
                        this.truckDynamicListData.endTime = '无';
                        this.truckDynamicListData.loadArea = '无';
                        this.truckDynamicListData.unloadArea = '无';
                    }else{
                        this.truckDynamicListData.rate = res.data.content[0].rate;
                        this.truckDynamicListData.carry = res.data.content[0].carry;
                        this.truckDynamicListData.workTime = res.data.content[0].workTime;
                        this.truckDynamicListData.mileage = res.data.content[0].mileage;
                        this.truckDynamicListData.startTime = res.data.content[0].startTime;
                        this.truckDynamicListData.endTime = res.data.content[0].endTime;
                        this.truckDynamicListData.loadArea = res.data.content[0].loadArea;
                        this.truckDynamicListData.unloadArea = res.data.content[0].unloadArea;
                    }
                }
                this.truckDynamicListData.num2 = this.truckDynamicListData.num2 + 1;
            })
        },
        //铲车动态
        dianchandongtai(){
            let num1 =  parseInt(this.forkliftkDynamicListData.data.length) - 1;
            //获取车辆实时数据
            if(this.forkliftkDynamicListData.num2 <= num1){
                
            }else{
                this.forkliftkDynamicListData.num2 = 0;
            }
            if(this.forkliftkDynamicListData.data == 0){
                return
            }
            this.forkliftkDynamicListData.number = this.forkliftkDynamicListData.data[this.forkliftkDynamicListData.num2].number;
            HttpReq.truckDispatching.screenCarInforCarRealQuery({number:this.forkliftkDynamicListData.number}).then((res) => {
                if(res.code == 200){
                    if(res.data.totalElements == 0){
                        this.forkliftkDynamicListData.rate = 0;
                        this.forkliftkDynamicListData.carry = 0;
                        this.forkliftkDynamicListData.workTime = 0;
                        this.forkliftkDynamicListData.mileage = 0;
                        this.forkliftkDynamicListData.startTime = '无';
                        this.forkliftkDynamicListData.endTime = '无';
                        this.forkliftkDynamicListData.loadArea = '无';
                        this.forkliftkDynamicListData.unloadArea = '无';
                    }else{
                        this.forkliftkDynamicListData.rate = res.data.content[0].rate;
                        this.forkliftkDynamicListData.carry = res.data.content[0].carry;
                        this.forkliftkDynamicListData.workTime = res.data.content[0].workTime;
                        this.forkliftkDynamicListData.mileage = res.data.content[0].mileage;
                        this.forkliftkDynamicListData.startTime = res.data.content[0].startTime;
                        this.forkliftkDynamicListData.endTime = res.data.content[0].endTime;
                        this.forkliftkDynamicListData.loadArea = res.data.content[0].loadArea;
                        this.forkliftkDynamicListData.unloadArea = res.data.content[0].unloadArea;
                    }
                }
                this.forkliftkDynamicListData.num2 = this.forkliftkDynamicListData.num2 + 1;
            })
        },
        //其他车动态
        qitachedongtai(){
            let num1 =  parseInt(this.otherCarDynamicListData.data.length) - 1;
            //获取车辆实时数据
            if(this.otherCarDynamicListData.num2 <= num1){
                
            }else{
                this.otherCarDynamicListData.num2 = 0;
            }
            if(this.otherCarDynamicListData.data == 0){
                return
            }
            this.otherCarDynamicListData.number = this.otherCarDynamicListData.data[this.otherCarDynamicListData.num2].number;
            HttpReq.truckDispatching.screenCarInforCarRealQuery({number:this.otherCarDynamicListData.number}).then((res) => {
                if(res.code == 200){
                    if(res.data.totalElements == 0){
                        this.otherCarDynamicListData.rate = 0;
                        this.otherCarDynamicListData.carry = 0;
                        this.otherCarDynamicListData.workTime = 0;
                        this.otherCarDynamicListData.mileage = 0;
                        this.otherCarDynamicListData.startTime = '无';
                        this.otherCarDynamicListData.endTime = '无';
                        this.otherCarDynamicListData.loadArea = '无';
                        this.otherCarDynamicListData.unloadArea = '无';
                    }else{
                        this.otherCarDynamicListData.rate = res.data.content[0].rate;
                        this.otherCarDynamicListData.carry = res.data.content[0].carry;
                        this.otherCarDynamicListData.workTime = res.data.content[0].workTime;
                        this.otherCarDynamicListData.mileage = res.data.content[0].mileage;
                        this.otherCarDynamicListData.startTime = res.data.content[0].startTime;
                        this.otherCarDynamicListData.endTime = res.data.content[0].endTime;
                        this.otherCarDynamicListData.loadArea = res.data.content[0].loadArea;
                        this.otherCarDynamicListData.unloadArea = res.data.content[0].unloadArea;
                    }
                }
                this.otherCarDynamicListData.num2 = this.otherCarDynamicListData.num2 + 1;
            })
        },

        //获取当前时间
		dayCurrentTimeFn(){
			var date = new Date();
			var year = date.getFullYear();        //年 ,从 Date 对象以四位数字返回年份
			var month = date.getMonth() + 1;      //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
			var day = date.getDate();             //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
			//修改月份格式
			if (month >= 1 && month <= 9) {
				month = "0" + month;
			}
			//修改日期格式
			if (day >= 0 && day <= 9) {
				day = "0" + day;
			}
			let currentFormatDate = year + "-" + month + "-" + day;
			this.currentTime.day = currentFormatDate;
		},
        monthCurrentTimeFn(){
			var date = new Date();
			var year = date.getFullYear();        //年 ,从 Date 对象以四位数字返回年份
			var month = date.getMonth() + 1;      //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
			//修改月份格式
			if (month >= 1 && month <= 9) {
				month = "0" + month;
			}
			let currentFormatDate = year + "-" + month;
			this.currentTime.month = currentFormatDate;
		},
        yearCurrentTimeFn(){
			var date = new Date();
			var year = date.getFullYear();        //年 ,从 Date 对象以四位数字返回年份
			let currentFormatDate = year;
			this.currentTime.year = currentFormatDate;
		},
	},
    beforeDestroy(){
		if(this.carDongTaiQieHuanTimer) {
			clearInterval(this.carDongTaiQieHuanTimer);
		}
    }
}
</script>

<style scoped>
.carManScrView{
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: absolute;
    z-index: 1;
    display: flex;
    justify-content: space-between;
}
.carManScrView_leftView{
    height: 100%;
    width: 20%;
}
.carManScrView_rightView{
    height: 100%;
    width: 20%;
}
.carManScrView_leftView>div{
    width: 100%;
    height: 32vh;
    /* background:no-repeat center center url('~@/assets/images/cutGraph/yuanjianjuxing1.png');
	background-size:100% 100%; */
    background-color: rgba(32,42,67,0.8);
    padding: 5px 7px;
    box-sizing: border-box;
    overflow: hidden;
}
.carManScrView_rightView>div{
    width: 100%;
    height: 31.8vh;
    /* background:no-repeat center center url('~@/assets/images/cutGraph/yuanjianjuxing1.png');
	background-size:100% 100%; */
    background-color: rgba(32,42,67,0.8);
    padding: 5px 7px;
    box-sizing: border-box;
    overflow: hidden;
}
.carManScrView_leftView_title,.carManScrView_rightView_title{
    margin-bottom: 5px;
    width: 100%;
    height: 3.5vh;
    background:no-repeat center center url('~@/assets/images/cutGraph/biaoti1.png');
	background-size:100% 100%;
    padding-left: 10px;
    box-sizing: border-box;
    font-size: 18px;
    line-height: 3.5vh;
    color: #FAFAFB;
    letter-spacing: 1px;
    text-shadow: 1px 1px 1px #92CBFF;
}
.carManScrView_leftView_content,.carManScrView_rightView_content{
    width: 100%;
    height: 27vh;
}
.rolling{
	height: 13.5vh;
	overflow-y:auto;
    scrollbar-width: none;
}
.rolling::-webkit-scrollbar {
  display: none;
}

.truck_titleStyle{
    display: flex;
    justify-content: space-between;
    padding-right: 4vw;
}
.driverTitleDateStyle{
    display: flex;
    color: #06EFFE;
    font-size: 16px;
    text-shadow: 0px 0px 0px;
    height: 3.5vh;
    align-items: center;
}
.driverTitleDateStyle_son1{
    height: 2.5vh;
    line-height: 2.5vh;
    margin-right: 5px;
    padding:0px 5px;
    background-color: #2DB3BB;
    box-sizing: border-box;
    border-radius: 5px;
    cursor: pointer;
}
.driverTitleDateStyle_son2{
    height: 2.5vh;
    line-height: 2.5vh;
    margin-right: 5px;
    padding:0px 5px;
    box-sizing: border-box;
    border-radius: 5px;
    cursor: pointer;
}
.carManScrView_leftView_content_views2{
    display: flex;
    justify-content: space-between;
}
.carManScrView_leftView_content_views2>div{
    height: 2.5vh;
    width: 24%;
    font-size: 15px;
    border:2px solid #01A6FC;
    border-radius: 5px;
    color: #06EFFE;
    line-height: 2.2vh;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
}
.selectFieldStyle{
    opacity: 0.7;
}
.carManScrView_leftView_content_views3{
    width: 100%;
    height: 24vh;
    overflow-y:auto;
    scrollbar-width: none;
}
.carManScrView_leftView_content_views3::-webkit-scrollbar {
  display: none;
}
.carManScrView_leftView_content_views3>div>div{
    font: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-evenly;
}
.carManScrView_leftView_content_views3>div>div>div{
    margin-top: 7px;
}
#carWorkingStateEcharts{
    width: 100%;
    height: 28vh;
}
.carDynamicTitleStyle{
    display: flex;
    width: 100%;
    height: 3.5vh;
    align-items: center;
}
.carDynamicTitleStyle>div{
    margin-left: 10px;
    height: 3.5vh;
    width: 6vw;
    background:no-repeat center center url('~@/assets/images/cutGraph/xingzhuang9kaobei2.png');
	background-size:100% 100%;
    line-height: 3.5vh;
    text-align: center;
    color: #06EFFE;
    font-weight: 600;
    font-size: 17px;
}
.truckDynamicContent1{
    position: relative;
    margin-top: 1vh;
    display: flex;
    align-items: center;
    font-weight: 600;
    justify-content: space-evenly;
}
.truckDynamicRateStyle{
    position: absolute;
    left: 3vw;
    top: 2.5vh;
    text-align: center;
}
.carDynamicContent1{
    width: 100%;
    height: 7vh;
}
.carDynamicContent1>div{
    color: #06EFFE;
    margin-top: 5px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.carDynamicContent2{
    width: 100%;
    height: 5vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 10px;
    box-sizing: border-box;
    color: #03BFFD;
}
.carDynamicContent2>span{
    transform: rotateZ(90deg);
    font-size: 30px;
}
.ForkliftDynamicContent1{
    margin-top: 0.3vh;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 10vh;
    font-size: 15px;
}
.ForkliftDynamicContent1>div{
    width: 33%;
    text-align: center;
    color: white;
}
.ForkliftDynamicContent1_son1{
    margin: 0px auto;
    width: 4.3vw;
    height: 4.3vw;
    border: 4px solid #06EFFE;
    border-radius: 50%;
    line-height: 3.8vw;
    font-size: 24px;
}
.otherCarDynamicContent1{
    margin-top: 0.3vh;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 9vh;
    font-size: 15px;
}
.otherCarDynamicContent1>div{
    width: 33%;
    text-align: center;
    color: white;
}
.otherCarDynamicContent1_son1{
    margin: 0px auto;
    width: 4vw;
    height: 4vw;
    border: 4px solid #06EFFE;
    border-radius: 50%;
    line-height: 3.5vw;
    font-size: 24px;
}
</style>