Browse Source

no message

XAWDJ0277HWXPT2\Administrator 5 years ago
parent
commit
7550d7d267

File diff suppressed because it is too large
+ 1 - 1
web/css/chunk-7ef40bfa.c6dbfddd.css


File diff suppressed because it is too large
+ 1 - 1
web/index.html


File diff suppressed because it is too large
+ 2 - 2
web/js/app.ae50f0d2.js


File diff suppressed because it is too large
+ 1 - 1
web/js/app.ae50f0d2.js.map


File diff suppressed because it is too large
+ 0 - 2
web/js/chunk-6b1d2eca.b1b2530b.js


File diff suppressed because it is too large
+ 0 - 1
web/js/chunk-6b1d2eca.b1b2530b.js.map


File diff suppressed because it is too large
+ 2 - 0
web/js/chunk-6b1d2eca.bca25686.js


File diff suppressed because it is too large
+ 1 - 0
web/js/chunk-6b1d2eca.bca25686.js.map


File diff suppressed because it is too large
+ 0 - 2
web/js/chunk-7ef40bfa.0c4a3cb9.js


File diff suppressed because it is too large
+ 0 - 1
web/js/chunk-7ef40bfa.0c4a3cb9.js.map


File diff suppressed because it is too large
+ 2 - 0
web/js/chunk-7ef40bfa.cf369780.js


File diff suppressed because it is too large
+ 1 - 0
web/js/chunk-7ef40bfa.cf369780.js.map


File diff suppressed because it is too large
+ 4 - 0
web/js/chunk-9927e514.b9db7e98.js


File diff suppressed because it is too large
+ 1 - 0
web/js/chunk-9927e514.b9db7e98.js.map


File diff suppressed because it is too large
+ 0 - 4
web/js/chunk-9927e514.f80f65a8.js


File diff suppressed because it is too large
+ 0 - 1
web/js/chunk-9927e514.f80f65a8.js.map


+ 2 - 0
webConfig/src/api/allUel.js

@@ -17,6 +17,8 @@ const urls={
         get_city:'https://120.77.179.55/api/common/get_city',/*行政市下拉*/
         get_area:'https://120.77.179.55/api/common/get_area',/*行政区下拉*/
         lamp_list:'https://120.77.179.55/api/home/lamp_list',/*路灯列表*/
+        home_get_province:'https://120.77.179.55/api/home/get_province',/*省份下拉列表*/
+        home_get_city:'https://120.77.179.55/api/home/get_city',/*省份下拉列表*/
     },
     /*项目管理*/
     project:{

File diff suppressed because it is too large
+ 1 - 1
webConfig/src/store/Barisal.json


+ 57 - 17
webConfig/src/store/node.js

@@ -85,6 +85,7 @@ function writeJson(params){
         let arr3Length = 0;
         let index = 0;
         let number = 0;
+        // Pirojpur
         let fun = function(arr,provinceName,name,item,cfName){
             let arr3 = [];
             // console.log('计算第'+i+'轮开始');
@@ -103,41 +104,72 @@ function writeJson(params){
                         if(cfName == d.properties.Upaz_name){
                             continue
                         }
-                        item.properties.name = d.properties.Dist_name;
+                        item.properties.name = d.properties.Dist_name+' Division';
                         if(item.geometry.coordinates[0][0].length == 0){
                             number++;
                             item.geometry.coordinates[0][0] = JSON.parse(JSON.stringify(d.geometry.coordinates[0][0]));
                             console.log('已筛选 '+number+' '+d.properties.Upaz_name+'-------------1---------');
                         }else{
-                            let x1 = false;
-                            let x2 = false;
-                            let y1 = false;
-                            let y2 = false;
+                            let xArr = [],xIndex = 0;
+                            let yArr = [],yIndex = 0;
+                            let x1 = 0;
+                            let x2 = 0;
+                            let y1 = 0;
+                            let y2 = 0;
                             let xk = false;
+                            let xkk = false;
                             let yk = false;
+                            let ykk = false;
                             for(let j in d.geometry.coordinates[0][0]){
                                 for(let key in item.geometry.coordinates[0][0]){
                                     if(Math.abs(item.geometry.coordinates[0][0][key][0] - d.geometry.coordinates[0][0][j][0])+Math.abs(item.geometry.coordinates[0][0][key][1] - d.geometry.coordinates[0][0][j][1]) < 0.0000001){
                                         if(!x1){
                                             x1 = Number(key);
+                                            xArr[xIndex] = Number(key);
+                                        }else{
+                                            if(Math.abs(x2-Number(key)) > 3){
+                                                xIndex++;
+                                                xArr[xIndex] = Number(key)-x2>0?'+':'-';
+                                                xIndex++;
+                                                xArr[xIndex] = x2;
+                                                xIndex++;
+                                                xArr[xIndex] = Number(key);
+                                            }
                                         }
                                         if(!y1){
                                             y1 = Number(j);
+                                            yArr[yIndex] = Number(j);
+                                        }else{
+                                            if(Math.abs(y2-Number(j)) > 3){
+                                                yIndex++;
+                                                yArr[yIndex] = Number(j) - y2>0?'+':'-';
+                                                yIndex++;
+                                                yArr[yIndex] = y2;
+                                                yIndex++;
+                                                yArr[yIndex] = Number(j);
+                                            }
                                         }
                                         x2 = Number(key);
                                         y2 = Number(j);
-                                        if(!yk&&y1!=y2){
-                                            yk = y2-y1>0?'+':'-'
-                                        }
                                         if(!xk&&x1!=x2){
                                             xk = x2-x1>0?'+':'-'
+                                            xkk = x2;
+                                        }
+                                        if(!yk&&y1!=y2){
+                                            yk = y2-y1>0?'+':'-';
+                                            ykk = y2;
                                         }
+                                        // console.log(x1,xk,x2,xkk,y1,yk,y2,ykk)
                                         break;
                                     }
                                 }
                             }
+                            xIndex++;
+                            yIndex++;
+                            xArr[xIndex] = Number(x2);
+                            yArr[yIndex] = Number(y2);
                             if(x1||x2||y1||y2){
-                                console.log(x1,x2,xk,y1,y2,yk)
+                                console.log(xArr,yArr,'-------')
                                 if(yk == '-'){
                                     if(y2>y1){
                                         arr2 = d.geometry.coordinates[0][0].slice(y1,y2)
@@ -146,6 +178,10 @@ function writeJson(params){
                                         arr2.push(...(d.geometry.coordinates[0][0].slice(0,y2)))
                                     }
                                 }else{
+                                    if(yArr.length == 3){
+                                        y1 = yArr[2]
+                                        y2 = yArr[1]
+                                    }
                                     if(y2>y1){
                                         arr2 = d.geometry.coordinates[0][0].slice(y2,d.geometry.coordinates[0][0].length-1)
                                         arr2.push(...(d.geometry.coordinates[0][0].slice(0,y1)))
@@ -155,6 +191,9 @@ function writeJson(params){
 
                                 }
                                 if(xk == '-'){
+                                    // if(xk != yk){
+                                        // arr2 = arr2.reverse();
+                                    // }
                                     if(x2>x1){
                                         item.geometry.coordinates[0][0].splice(x2,item.geometry.coordinates[0][0]-1-x2)
                                         item.geometry.coordinates[0][0].splice(0,x1,...arr2)
@@ -189,14 +228,14 @@ function writeJson(params){
                 index = 0;
                 arr3Length = 0;
             }
-            if(arr3.length>0&&index<3){
+            if(arr3.length>0&&index<2){
                 arr3Length = arr3.length;
                 fun(arr3,provinceName,name,item)
             }else{
                 // console.log(provinceName+' 1')
                 // console.log(provinceNameArrJSON[provinceName]+' 2')
                 // console.log(provinceNameArrJSON[provinceName].features.length+'已计算个数')
-                if(index>=3){
+                if(index>=2){
                     item = {
                         type: "Feature",
                         geometry: {
@@ -237,8 +276,8 @@ function writeJson(params){
                 
             }
         }
-        for(let provinceName of provinceNameArr){
-            for(let name of cityName['Barisal']){
+        // for(let provinceName of provinceNameArr){
+            // for(let name of cityName['Barisal']){
                 let item = {
                     type: "Feature",
                     geometry: {
@@ -251,10 +290,11 @@ function writeJson(params){
                 }
                 index = 0;
                 number = 0;
-                fun(bangladesh.features,'Barisal',name,item)
-            }
-            // fun(bangladesh.features,'Barisal','Pirojpur',item)
-        }
+                arr3Length = 0;
+            //     fun(bangladesh.features,'Barisal',name,item)
+            // }
+            fun(bangladesh.features,'Barisal','Barisal',item)
+        // }
         // fun(bangladesh.features,'Khulna')
         // console.log(cityName)
 

+ 97 - 554
webConfig/src/views/GISMap.vue

@@ -2,7 +2,7 @@
     <div class="GISMap_main">
         <div class="main_top_bg">
         </div>
-        <side-bar-idcol class="side_bar_left" :sideBarList="projectNav" :projectId="projectId" :roadId="roadId" :sideBarListIsOpen="sideBarListIsOpen" :projectSelectFun="projectSelectFun" :roadSelectFun="roadSelectFun" :sideBarIsOn="sideBarIsOn" :sideBarType="sideBarType" :sideBarCompanyList="sideBarCompanyList" :projectAll="projectAll"></side-bar-idcol>
+        <side-bar-idcol class="side_bar_left" :sideBarList="projectNav" :companyId="companyId" :projectId="projectId" :roadId="roadId" :sideBarListIsOpen="sideBarListIsOpen" :projectSelectFun="projectSelectFun" :roadSelectFun="roadSelectFun" :sideBarIsOn="sideBarIsOn" :sideBarType="sideBarType" :sideBarCompanyList="sideBarCompanyList" :projectAll="projectAll"></side-bar-idcol>
         <div class="right_sidebar_box">
             <div class="top_data_box" :class="{'EN':version == '0'}" :style="{'top':topDataBoxShow?'0px':'-96px'}">
                 <div class="ul" >
@@ -20,7 +20,7 @@
                 </div>
             </div>
         </div>
-        <div class="amap-wrapper" element-loading-text="地图数据加载中">
+        <div class="amap-wrapper" element-loading-text="Map data loading">
             <div id="container">
             </div>
             <ul class="contextmenu" :style="{'top':contextmenuY+'px','left':contextmenuX+'px'}" v-show="contextmenuIsShow" @contextmenu="contextmenuFun">
@@ -66,7 +66,7 @@
                         <div class="li li2"><span class="span1">{{'SN'}}</span><span class="span2">{{dialogLampInfo.address}}</span></div>
                     </div>
                     <div class="box1_right">
-                        <img :src="'./src/img/GIS/wifi_'+dialogLampInfo.netStatus+'.png'" />
+                        <img :src="require('../img/GIS/wifi_'+dialogLampInfo.netStatus+'.png')" />
                     </div>
                 </div>
                 <div class="box">
@@ -127,8 +127,8 @@
                     <div class="li">
                         <div class="li_left">
                             <span class="span1">{{'state'}}</span>
-                            <span class="span2" v-if="version=='0'">{{chargestageData[dialogLampInfo.chargestage]}}</span>
-                            <span class="span2" v-if="version=='1'">{{chargestageDataEN[dialogLampInfo.chargestage]}}</span>
+                            <!-- <span class="span2" v-if="version=='0'">{{chargestageData[dialogLampInfo.chargestage]}}</span> -->
+                            <span class="span2" >{{chargestageDataEN[dialogLampInfo.chargestage]}}</span>
                         </div>
                         <i></i>
                         <div class="li_right">
@@ -345,7 +345,7 @@
                                 <template slot-scope="scope">
                                     <i class="border_i" v-if="item.prop=='number'"></i>
                                     <span v-if="item.prop!='netStatus'" :class="{'red':scope.row.isfaulted == 1}">{{scope.row[item.prop]}}</span>
-                                    <img v-if="item.prop=='netStatus'" :src="'./src/img/GIS/wifi_'+scope.row[item.prop]+'.png'" class="wifi_img" />
+                                    <img v-if="item.prop=='netStatus'" :src="require('../img/GIS/wifi_'+scope.row[item.prop]+'.png')" class="wifi_img" />
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -718,14 +718,13 @@
                     height="374"
                     :row-class-name="tableRowClassName">
                     <el-table-column
-                      v-if="version == 0"
                       label="Number"
                       prop="LSLD_index"
                       align="center"
                       :show-overflow-tooltip="true"
                       width="82">
                     </el-table-column>
-                    <template v-if="version == 0">
+                    <template>
                         <el-table-column :show-overflow-tooltip="true" :sortable="item.sortable" :prop="item.prop" :label="item.label" :key="item.id" v-for="item in historicalTableList" align="center">
                             <template slot-scope="scope">
                                 <span v-if="item.prop !='lampstatus' && item.prop !='battstatus' && item.prop !='chargestage'">{{scope.row[item.prop]}}</span>
@@ -764,7 +763,7 @@
                         </el-table-column>
                     </template>
 
-                    <el-table-column :show-overflow-tooltip="true" header-align="center"  prop="updatetime" label="Update time" width="160px" v-if="version == 0">
+                    <el-table-column :show-overflow-tooltip="true" header-align="center"  prop="updatetime" label="Update time" width="160px">
                     </el-table-column>
                 </el-table>
                 <div v-if="dataLSType == '0'" class="LS_echarts" key="dataLSType_0">
@@ -2446,32 +2445,36 @@
                     data =>{
                         // console.log(data,'公司列表')
                         console.log(init)
-                        if(init){
-                            if(type == 0){
-                                if(data.data.length>0){
+                        let storage = window.localStorage;
+                        let companyId = storage.getItem("companyId");
+                        let projectId = storage.getItem("projectId")
+                        if(type == 0){
+                            if(data.data.length>0){
+                                if(projectId){
+                                    this.projectId = projectId;
+                                }else{
                                     this.projectId = data.data[0].id;
-                                    this.sectionNavGet(data.data[0].id,data.data[0])
-                                    for(let key in data.data){
-                                        this.$set(data.data[key],'isOpen',false)
+                                }
+                                        this.sectionNavGet(data.data[0].id,data.data[0])
+                                for(let key in data.data){
+                                    this.$set(data.data[key],'isOpen',false)
+                                    if(data.data[key].id == this.projectId){
+                                        this.$set(data.data[key],'isOpen',true)
                                     }
-                                    this.$set(data.data[0],'isOpen',true)
                                 }
+                            }
 
-                            }else{
-                                if(data.data.length>0){
-                                    for(let key in data.data){
-                                        this.$set(data.data[key],'isOpen',false)
-                                        if(data.data[0].projectList.length>0){
-                                            for(let d of data.data[0].projectList){
-                                                this.$set(d,'isOpen',true)
-                                            }
-                                        }
-                                    }
-                                    this.$set(data.data[0],'isOpen',true)
-                                    this.companyId = data.data[0].cId;
+                        }else{
+                            if(data.data.length>0){
+                                if(companyId){
+                                    this.companyId = companyId;
                                     if(data.data[0].projectList.length>0){
-                                        this.projectId = data.data[0].projectList[0].id;
-                                        this.$set(data.data[0].projectList[0],'isOpen',true)
+                                        if(projectId){
+                                            this.projectId = projectId;
+                                        }else{
+                                            this.projectId = data.data[0].projectList[0].id;
+                                        }
+                                        // this.$set(data.data[0].projectList[0],'isOpen',true)
                                         this.sectionNavGet(data.data[0].id,data.data[0])
                                     }else{
                                         this.projectId = null;
@@ -2487,49 +2490,12 @@
                                         this.fault = 0;
                                     }
                                 }else{
-                                    this.companyId = null
-                                    this.projectId = null;
-                                    this.deviceTotalData = {
-                                        light_num:0,
-                                        online_num:0,
-                                        fault_count:0,
-                                        network_num:0
-                                    };
-                                    this.deviceList = [];
-                                    this.total = 0;
-                                    this.count = 0;
-                                    this.fault = 0;
-                                }
-                            }
-                        }else{
-                            if(type == 0){
-                                if(data.data.length>0){
-                                    this.projectId = data.data[0].id;
-                                    this.sectionNavGet(data.data[0].id,data.data[0])
-                                    for(let key in data.data){
-                                        this.$set(data.data[key],'isOpen',false)
-                                    }
-                                    this.$set(data.data[0],'isOpen',true)
-                                }
-
-                            }else{
-                                if(data.data.length>0){
-                                    for(let key in data.data){
-                                        this.$set(data.data[key],'isOpen',false)
-                                        if(data.data[0].projectList.length>0){
-                                            for(let d of data.data[0].projectList){
-                                                this.$set(d,'isOpen',true)
-                                            }
-                                        }
-                                    }
-                                    this.$set(data.data[0],'isOpen',true)
                                     this.companyId = data.data[0].cId;
                                     if(data.data[0].projectList.length>0){
                                         this.projectId = data.data[0].projectList[0].id;
-                                        this.$set(data.data[0].projectList[0],'isOpen',true)
+                                        // this.$set(data.data[0].projectList[0],'isOpen',true)
                                         this.sectionNavGet(data.data[0].id,data.data[0])
                                     }else{
-                                        this.projectId = null;
                                         this.projectId = null;
                                         this.deviceTotalData = {
                                             light_num:0,
@@ -2542,22 +2508,37 @@
                                         this.count = 0;
                                         this.fault = 0;
                                     }
-                                }else{
-                                    this.companyId = null;
-                                    this.projectId = null;
-                                    this.deviceTotalData = {
-                                        light_num:0,
-                                        online_num:0,
-                                        fault_count:0,
-                                        network_num:0
-                                    };
-                                    this.deviceList = [];
-                                    this.total = 0;
-                                    this.count = 0;
-                                    this.fault = 0;
                                 }
+                                for(let key in data.data){
+                                    this.$set(data.data[key],'isOpen',false)
+                                    if(data.data[key].cId == this.companyId){
+                                        this.$set(data.data[key],'isOpen',true)
+                                    }
+                                    if(data.data[0].projectList.length>0){
+                                        for(let d of data.data[0].projectList){
+                                            this.$set(d,'isOpen',true)
+                                            if(d.id == this.projectId){
+                                                this.$set(d,'isOpen',true)
+                                            }
+                                        }
+                                    }
+                                }
+                            }else{
+                                this.companyId = null
+                                this.projectId = null;
+                                this.deviceTotalData = {
+                                    light_num:0,
+                                    online_num:0,
+                                    fault_count:0,
+                                    network_num:0
+                                };
+                                this.deviceList = [];
+                                this.total = 0;
+                                this.count = 0;
+                                this.fault = 0;
                             }
                         }
+                        console.log(this.companyId)
                         this.projectNav = data.data;
                         this.dateNav();
                         this.lampListGet(1);
@@ -2720,15 +2701,9 @@
                                 // console.log(data)
                                 for(let d of data.data.lamps){
                                     if(d.status == '1'){
-                                        d.runState = '亮灯'
-                                        if(this_.version == 1){
-                                            d.runState = 'Lamp on'
-                                        }
+                                        d.runState = 'Lamp on'
                                     }else{
-                                        d.runState = '关灯'
-                                        if(this_.version == 1){
-                                            d.runState = 'Lamp off'
-                                        }
+                                        d.runState = 'Lamp off'
                                     }
                                     this_.streetLampList.push(d);
                                 }
@@ -2764,15 +2739,9 @@
                         this.lampListPage = 1;
                         for(let d of this.streetLampList){
                             if(d.status == '1'){
-                                d.runState = '亮灯'
-                                if(this.version == 1){
-                                    d.runState = 'Lamp on'
-                                }
+                                d.runState = 'Lamp on'
                             }else{
-                                d.runState = '关灯'
-                                if(this.version == 1){
-                                    d.runState = 'Lamp off'
-                                }
+                                d.runState = 'Lamp off'
                             }
                         }
                     },
@@ -2790,9 +2759,9 @@
             },
             /*灯控删除*/
             lampDelFun(){
-                this.$confirm(this.version==0?'此操作将永久删除该'+this.lmText+', 是否继续?':'This operation will permanently delete the lamp control, will it continue?', this.version==0?'提示':'Prompt', {
-                  confirmButtonText: this.version==0?'确定':'confirm',
-                  cancelButtonText: this.version==0?'取消':'cancel',
+                this.$confirm('This operation will permanently delete the lamp control, will it continue?', 'Prompt', {
+                  confirmButtonText: 'confirm',
+                  cancelButtonText: 'cancel',
                   type: 'warning'
                 }).then(() => {
                     if(this.lampType == 'monitor'){
@@ -2860,7 +2829,7 @@
                   this.lampId = '-1';
                   this.$message({
                     type: 'info',
-                    message: this.version == 0?'已取消删除':'Canceled deleting'
+                    message: 'Canceled deleting'
                   });          
                 });
             },
@@ -2879,9 +2848,9 @@
                 this.lamp_editFun();
                 if(this.lampEditFunIsfirst){
                     this.$notify({
-                      title: this.version==0?'编辑您'+this.lmText:'Edit '+this.lmText,
+                      title: 'Edit '+this.lmText,
                       dangerouslyUseHTMLString: true,
-                      message: this.version==0?'拖动'+this.lmText+'来调整它的位置经纬度<span class="lampEditTiTleClose">我知道了</span>':'Drag the '+this.lmText+' to adjust its latitude and longitude<span class="lampEditTiTleClose">Oh I see</span>',
+                      message: 'Drag the '+this.lmText+' to adjust its latitude and longitude<span class="lampEditTiTleClose">Oh I see</span>',
                       customClass:"lampEditTiTle",
                       duration: 0,
                       offset: 100,
@@ -2904,13 +2873,9 @@
                     data.data.latitude = bd_decrypt.lat.toFixed(8);
                     let JDstr = '';
                     let WDstr = '';
-                    if(this.version == 0){
-                        JDstr = '经度';
-                        WDstr = '纬度';
-                    }else{
-                        JDstr = 'longitude';
-                        WDstr = 'latitude';
-                    }
+
+                    JDstr = 'longitude';
+                    WDstr = 'latitude';
 
                     this.lampLongitude = data.data.longitude;
                     this.lampLatitude = data.data.latitude;
@@ -3247,7 +3212,7 @@
                             }else{
                                 this.$message({
                                   showClose: true,
-                                  message:this.version==0?'该组网当前没有灯控':'The network has no light control at present',
+                                  message:'The network has no light control at present',
                                   type: 'warning'
                                 });
                             }
@@ -3396,14 +3361,14 @@
                 if(this.streetLampList.length == 0){
                     this.$message({
                       showClose: true,
-                      message:this.version==0?'该项目当前没有灯控':'The project has no light control at present',
+                      message:'The project has no light control at present',
                       type: 'warning'
                     });
                 }else{
                     // console.log(this.projectData.company)
-                    this.$confirm(this.version==0?'是否确认?':'Is it confirmed?', this.version==0?'提示':'Prompt', {
-                      confirmButtonText: this.version==0?'确定':'confirm',
-                      cancelButtonText: this.version==0?'取消':'cancel',
+                    this.$confirm('Is it confirmed?', 'Prompt', {
+                      confirmButtonText: 'confirm',
+                      cancelButtonText: 'cancel',
                       type: 'warning'
                     }).then(() => {
                         this.turnonoffType = value;
@@ -3441,7 +3406,7 @@
                       this.lampId = '-1';
                       this.$message({
                         type: 'info',
-                        message: this.version == 0?'已取消操作':'Canceled deleting'
+                        message: 'Canceled deleting'
                       });          
                     });
                 }
@@ -3629,18 +3594,12 @@
                             let bgColor = '';
                             let borderColor = '';
                             if(d.lampstatus == '0'){
-                                d.runningState = '故障';
-                                if(this_.version == 1){
-                                    d.runningState = 'malfunction'
-                                }
+                                d.runningState = 'malfunction'
                                 lampType = 'fault'
                                 bgColor = '#ff0505';
                                 borderColor = 'rgba(255, 5, 5, 0.14)';
                             }else{
-                                d.runningState = '正常'
-                                if(this_.version == 1){
-                                    d.runningState = 'malfunction'
-                                }
+                                d.runningState = 'malfunction'
                                 if(d.netStatus == '0'){
                                     lampType = 'off-line';
                                     bgColor = '#7c7c7c';
@@ -3828,395 +3787,8 @@
                             this_.lamp_editFun();
                         }
                     },1)
-                    // console.log(this_.map.getZoom())
-                    if(this_.map.getZoom() > 17){
-                        // this_.cluster = new AMap.MarkerClusterer(this_.map,this_.markers,{
-                  //           gridSize:52,
-                  //           minClusterSize:2,
-                  //           maxZoom:2,
-                  //           renderCluserMarker:this_._renderCluserMarker
-                  //       });
-                        // var markers = this_.markers.map(function(location, i) {
-                       //    return new google.maps.Marker({
-                       //      position: location,
-                       //      label: '',
-                       //    });
-                       //  });
-                        // var markerCluster = new MarkerClusterer(this_.map, this_.markers,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
-                        // var markerCluster = new MarkerClusterer(this_.map, this_.markers,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
-                    }else{
-                     //    var markers = this_.markers.map(function(location, i) {
-                        //   return new google.maps.Marker({
-                        //     position: location,
-                        //     label: '',
-                        //   });
-                        // });
-                        // var markerCluster = new MarkerClusterer(this_.map, this_.markers,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
-                        // let number = parseInt(this_.markers.length)
-                  //       this_.cluster = new AMap.MarkerClusterer(this_.map,this_.markers,{
-                  //           gridSize:52,
-                  //           minClusterSize:2,
-                  //           maxZoom:number*100,
-                  //           renderCluserMarker:this_._renderCluserMarker
-                  //       });
-                    }
                 });
             },
-            // mapGet(type,XY,obj,isNew){
-            //     let this_ = this;
-            //     let isGet = true;
-            //     if(obj){
-            //         isGet = false;
-            //         this.mapFun(this_,obj,true);
-            //     }
-            //     if(isGet){
-            //         baseApi.ajax_post(
-            //         allUrl.gisMap.getLngLat,
-            //         {
-            //             username:this.username,
-            //             client_key:this.client_key,
-            //             token:this.token,
-            //             lampid:0,
-            //             projectid:this.projectId,
-            //             section:this.roadId,
-            //         },
-            //         {},
-            //         data =>{
-            //             // if(data.data.longitude == 0 && data.data.latitude == 0){
-            //             //  /*创建地图*/
-            //             //  this_.map = new AMap.Map("container", {
-            //                //      resizeEnable: true,
-            //                //      zooms:[0,20],
-            //                //      zoom: 16,
-            //                //  });
-            //             // }else{
-            //             if(isNew){
-            //                 let decrypt =  this.bd_decrypt(data.data.longitude,data.data.latitude)
-            //                 data.data.longitude = decrypt.lng;
-            //                 data.data.latitude = decrypt.lat;
-            //                 // console.log(data.data.longitude,data.data.latitude,'===========')
-            //                 /*创建地图*/
-            //                 this.map = new AMap.Map("container", {
-            //                     resizeEnable: true,
-            //                     center:[data.data.longitude,data.data.latitude],
-            //                     zooms:[0,20],
-            //                     zoom: 16,
-            //                 });
-            //                 // }
-            //                 this.map.setFeatures(['road','bg','point']); // 多个种类要素显示 bg区域面/point兴趣点/road道路及道路标注/
-            //                 // this.map.setMapStyle('amap://styles/macaron');
-            //                 // console.log(this.map.getFeatures(),'--------------')
-            //                 var homeControl=new AMap.mapSwitch(this.map); //新建自定义插件对象
-            //                 this.map.addControl(homeControl);
-            //                 // this_.map.setLang(Lang);
-            //                 console.log(type,XY,'--123---')
-            //                 AMap.plugin([
-            //                     // 'AMap.MapType',
-            //                     'AMap.ToolBar',
-            //                 ], function(){
-            //                     // this_.map.addControl(new AMap.MapType({
-
-            //                     // }));
-            //                     this_.map.addControl(new AMap.ToolBar({
-            //                         liteStyle:true
-            //                     }));
-            //                 })
-            //             }
-            //             let lampId = '';
-            //             if(type == 'lamp'){
-            //                 XY  = [this.bd_decrypt(XY[0],XY[1]).lng,this.bd_decrypt(XY[0],XY[1]).lat];
-            //                 this_.map.setZoomAndCenter(17,XY)
-            //                 lampId = this_.lampId;
-            //             }else if(type != 'del'){
-            //                 if(this_.streetLampType == 'list'){
-            //                     this_.lampIdChangeType = 'list';
-            //                     this_.lampId = '-1';
-            //                 }
-            //             }
-            //             this.$nextTick(function(){
-            //                 let encrypt_low = this.bd_encrypt(this.map.getBounds().southwest.lng,this.map.getBounds().southwest.lat)
-            //                 let encrypt_high = this.bd_encrypt(this.map.getBounds().northeast.lng,this.map.getBounds().northeast.lat)
-
-            //                 baseApi.ajax_post(
-            //                     allUrl.gisMap.mapGet,
-            //                     {
-            //                         username:this.username,
-            //                         client_key:this.client_key,
-            //                         token:this.token,
-            //                         project_id:this.projectId,
-            //                         section:this.roadId,
-            //                         type:this.operationType,
-            //                         keyword:this.keyword,
-            //                         lng_low:encrypt_low.bd_lng,
-            //                         lat_low:encrypt_low.bd_lat,
-            //                         lng_high:encrypt_high.bd_lng,
-            //                         lat_high:encrypt_high.bd_lat,
-            //                         multiple:this.map.getZoom(),
-            //                         lampid:lampId,
-            //                     },
-            //                     {},
-            //                     data =>{
-            //                         this.mapDataListHC = data.data.lamps;
-            //                         this.mapFun(this_,data.data.lamps);
-            //                     },
-            //                 this)
-            //                 this_.map.on('dragend', function() {
-            //                     clearTimeout(this_.timeoutMap)
-            //                     this_.timeoutMap = setTimeout(function(){
-
-            //                         let encrypt_low = this_.bd_encrypt(this_.map.getBounds().southwest.lng,this_.map.getBounds().southwest.lat)
-            //                         let encrypt_high = this_.bd_encrypt(this_.map.getBounds().northeast.lng,this_.map.getBounds().northeast.lat)
-
-            //                         this_.cluster.clearMarkers();
-            //                         baseApi.ajax_post(
-            //                             allUrl.gisMap.mapGet,
-            //                             {
-            //                                 username:this_.username,
-            //                                 client_key:this_.client_key,
-            //                                 token:this_.token,
-            //                                 project_id:this_.projectId,
-            //                                 section:this_.roadId,
-            //                                 type:this_.operationType,
-            //                                 keyword:this_.keyword,
-            //                                 lng_low:encrypt_low.bd_lng,
-            //                                 lat_low:encrypt_low.bd_lat,
-            //                                 lng_high:encrypt_high.bd_lng,
-            //                                 lat_high:encrypt_high.bd_lat,
-            //                                 multiple:this_.map.getZoom(),
-            //                                 lampid:lampId,
-            //                             },
-            //                             {},
-            //                             data =>{
-            //                                 this_.mapDataListHC = data.data.lamps;
-            //                                 this_.mapFun(this_,data.data.lamps);
-            //                             },
-            //                         this_)
-            //                     },800)
-            //                 })
-            //                 this_.map.on('zoomchange', function() {
-            //                     clearTimeout(this_.timeoutMap)
-            //                     this_.timeoutMap = setTimeout(function(){
-
-            //                         let encrypt_low = this_.bd_encrypt(this_.map.getBounds().southwest.lng,this_.map.getBounds().southwest.lat)
-            //                         let encrypt_high = this_.bd_encrypt(this_.map.getBounds().northeast.lng,this_.map.getBounds().northeast.lat)
-
-            //                         this_.cluster.clearMarkers();
-            //                         baseApi.ajax_post(
-            //                             allUrl.gisMap.mapGet,
-            //                             {
-            //                                 username:this_.username,
-            //                                 client_key:this_.client_key,
-            //                                 token:this_.token,
-            //                                 project_id:this_.projectId,
-            //                                 section:this_.roadId,
-            //                                 type:this_.operationType,
-            //                                 keyword:this_.keyword,
-            //                                 lng_low:encrypt_low.bd_lng,
-            //                                 lat_low:encrypt_low.bd_lat,
-            //                                 lng_high:encrypt_high.bd_lng,
-            //                                 lat_high:encrypt_high.bd_lat,
-            //                                 multiple:this_.map.getZoom(),
-            //                                 lampid:lampId,
-            //                             },
-            //                             {},
-            //                             data =>{
-            //                                 this_.mapDataListHC = data.data.lamps;
-            //                                 this_.mapFun(this_,data.data.lamps);
-            //                             },
-            //                         this_)
-            //                     },800)
-            //                 });
-            //             })
-            //         },
-            //         this)
-            //     }
-            // },
-            // mapFun(this_,data,isTrue){
-            //     this_.cluster = null;
-            //     this_.markers = [];
-            //     this_.$nextTick(function(){
-            //         this_.map.remove(this_.markerListHC)
-            //         // this_.map.clearMap()
-            //         this_.markerListHC = [];
-            //         for(let d of data){
-            //             if(!isTrue){
-            //                 let decrypt =  this_.bd_decrypt(d.longitude,d.latitude);
-            //                 d.longitude = decrypt.lng;
-            //                 d.latitude = decrypt.lat;
-            //             }
-
-            //             if((!this_.lampEdit && d.id != this_.lampId) || this_.lampEdit){
-            //                 if(d.is_lamp == 1){
-            //                     let lampType = '';
-            //                     let bgColor = '';
-            //                     let borderColor = '';
-            //                     if(d.lampstatus == '0'){
-            //                         d.runningState = '故障';
-            //                         if(this_.version == 1){
-            //                             d.runningState = 'malfunction'
-            //                         }
-            //                         lampType = 'fault'
-            //                         bgColor = '#ff0505';
-            //                         borderColor = 'rgba(255, 5, 5, 0.14)';
-            //                     }else{
-            //                         d.runningState = '正常'
-            //                         if(this_.version == 1){
-            //                             d.runningState = 'malfunction'
-            //                         }
-            //                         if(d.netStatus == '0'){
-            //                             lampType = 'off-line';
-            //                             bgColor = '#7c7c7c';
-            //                             borderColor = 'rgba(167, 167, 167, 0.18)';
-            //                         }else{
-            //                             if(d.status == '1'){
-            //                                 lampType = 'on'
-            //                                 bgColor = 'linear-gradient(#fc8440, #fe7121)';
-            //                                 borderColor = 'rgba(253, 122, 48, 0.18)';
-            //                             }else{
-            //                                 lampType = 'off'
-            //                                 bgColor = '#ffb68d';
-            //                                 borderColor = 'rgba(242, 223, 199, 0.18)';
-            //                             }
-            //                         }
-            //                     }
-            //                     let lamp_icon;
-            //                     if(this_.mapTCtype == 'TileLayer'){
-            //                         lamp_icon = `<div style="text-align:center;background:${bgColor};background-clip:padding-box;border:2px solid #fff; height: 16px; width: 16px; border-radius:50%;" class="lamp lamp_${d.id} ${lampType}"></div>`
-            //                     }else{
-            //                         lamp_icon = `<div class="lamp lamp_${d.id} ${lampType} lamp_icon lamp_Satellite_${lampType}_${d.direction}"></div>`
-            //                     }
-                                
-
-            //                     this_.markers.push(new AMap.Marker({
-            //                         position:[d.longitude,d.latitude],
-            //                         content: `<div style="text-align:center;border:11px solid ${borderColor};border-radius:50%;" class="lamp lamp_${d.id} ${lampType} lamp_${this_.mapTCtype}">
-            //                                 ${lamp_icon}
-            //                                 <div class="map_lamp_info map_lamp_info_${d.id}">
-            //                                 <div class="map_lamp_info_bg">
-            //                                     <div class="top">
-            //                                         <span>${'路灯'+d.number}</span>
-            //                                         <img src="./src/img/GIS/wifi_${d.netStatus}.png" />
-            //                                         <sapn class="right lamp_info_click ${d.id}" >${'更多'}</span>
-            //                                     </div>
-            //                                     <div class="ul">
-            //                                         <div class="li">
-            //                                             <span class="span1">${'亮度:'}</span>
-            //                                             <span class="span2">${d.light}%</span>
-            //                                         </div>
-            //                                         <div class="li">
-            //                                             <span class="span1">${'电压:'}</span>
-            //                                             <span class="span2">${d.lampvoltage}V</span>
-            //                                         </div>
-            //                                         <div class="li">
-            //                                             <span class="span1">${'功率:'}</span>
-            //                                             <span class="span2">${d.lamppower}W</span>
-            //                                         </div>
-            //                                         <div class="li">
-            //                                             <span class="span1">${'SN:'}</span>
-            //                                             <span class="span2">${d.address}</span>
-            //                                         </div>
-            //                                         <div class="li">
-            //                                             <span class="span1">${'充电:'}</span>
-            //                                             <span class="span2">${this_.chargestageData[d.chargestage]}</span>
-            //                                         </div>
-            //                                     </div>
-            //                                     <div class="bottom">
-            //                                         <span class="span1">${'更新时间:'}</span>
-            //                                         <span class="span2">${d.updatetime}</span>
-            //                                     </div>
-            //                                     <div class="icon"></div>
-            //                                 </div>
-            //                             </div>
-            //                             </div>`,
-            //                         offset: new AMap.Pixel(-19,-19),
-            //                         extData:d.id+d.number,
-            //                     }))
-            //                 }else if(d.is_marker == 1){
-            //                     // console.log(d,'----------')
-            //                     let div = document.createElement('div');
-            //                     div.style.backgroundColor = '#ffffff';
-            //                     div.style.height = '27px';
-            //                     div.style.width = (d.count.toString().length*8+20)+'px';
-            //                     div.style.borderRadius = '2px';
-            //                     div.style.boxShadow = '0 0 4px rgba(0, 0, 0, 0.2)';
-            //                     div.innerHTML = d.count;
-            //                     div.className = 'map_jh';
-            //                     div.style.lineHeight = '27px';
-            //                     div.style.color = '#222222';
-            //                     div.style.fontSize = '12px';
-            //                     div.style.textAlign = 'center';
-            //                     let divCY = document.createElement('div');
-            //                     divCY.className = 'map_CY';
-            //                     div.appendChild(divCY);
-            //                     var marker = new AMap.Marker({
-            //                         content: div,  // 自定义点标记覆盖物内容
-            //                         position:[d.longitude, d.latitude], // 基点位置
-            //                         offset:new AMap.Pixel(-(d.count.toString().length*8+20)/2,-27/2) // 相对于基点的偏移位置
-            //                     });
-            //                     marker.on('click',function(e){
-            //                         // console.log(e)
-            //                         this_.map.setZoomAndCenter(this_.map.getZoom()+1, [e.lnglat.lng,e.lnglat.lat]);
-            //                     })
-            //                     this_.map.add(marker);
-            //                     this_.markerListHC.push(marker)
-            //                 }else if(d.is_video == 1){
-            //                     this_.markers.push(new AMap.Marker({
-            //                       position:[d.longitude,d.latitude],
-            //                       content:'<div style="text-align:center;border:11px solid rgba(49, 180, 253, 0.18); border-radius:50%;cursor:pointer;" class="monitor monitor_'+d.id+' '+d.latitude+' '+d.longitude+' '+d.image+'"><div style="text-align:center;background:#31b4fd;background-clip: padding-box;border:2px solid #fff; height: 16px; width: 16px; border-radius:50%;" class="monitor monitor_'+d.id+' '+d.latitude+' '+d.longitude+' '+d.image+'"></div></div>',
-            //                         offset: new AMap.Pixel(-19,-19),
-            //                         extData:d.id+d.number,
-            //                     }))
-            //                 }
-            //             }
-            //         }
-            //         clearInterval(this_.intervalMap)
-            //         this_.intervalMap = setInterval(function(){
-            //             if(this_.networkLampList.length > 0){
-            //                 for(let d of this_.networkLampList){
-            //                     $('.lamp_'+d.id).addClass("Lamp_active");
-            //                 }
-            //                 if($('.lamp_'+this_.networkLampList[0].id).length>0){
-            //                     clearInterval(this_.intervalMap)
-            //                 }
-            //             }else if($('.lamp_'+this_.lampId).length>0){
-            //                 $('.lamp').removeClass("Lamp_active");
-            //                 $('.monitor').removeClass("monitor_active");
-            //                 $('.lamp_'+this_.lampId).addClass("Lamp_active");
-            //                 clearInterval(this_.intervalMap)
-            //             }else{
-            //                 setTimeout(function(){
-            //                     if($('.amap-marker').length>0){
-            //                         clearInterval(this_.intervalMap)
-            //                     }
-            //                 },500)
-            //             }
-            //             setTimeout(function(){
-            //                 if($('.amap-markers').children().length == 0){
-            //                     clearInterval(this_.intervalMap)
-            //                 }
-            //             },1000)
-            //             if(!this_.lampEdit){
-            //                 this_.lamp_editFun();
-            //             }
-            //         },1)
-            //         if(this_.map.getZoom() > 16){
-            //             this_.cluster = new AMap.MarkerClusterer(this_.map,this_.markers,{
-            //                 gridSize:52,
-            //                 minClusterSize:2,
-            //                 maxZoom:2,
-            //                 renderCluserMarker:this_._renderCluserMarker
-            //             });
-            //         }else{
-            //             let number = parseInt(this_.markers.length)
-            //             this_.cluster = new AMap.MarkerClusterer(this_.map,this_.markers,{
-            //                 gridSize:52,
-            //                 minClusterSize:2,
-            //                 maxZoom:number*100,
-            //                 renderCluserMarker:this_._renderCluserMarker
-            //             });
-            //         }
-            //     });
-            // },
             videoListGet(callback){
                 baseApi.ajax_post(
                     allUrl.gisMap.videoList,
@@ -4382,7 +3954,7 @@
                 const this_=this;
                 this_.definition=flag;
                 if(flag==0){
-                    this_.definitionBtnText=this_.version==0?'标清':'SD';
+                    this_.definitionBtnText='SD';
                     //标清
                     setTimeout(function(){
                         let source=`<video ref="myPlayer" id="myPlayer" controls autoplay playsInline webkit-playsinline poster="">
@@ -4393,7 +3965,7 @@
                         console.log(player)
                     },100)
                 }else{
-                    this_.definitionBtnText=this_.version==0?'高清':'HD';
+                    this_.definitionBtnText='HD';
                     // 高清
                     setTimeout(function(){
                         let source=`<video ref="myPlayer" id="myPlayer" controls autoplay playsInline webkit-playsinline poster="">
@@ -4489,17 +4061,9 @@
             },
             lampType(curVal){
                 if(curVal == 'monitor'){
-                    if(this.version == 0){
-                        this.lmText = '监控'
-                    }else{
-                        this.lmText = 'monitor'
-                    }
+                    this.lmText = 'monitor'
                 }else{
-                    if(this.version == 0){
-                        this.lmText = '灯控'
-                    }else{
-                        this.lmText = 'lamp'
-                    }
+                    this.lmText = 'lamp'
                 }
             },
             surveillanceVideoDialog(curVal){
@@ -4530,26 +4094,9 @@
                 }else{
                     this.lampInfoGet(curVal);
                     // this.sideBarNav = '路灯信息';
-                    if(this.version == 0){
-                        let time = setInterval(function(){
-                            if($('.amap-marker').length>0){
-                                clearInterval(time)
-                            }
-                            setTimeout(function(){
-                                if($('.amap-markers').children().length == 0){
-                                    clearInterval(time)
-                                }
-                            },1000)
-                            $('.lamp').removeClass("Lamp_active");
-                            $('.monitor').removeClass("monitor_active");
-                            $('.lamp_'+curVal).addClass("Lamp_active");
-                            // console.log($('.amap-marker').length,$('.amap-markers').children().length)
-                        },1)
-                    }else{
-                        $('.lamp').removeClass("Lamp_active");
-                        $('.monitor').removeClass("monitor_active");
-                        $('.lamp_'+curVal).addClass("Lamp_active");
-                    }
+                    $('.lamp').removeClass("Lamp_active");
+                    $('.monitor').removeClass("monitor_active");
+                    $('.lamp_'+curVal).addClass("Lamp_active");
                     this.networkLampList = [];
                     this.networkId = '';
                     this.getProjectCompany(curVal,data => {
@@ -4591,18 +4138,14 @@
                                 
                             }else{
                                 if(this.map){
-                                    if(this.version == 0){
-                                        this.map.panTo([data.data.longitude,data.data.latitude]);
+                                    if(data.data.longitude == 0&&data.data.latitude == 0){
+                                        this.map.setCenter(new google.maps.LatLng(0, 0));
+                                    }else if(data.data.longitude == 0&&data.data.latitude != 0){
+                                        this.map.setCenter(new google.maps.LatLng(Number(data.data.latitude),0));
+                                    }else if(data.data.longitude != 0&&data.data.latitude == 0){
+                                        this.map.setCenter(new google.maps.LatLng(0,Number(data.data.longitude)));
                                     }else{
-                                        if(data.data.longitude == 0&&data.data.latitude == 0){
-                                            this.map.setCenter(new google.maps.LatLng(0, 0));
-                                        }else if(data.data.longitude == 0&&data.data.latitude != 0){
-                                            this.map.setCenter(new google.maps.LatLng(Number(data.data.latitude),0));
-                                        }else if(data.data.longitude != 0&&data.data.latitude == 0){
-                                            this.map.setCenter(new google.maps.LatLng(0,Number(data.data.longitude)));
-                                        }else{
-                                            this.map.setCenter(new google.maps.LatLng(Number(data.data.latitude),Number(data.data.longitude)));
-                                        }
+                                        this.map.setCenter(new google.maps.LatLng(Number(data.data.latitude),Number(data.data.longitude)));
                                     }
                                 }
                             }

+ 119 - 19
webConfig/src/views/alarmMaintenance/alarmMaintenance.vue

@@ -3,7 +3,7 @@
     <div class="alarmMaintenance_main">
         <div class="main_top_bg">
         </div>
-        <side-bar-idcol class="side_bar_left" :sideBarList="projectNav" :projectId="projectId" :roadId="roadId" :sideBarListIsOpen="sideBarListIsOpen" :projectSelectFun="projectSelectFun" :roadSelectFun="roadSelectFun" :sideBarIsOn="sideBarIsOn" :sideBarType="sideBarType" :sideBarCompanyList="sideBarCompanyList"></side-bar-idcol>
+        <side-bar-idcol class="side_bar_left" :sideBarList="projectNav" :companyId="companyId" :projectId="projectId" :roadId="roadId" :sideBarListIsOpen="sideBarListIsOpen" :projectSelectFun="projectSelectFun" :roadSelectFun="roadSelectFun" :sideBarIsOn="sideBarIsOn" :sideBarType="sideBarType" :sideBarCompanyList="sideBarCompanyList"></side-bar-idcol>
         <div class="right_sidebar_box">
             <div class="right_sidebar_bg" v-if="rightSideBarType=='on'" @click="rightSideBarIsOn()"></div>
             <div class="right_sidebar">
@@ -428,6 +428,7 @@
                 version:'version',
                 privilege:'privilege',
                 role:'role',
+                sideBarCompanyType:'sideBarCompanyType'
           })
         },
         mounted(){
@@ -483,28 +484,124 @@
                     data =>{
                         // console.log(data,'公司列表')
                         console.log(init)
-                        if(init){
-                            for(let key in data.data){
-                                if(data.data.length>0){
+                        let storage = window.localStorage;
+                        let companyId = storage.getItem("companyId");
+                        let projectId = storage.getItem("projectId")
+                        if(type == 0){
+                            if(data.data.length>0){
+                                if(projectId){
+                                    this.projectId = projectId;
+                                }else{
                                     this.projectId = data.data[0].id;
-                                    this.$set(data.data[0],'isOpen',true)
                                 }
-                                console.log(key)
-                                // if(data.data[key].sectionList.length>0){
-                                // }
+                                if(this.alarmNav != 'Inspection setup'){
+                                    this.alarmGet(1,data => {
+                                        console.log(data)
+                                    })
+                                }else{
+                                    this.patrol_list(1,() => {
+                                        // console.log(data)
+                                    })
+                                }
+                                for(let key in data.data){
+                                    this.$set(data.data[key],'isOpen',false)
+                                    if(data.data[key].id == this.projectId){
+                                        this.$set(data.data[key],'isOpen',true)
+                                    }
+                                }
                             }
 
                         }else{
-                            if(type == 0){
+                            if(data.data.length>0){
+                                if(companyId){
+                                    this.companyId = companyId;
+                                    if(data.data[0].projectList.length>0){
+                                        if(projectId){
+                                            this.projectId = projectId;
+                                        }else{
+                                            this.projectId = data.data[0].projectList[0].id;
+                                        }
+                                        // this.$set(data.data[0].projectList[0],'isOpen',true)
+                                        if(this.alarmNav != 'Inspection setup'){
+                                            this.alarmGet(1,data => {
+                                                console.log(data)
+                                            })
+                                        }else{
+                                            this.patrol_list(1,() => {
+                                                // console.log(data)
+                                            })
+                                        }
+                                    }else{
+                                        this.projectId = null;
+                                        this.deviceTotalData = {
+                                            light_num:0,
+                                            online_num:0,
+                                            fault_count:0,
+                                            network_num:0
+                                        };
+                                        this.deviceList = [];
+                                        this.total = 0;
+                                        this.count = 0;
+                                        this.fault = 0;
+                                    }
+                                }else{
+                                    this.companyId = data.data[0].cId;
+                                    if(data.data[0].projectList.length>0){
+                                        this.projectId = data.data[0].projectList[0].id;
+                                        // this.$set(data.data[0].projectList[0],'isOpen',true)
+                                        if(this.alarmNav != 'Inspection setup'){
+                                            this.alarmGet(1,data => {
+                                                console.log(data)
+                                            })
+                                        }else{
+                                            this.patrol_list(1,() => {
+                                                // console.log(data)
+                                            })
+                                        }
+                                    }else{
+                                        this.projectId = null;
+                                        this.deviceTotalData = {
+                                            light_num:0,
+                                            online_num:0,
+                                            fault_count:0,
+                                            network_num:0
+                                        };
+                                        this.deviceList = [];
+                                        this.total = 0;
+                                        this.count = 0;
+                                        this.fault = 0;
+                                    }
+                                }
                                 for(let key in data.data){
-                                    if(data.data.length>0){
-                                    this.projectId = data.data[0].id;
-                                        this.$set(data.data[0],'isOpen',true)
+                                    this.$set(data.data[key],'isOpen',false)
+                                    if(data.data[key].cId == this.companyId){
+                                        this.$set(data.data[key],'isOpen',true)
                                     }
-                                    console.log(key)
-                                }  
+                                    if(data.data[0].projectList.length>0){
+                                        for(let d of data.data[0].projectList){
+                                            this.$set(d,'isOpen',true)
+                                            if(d.id == this.projectId){
+                                                this.$set(d,'isOpen',true)
+                                            }
+                                        }
+                                    }
+                                }
+                            }else{
+                                this.companyId = null
+                                this.projectId = null;
+                                this.deviceTotalData = {
+                                    light_num:0,
+                                    online_num:0,
+                                    fault_count:0,
+                                    network_num:0
+                                };
+                                this.deviceList = [];
+                                this.total = 0;
+                                this.count = 0;
+                                this.fault = 0;
                             }
                         }
+                        console.log(this.companyId)
                         this.projectNav = data.data;
                     },
                 this)
@@ -570,13 +667,13 @@
             },
             printing(){
                 let type = '';
-                if(this.alarmNav == '告警信息' || this.alarmNav == 'Alarm'){
+                if(this.alarmNav == 'Alarm'){
                     type = 0;
                 }
-                if(this.alarmNav == '历史告警' || this.alarmNav == 'Historical alarm'){
+                if(this.alarmNav == 'Historical alarm'){
                     type = 1;
                 }
-                if(this.alarmNav == '巡检设置' ||this.alarmNav == 'Inspection setup'){
+                if(this.alarmNav == 'Inspection setup'){
                     type = 2;
                 }
                 this.loading.printing = true;
@@ -733,7 +830,7 @@
             },
             search(){
                 // console.log(this.alarmNav)
-                if(this.alarmNav != '巡检设置' && this.alarmNav != 'Inspection setup'){
+                if(this.alarmNav != 'Inspection setup'){
                     this.alarmGet(1,data => {
                         console.log(data)
                     })
@@ -847,6 +944,7 @@
                             }
                             callback(data)
                         }
+                        this.$refs.elTable.doLayout();
                     },
                 this)
             },
@@ -906,8 +1004,9 @@
             },
             projectSelectFun(type,data,d){
                 var storage = window.localStorage;
+                console.log(type,data,d)
                 storage.setItem('projectId',data.id);
-                if(this.sideBarCompanyType != 0){
+                if(type != 0){
                     if(d.cId != this.companyId){
                         this.companyId = d.cId;
                         storage.setItem('companyId',d.cId);
@@ -929,6 +1028,7 @@
             },
             roadSelectFun(data,obj,d){
                 var storage = window.localStorage;
+                console.log(data,obj,d)
                 if(this.sideBarCompanyType == 0){
                     if(data.id != this.projectId){
                         storage.setItem('projectId',data.id);

+ 238 - 98
webConfig/src/views/dashboard.vue

@@ -5,25 +5,24 @@
                 <img src="../img/iconfont/notice.png"><span class="span">Please pay attention to the updated content at any time.</span>
             </div>
             <div class="right_operation">
-                <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_division')">
+                <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_provinceId')">
                     <span class="el-dropdown-link">
-                        <span>{{divisionName}}</span><i class="el-icon-caret-bottom el-icon--right"></i>
+                        <span>{{provinceIdName}}</span><i class="el-icon-caret-bottom el-icon--right"></i>
                     </span>
-                    <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_division">
-                        <el-dropdown-item v-for="item in divisionNav" :class="{'select':item.id==division}" :command="{'key':'division','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
+                    <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_provinceId">
+                        <el-dropdown-item :class="{'select':null==provinceId}" :command="{'key':'provinceId','id':null}" :key="null">{{'All'}}</el-dropdown-item>
+                        <el-dropdown-item v-for="item in provinceList" :class="{'select':item.id==provinceId}" :command="{'key':'provinceId','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
-                <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_district')">
+                <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_cityId')">
                     <span class="el-dropdown-link">
-                        <span>{{districtName}}</span><i class="el-icon-caret-bottom el-icon--right"></i>
+                        <span>{{cityIdName}}</span><i class="el-icon-caret-bottom el-icon--right"></i>
                     </span>
-                    <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_district">
-                        <el-dropdown-item v-for="item in districtNav" :class="{'select':item.id==district}" :command="{'key':'district','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
+                    <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_cityId">
+                        <el-dropdown-item :class="{'select':null==cityId}" :command="{'key':'cityId','id':null}" :key="null">{{'All'}}</el-dropdown-item>
+                        <el-dropdown-item v-for="item in cityList" :class="{'select':item.id==cityId}" :command="{'key':'cityId','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
-                <!-- <el-input placeholder="search..." v-model="keywords" @keyup.native="getLightListKeyUp($event)" class="input-with-select">
-                    <i slot="suffix" class="el-input__icon el-icon-search" @click="getLightList()"></i>
-                </el-input> -->
             </div>
         </div>
         <div class="dashboard_main">
@@ -95,12 +94,12 @@
                     <div class="usage_information">
                         <div class="title">
                             <span>Usage Information</span>
-                            <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_date')">
+                            <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_rightDate')">
                                 <span class="el-dropdown-link">
                                     <span>{{rightDateName}}</span><i class="el-icon-caret-bottom el-icon--right"></i>
                                 </span>
-                                <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_date">
-                                    <el-dropdown-item v-for="item in rightDateNav" :class="{'select':item.id==district}" :command="{'key':'rightDate','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
+                                <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_rightDate">
+                                    <el-dropdown-item v-for="item in rightDateNav" :class="{'select':item.id==rightDate}" :command="{'key':'rightDate','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
                                 </el-dropdown-menu>
                             </el-dropdown>
                         </div>
@@ -110,20 +109,20 @@
                                 <p class="p2">Power</p>
                             </div> -->
                             <div class="li">
-                                <p class="p1">{{statisticInfo.electricity}}</p>
-                                <p class="p2">Electricity</p>
+                                <p class="p1" :title="statisticInfo.electricity">{{statisticInfo.electricity}}</p>
+                                <p class="p2">Electricity(Wh)</p>
                             </div>
                             <div class="li">
-                                <p class="p1">{{statisticInfo.CO2_reduction}}</p>
-                                <p class="p2">CO2 reduction</p>
+                                <p class="p1" :title="statisticInfo.CO2_reduction">{{statisticInfo.CO2_reduction}}</p>
+                                <p class="p2">CO2 reduction(Kg)</p>
                             </div>
                             <div class="li">
-                                <p class="p1">{{statisticInfo.SO2_reduction}}</p>
-                                <p class="p2">SO2 reduction</p>
+                                <p class="p1" :title="statisticInfo.SO2_reduction">{{statisticInfo.SO2_reduction}}</p>
+                                <p class="p2">SO2 reduction(g)</p>
                             </div>
                             <div class="li">
-                                <p class="p1">{{statisticInfo.TCE_reduction}}</p>
-                                <p class="p2">Tce reduction</p>
+                                <p class="p1" :title="statisticInfo.TCE_reduction">{{statisticInfo.TCE_reduction}}</p>
+                                <p class="p2">Tce reduction(Kg)</p>
                             </div>
                         </div>
                     </div>
@@ -133,17 +132,25 @@
                         <div class="text">Proportion of lights</div>
                         <div class="right_btn"> 
                             <div class="nav_box">
-                                <div class="li select"><span>Total</span></div>
-                                <div class="li"><span>Power generation</span></div>
-                                <div class="li"><span>Online</span></div>
-                                <div class="li"><span>Offline</span></div>
-                                <div class="li"><span>Fault</span></div>
+                                <div class="li" :class="{'select':chartType == '0'}" @click="chartTypeFun(0)"><span>Total</span></div>
+                                <div class="li" :class="{'select':chartType == '1'}" @click="chartTypeFun(1)"><span>Online</span></div>
+                                <div class="li" :class="{'select':chartType == '2'}" @click="chartTypeFun(2)"><span>Offline</span></div>
+                                <div class="li" :class="{'select':chartType == '3'}" @click="chartTypeFun(3)"><span>Fault</span></div>
                             </div>
                             <div class="nav_box">
-                                <div class="li"><span>Upa-City</span> <i class="iconfont icon-xialajiantou"></i></div>
+                                <el-dropdown @command="commandDropdown" trigger="click" @visible-change="commandHide('dropdown_dashboard_companyType')">
+                                    <span class="el-dropdown-link">
+                                        <span>{{companyTypeName}}</span><i class="el-icon-caret-bottom el-icon--right"></i>
+                                    </span>
+                                    <el-dropdown-menu slot="dropdown" class="scrollbar_style dropdown_dashboard_companyType">
+                                        <el-dropdown-item v-for="item in companyTypeNav" :class="{'select':item.id==companyType}" :command="{'key':'companyType','id':item.id}" :key="item.id">{{item.name}}</el-dropdown-item>
+                                    </el-dropdown-menu>
+                                </el-dropdown>
+                                <!-- <div class="li"><span>Upa-City</span> <i class="iconfont icon-xialajiantou"></i></div> -->
+
                             </div>
                             <div class="nav_box">
-                                <div class="li"><span>More</span> <i class="iconfont icon-youjiantou"></i></div>
+                                <div class="li" @click="linkToFun('/projectManagement')"><span>More</span> <i class="iconfont icon-youjiantou"></i></div>
                             </div>
                         </div>
                     </div>
@@ -171,19 +178,19 @@
                                     :show-overflow-tooltip="true"
                                     :min-width="item.minWidth">
                                     <template slot-scope="scope">
-                                        <div v-if="item.type != 1">{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</div>
-                                        <div v-if="item.prop == 'city'" class="city">
+                                        <span v-if="item.type != 1">{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
+                                        <span v-if="item.prop == 'name'" class="city">
                                             <i></i><span>{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
-                                        </div>
-                                        <div v-if="item.prop == 'total'" class="total">
+                                        </span>
+                                        <span v-if="item.prop == 'total'" class="total">
                                             <span class="span1">{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
                                             <i></i>
-                                            <span class="span2">{{scope.row['bl']}}{{item.unit?item.unit:''}}</span>
-                                        </div>
+                                            <span class="span2">{{scope.row['totalPer']}}{{item.unit?item.unit:''}}</span>
+                                        </span>
 
                                     </template>
                                 </el-table-column>
-
+<!-- 
                                 <el-table-column
                                     align="center"
                                     :width="40"
@@ -193,7 +200,7 @@
                                             <i class="iconfont icon-youjiantou"></i>
                                         </span>
                                     </template>
-                                </el-table-column>
+                                </el-table-column> -->
                             </el-table>
                         </div>
                     </div>
@@ -202,7 +209,7 @@
                     <div class="title">
                         <div class="text">Real time fault information</div>
                         <div class="right_btn">
-                            <div class="btn">
+                            <div class="btn" @click="linkToFun('/alarmMaintenance')">
                                 <span>More</span> <i class="iconfont icon-youjiantou"></i>
                             </div>
                         </div>
@@ -231,14 +238,7 @@
                                 :show-overflow-tooltip="true"
                                 :min-width="item.minWidth">
                                 <template slot-scope="scope">
-                                    <div v-if="item.type != 1">{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</div>
-                                    <div v-if="item.prop == 'division'" class="division">
-                                        <span>{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
-                                        <span>/</span>
-                                        <span>{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
-                                        <span>/</span>
-                                        <span>{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
-                                    </div>
+                                    <span v-if="item.type != 1">{{scope.row[item.prop]}}{{item.unit?item.unit:''}}</span>
 
                                 </template>
                             </el-table-column>
@@ -247,8 +247,8 @@
                                 align="center"
                                 :width="100"
                                 :label="'Operation'">
-                                <template slot-scope="scope">
-                                    <span class="btn" @click="seeFun(scope.row)" title="Edit">
+                                <template>
+                                    <span class="btn" @click="linkToFun('/alarmMaintenance')" title="See">
                                         <i class="iconfont icon-weixiu" style="color: rgba(252, 132, 64, 1)"></i>
                                     </span>
                                 </template>
@@ -281,13 +281,18 @@
                 statisticInfo:{},
                 roleArr:['','Admin','Manufacturer','Supplier','PO','Upazilla','Monitoring','Controlling'],
                 keywords:'',
-                division:'',
-                divisionNav:[{id:'0',name:'Division'}],
+                provinceId: null,
+                provinceList:[],
+                cityId:null,
+                cityList:[],
                 district:'',
-                districtNav:[{id:'0',name:'District'}],
+                companyType:'',
+                companyTypeNav:[{id:2,name:'Manufacturer'},{id:3,name:'Supplier'},{id:4,name:'PO'},{id:5,name:'Upazilla'}],
                 rightDate:'',
-                rightDateNav:[{id:'0',name:'Today'}],
+                rightDateNav:[{id:'0',name:'Today'},{id:'1',name:'Week'},{id:'2',name:'Month'},{id:'3',name:'Total'}],
                 myChart1:'',
+                chartType:0,
+                chartTypeArr:['Total','Online','Offline','Fault'],
 
                 tableShowId:'-1',
                 deviceList:[],
@@ -311,20 +316,27 @@
                 username:'username',
                 role:'role',
                 version:'version',
+                remRatio:'remRatio',
             }),
-            divisionName(){
+            provinceIdName(){
                 let name;
-                for(let d of this.divisionNav){
-                    if(d.id == this.division){
+                if(this.provinceId == null){
+                    return 'All'
+                }
+                for(let d of this.provinceList){
+                    if(d.id == this.provinceId){
                         name = d.name;
                     }
                 }
                 return name;
             },
-            districtName(){
+            cityIdName(){
                 let name;
-                for(let d of this.districtNav){
-                    if(d.id == this.district){
+                if(this.cityId == null){
+                    return 'All'
+                }
+                for(let d of this.cityList){
+                    if(d.id == this.cityId){
                         name = d.name;
                     }
                 }
@@ -339,36 +351,57 @@
                 }
                 return name;
             },
+            companyTypeName(){
+                let name;
+                for(let d of this.companyTypeNav){
+                    if(d.id == this.companyType){
+                        name = d.name;
+                    }
+                }
+                return name;
+            },
         },
         mounted(){
             this.rightDate = '0';
-            this.division = '0';
-            this.district = '0';
+            this.cityId = '0';
+            this.companyType = 2;
 
             this.deviceArr = [
-                {prop:'city',label:'City',align:'left',minWidth:70,type:1},
+                {prop:'name',label:'City',align:'left',minWidth:70,type:1},
                 {prop:'total',label:'Total',minWidth:70,type:1},
-                {prop:'power',label:'Power',minWidth:70},
-                {prop:'online',label:'On-line',minWidth:70},
-                {prop:'offline',label:'Off-line',minWidth:70},
-                {prop:'fault',label:'Fault',minWidth:70},
+                {prop:'onlineCount',label:'On-line',minWidth:70},
+                {prop:'offlineCount',label:'Off-line',minWidth:70},
+                {prop:'faultCount',label:'Fault',minWidth:70},
             ];
 
             this.faultInformationArr = [
-                {prop:'project',label:'Project',minWidth:70},
-                {prop:'division',label:'Division/District/Upazilla',minWidth:120,type:1},
-                {prop:'lightId',label:'Light ID',minWidth:70},
-                {prop:'faultType',label:'Fault type',minWidth:70},
-                {prop:'faultTime',label:'Fault time',width:160},
+                {prop:'project',label:'Project',minWidth:this.remRatio*6},
+                {prop:'location',label:'Upazilla',minWidth:this.remRatio*8},
+                {prop:'address',label:'Light ID',minWidth:this.remRatio*8},
+                {prop:'fault_type',label:'Fault type',minWidth:this.remRatio*8},
+                {prop:'fault_time',label:'Fault time',width:this.remRatio*12},
             ];
-
-            this.getData();
-            this.getSta_info();
-            this.getDev_list();
-            this.getAlarm_list();
+            this.home_get_province(()=>{
+                if(this.provinceList.length){
+                    this.provinceId = this.provinceList[0].id
+                    this.home_get_city(()=>{
+                        if(this.cityList.length){
+                            this.cityId = this.cityList[0].id
+                            this.getData();
+                            this.getSta_info();
+                            this.getDev_list();
+                            this.getAlarm_list();
+                        }else{
+                            this.cityId = null;
+                        }
+                    })
+                }else{
+                    this.provinceId = null;
+                }
+            });
 
             this.echartsMapInit();
-            this.deviceBarInit();
+            // this.deviceBarInit();
 
             // console.log(bangladesh.features)
 
@@ -559,6 +592,15 @@
             // console.log(arr);
         },
         methods:{
+            linkToFun(val){
+                if(val != this.routerStr){
+                    this.$router.push({path:val});
+                    this.$store.commit('ROUTERSTRFUN',{
+                        routerStr:val,
+                    })
+                    document.title = 'IDCOL-'+val.split('/')[1]
+                }
+            },
             commandHide(val){
                 this.$nextTick(function(){
                     if($('.'+val)&&$('.'+val+' >.select').offset()){
@@ -568,6 +610,31 @@
             },
             commandDropdown(obj){
                 this.$set(this,obj.key,obj.id)
+                if(obj.key == 'companyType'){
+                    this.getDev_list();
+                }
+                if(obj.key == 'rightDate'){
+                    this.getSta_info();
+                }
+                if(obj.key == 'provinceId'){
+                    this.home_get_city(()=>{
+                        if(this.cityList.length){
+                            this.cityId = this.cityList[0].id
+                            this.getData();
+                            this.getSta_info();
+                            this.getDev_list();
+                            this.getAlarm_list();
+                        }else{
+                            this.cityId = null;
+                        }
+                    })
+                }
+                if(obj.key == 'cityId'){
+                    this.getData();
+                    this.getSta_info();
+                    this.getDev_list();
+                    this.getAlarm_list();
+                }
             },
             /*橄榄信息*/
             getData(){
@@ -577,6 +644,8 @@
                         username:this.username,
                         token:this.token,
                         client_key:this.client_key,
+                        proId:this.provinceId,
+                        cityId:this.cityId,
                     },
                     {},
                     data => {
@@ -597,6 +666,9 @@
                         username:this.username,
                         token:this.token,
                         client_key:this.client_key,
+                        proId:this.provinceId,
+                        cityId:this.cityId,
+                        type:this.rightDate,
                     },
                     {},
                     data => {
@@ -605,6 +677,45 @@
                     this
                 )
             },
+            /*省份下拉列表*/
+            home_get_province(callback){
+                base.ajax_post(
+                    allUel.common.home_get_province,
+                    {
+                        username:this.username,
+                        token:this.token,
+                        client_key:this.client_key,
+                    },
+                    {},
+                    data => {
+                        this.provinceList = data.data.list;
+                        if(callback){
+                            callback()
+                        }
+                    },
+                    this
+                )
+            },
+            /*城市下拉*/
+            home_get_city(callback){
+                base.ajax_post(
+                    allUel.common.home_get_city,
+                    {
+                        username:this.username,
+                        token:this.token,
+                        client_key:this.client_key,
+                        proId:this.provinceId,
+                    },
+                    {},
+                    data => {
+                        this.cityList = data.data.list;
+                        if(callback){
+                            callback()
+                        }
+                    },
+                    this
+                )
+            },
             /*设备列表*/
             getDev_list(){
                 base.ajax_post(
@@ -613,10 +724,14 @@
                         username:this.username,
                         token:this.token,
                         client_key:this.client_key,
+                        proId:this.provinceId,
+                        cityId:this.cityId,
+                        type:this.companyType
                     },
                     {},
                     data => {
                         this.deviceList = data.data.list;
+                        this.deviceBarInit(this.deviceList,this.chartType);
                     },
                     this
                 )
@@ -629,10 +744,12 @@
                         username:this.username,
                         token:this.token,
                         client_key:this.client_key,
+                        proId:this.provinceId,
+                        cityId:this.cityId,
                     },
                     {},
                     data => {
-                        this.alarmList = data.data;
+                        this.alarmList = data.data.list;
                         let i = 1;
                         for(let d of this.alarmList){
                             d.webIndex = i;
@@ -641,15 +758,6 @@
                     },
                     this
                 )
-            },
-            /*设备列表*/
-            getLightListKeyUp(e){
-                if(e.key == 'Enter'){
-                  this.getLightList();
-                }
-            },
-            getLightList(){
-
             },
             tableEnter(data){
               this.tableShowId = data.id;
@@ -657,6 +765,12 @@
             tableLeave(){
               this.tableShowId = '-1';
             },
+            chartTypeFun(val){
+                if(val != this.chartType){
+                    this.chartType = val;
+                    this.deviceBarInit(this.deviceList,this.chartType);
+                }
+            },
             echartsMapInit(){
                 this.$nextTick(function(){
                     if(document.getElementsByClassName('echarts_map')[0]){
@@ -718,18 +832,32 @@
                     }
                 })
             },
-            deviceBarInit(){
+            deviceBarInit(data,type){
+                console.log(data,type)
+                if(this.myChart2){
+                    this.myChart2.dispose()
+                }
                 if(document.getElementsByClassName('device_pie')[0]){
-                    let seriesData = [
-                        {name: '1',value: Math.round(Math.random() * 100),itemStyle:{color:'#FF6474'}},
-                        {name: '2',value: Math.round(Math.random() * 100),itemStyle:{color:'#FC8440'}},
-                        {name: '3',value: Math.round(Math.random() * 100),itemStyle:{color:'#FFA8B1'}},
-                        {name: '4',value: Math.round(Math.random() * 100),itemStyle:{color:'#FFCFD4'}},
-                        {name: '5',value: Math.round(Math.random() * 100),itemStyle:{color:'#FFD86F'}},
-                        {name: '6',value: Math.round(Math.random() * 100),itemStyle:{color:'#FFC936'}},
-                        {name: '7',value: Math.round(Math.random() * 100),itemStyle:{color:'#ADC6FF'}},
-                        {name: '8',value: Math.round(Math.random() * 100),itemStyle:{color:'#1D7DFD'}},
-                    ];
+                    let colorArr = ['#FF6474','#FC8440','#FFA8B1','#FFCFD4','#FFD86F','#FFC936','#ADC6FF','#1D7DFD'];
+                    let seriesData = [];
+                    let i = 0;
+                    if(data.length>0){
+                        for(let d of data){
+                            if(type == 0){
+                                seriesData.push({name: d.name,value: d.total,itemStyle:{color:colorArr[i]}})
+                            }
+                            if(type == 1){
+                                seriesData.push({name: d.name,value: d.onlineCount,itemStyle:{color:colorArr[i]}})
+                            }
+                            if(type == 2){
+                                seriesData.push({name: d.name,value: d.offlineCount,itemStyle:{color:colorArr[i]}})
+                            }
+                            if(type == 3){
+                                seriesData.push({name: d.name,value: d.faultCount,itemStyle:{color:colorArr[i]}})
+                            }
+                            i++;
+                        }
+                    }
                     this.myChart2 = echarts.init(document.getElementsByClassName('device_pie')[0]);
                     this.myChart2.setOption({
                         tooltip: {
@@ -1176,7 +1304,7 @@
                             margin-top: 1.5rem;
                             .li{
                                 border-right:0.1rem solid rgba(240,240,240,1);
-                                flex: 1;
+                                width: 25%;
                                 text-align:center;
                                 &:last-child{
                                     border:none;
@@ -1187,6 +1315,10 @@
                                     font-family:PingFang-SC-Heavy,PingFang-SC;
                                     font-weight:800;
                                     color:rgba(51,51,51,1);
+                                    line-height:2.5rem;
+                                    overflow: hidden;
+                                    text-overflow:ellipsis;
+                                    white-space: nowrap;
                                 }
                                 .p2{
                                     font-size:1rem;
@@ -1256,6 +1388,13 @@
                                     color:rgba(255,255,255,1);
                                 }
                             }
+                            .el-dropdown-link{
+                                font-size:1rem;
+                                font-family:PingFang-SC-Medium,PingFang-SC;
+                                font-weight:500;
+                                color:rgba(101,112,133,1);
+                                cursor: pointer;
+                            }
                         }
                     }
                     .proportion_lights_main{
@@ -1390,6 +1529,7 @@
                                     font-family:PingFangSC-Medium,PingFang SC;
                                     font-weight:500;
                                     color:rgba(51,51,51,1);
+                                    padding: 0 0.5rem;
                                 }
                             }
                             tr:hover>td{