XAWDJ0277HWXPT2\Administrator 5 سال پیش
والد
کامیت
89f973cfdf

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/index.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
web/js/app.b981fa0b.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/js/app.b981fa0b.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 2
web/js/chunk-a80ca5cc.0ddb106a.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1
web/js/chunk-a80ca5cc.0ddb106a.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 0
web/js/chunk-a80ca5cc.d2f269a4.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
web/js/chunk-a80ca5cc.d2f269a4.js.map


+ 3 - 1
webConfig/src/api/allUel.js

@@ -30,11 +30,13 @@ const urls={
 
        lampcontrolGet:'https://120.77.179.55/api/lampcontrol/get',/*设备列表*/
        lampcontrolSave:'https://120.77.179.55/api/lampcontrol/save',/*添加编辑设备*/
-       lampcontrolDel:'https://120.77.179.55/api/lampcontrol/del',/*添加编辑设备*/
+       lampcontrolDel:'https://120.77.179.55/api/lampcontrol/del',/*删除设备*/
+       lampcontrolTurnonoff:'https://120.77.179.55/api/lampcontrol/turnonoff',/*开关灯*/
        // lampcontrolDetail:'https://120.77.179.55/api/lampcontrol/detail',/*设备详情*/
        lampcontrolViewloglist:'https://120.77.179.55/api/lampcontrol/viewloglist',/*设备数据*/
        lampcontrolHistorylist:'https://120.77.179.55/api/lampcontrol/historylist',/*设备历史数据*/
        lampHistoryData:'https://120.77.179.55/api/lampcontrol/lamp_history_data',/*设备历史数据*/
+       
 
         workmode:'https://120.77.179.55/api/common/workmode',/*路灯负载模式下拉列表*/
         loadSetting:'https://120.77.179.55/api/lampcontrol/load_setting',/*读取灯控负载设置*/

+ 40 - 11
webConfig/src/store/node.js

@@ -113,6 +113,8 @@ function writeJson(params){
                             let x2 = false;
                             let y1 = false;
                             let y2 = false;
+                            let xk = false;
+                            let yk = 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){
@@ -124,22 +126,49 @@ function writeJson(params){
                                         }
                                         x2 = Number(key);
                                         y2 = Number(j);
+                                        if(!yk&&y1!=y2){
+                                            yk = y2-y1>0?'+':'-'
+                                        }
+                                        if(!xk&&x1!=x2){
+                                            xk = x2-x1>0?'+':'-'
+                                        }
                                         break;
                                     }
                                 }
                             }
                             if(x1||x2||y1||y2){
-                                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)))
+                                console.log(x1,x2,xk,y1,y2,yk)
+                                if(yk == '-'){
+                                    if(y2>y1){
+                                        arr2 = d.geometry.coordinates[0][0].slice(y1,y2)
+                                    }else{
+                                        arr2 = d.geometry.coordinates[0][0].slice(y1,d.geometry.coordinates[0][0].length-1)
+                                        arr2.push(...(d.geometry.coordinates[0][0].slice(0,y2)))
+                                    }
                                 }else{
-                                    arr2 = d.geometry.coordinates[0][0].slice(y2,y1)
+                                    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)))
+                                    }else{
+                                        arr2 = d.geometry.coordinates[0][0].slice(y2,y1)
+                                    }
+
                                 }
-                                if(x2>x1){
-                                    item.geometry.coordinates[0][0].splice(x1,x2-x1,...arr2)
+                                if(xk == '-'){
+                                    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)
+                                    }else{
+                                        item.geometry.coordinates[0][0].splice(x2,x1-x2,...arr2)
+                                    }
                                 }else{
-                                    item.geometry.coordinates[0][0].splice(x1,item.geometry.coordinates[0][0]-1-x1)
-                                    item.geometry.coordinates[0][0].splice(0,x2,...arr2)
+                                    if(x2>x1){
+                                        item.geometry.coordinates[0][0].splice(x1,x2-x1,...arr2)
+                                    }else{
+                                        item.geometry.coordinates[0][0].splice(x1,item.geometry.coordinates[0][0]-1-x1)
+                                        item.geometry.coordinates[0][0].splice(0,x2,...arr2)
+                                    }
+
                                 }
                                 number++;
                                 console.log('已筛选 '+number+' '+d.properties.Upaz_name+'-------------2---------');
@@ -208,7 +237,7 @@ function writeJson(params){
                 
             }
         }
-        // for(let provinceName of provinceNameArr){
+        for(let provinceName of provinceNameArr){
             for(let name of cityName['Barisal']){
                 let item = {
                     type: "Feature",
@@ -224,8 +253,8 @@ function writeJson(params){
                 number = 0;
                 fun(bangladesh.features,'Barisal',name,item)
             }
-            // fun(bangladesh.features,'Barisal','Bhola',item)
-        // }
+            // fun(bangladesh.features,'Barisal','Pirojpur',item)
+        }
         // fun(bangladesh.features,'Khulna')
         // console.log(cityName)
 

+ 1 - 1
webConfig/src/views/dashboard.vue

@@ -68,7 +68,7 @@
                         <div class="light_information_left">
                             <div class="title">Light Information</div>
                             <p class="p1">{{infoData.total_light_count}}</p>
-                            <p class="p2"><span class="span1">Total-light</span><i class="iconfont icon-shangsheng"></i><span class="span2">{{infoData.day_new_count_percent}}%</span></p>
+                            <p class="p2"><span class="span1">Total-light</span><i class="iconfont icon-shangsheng"></i><span class="span2">{{Number(infoData.day_new_count_percent).toFixed(1)}}%</span></p>
                         </div>
                         <div class="light_information_right">
                             <div class="data_ul">

+ 110 - 122
webConfig/src/views/projectManagement.vue

@@ -2059,34 +2059,38 @@
                     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.getProjectData(data.data[0].id)
-                                    this.getFields();
-                                    this.networkGet();
-                                    for(let key in data.data){
-                                        this.$set(data.data[key],'isOpen',false)
+                                }
+                                this.getProjectData(this.projectId)
+                                this.getFields();
+                                this.networkGet();
+                                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.getProjectData(this.projectId)
                                         this.getFields();
                                         this.networkGet();
@@ -2104,53 +2108,14 @@
                                         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.getProjectData(data.data[0].id)
-                                    this.getFields();
-                                    this.networkGet();
-                                    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.getProjectData(this.projectId)
                                         this.getFields();
                                         this.networkGet();
                                     }else{
-                                        this.projectId = null;
                                         this.projectId = null;
                                         this.deviceTotalData = {
                                             light_num:0,
@@ -2163,20 +2128,34 @@
                                         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)
@@ -2214,9 +2193,9 @@
                 }else{
                     this.$set(data,'isOpen',false)
                 }
-                console.log(type,data)
+                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);
@@ -2278,6 +2257,9 @@
                 }
             },
             batchProcessingFun(type){
+                if(this.loading.batchProcessingFun){
+                    return
+                }
                 let lampIds = '';
                 if(type == 'on'){
                     this.lampcontrolOperationType = '-1';
@@ -2336,7 +2318,7 @@
                                 if(oldBoolean){
                                     this.lampProtocoltype = '0';
                                     baseApi.ajax_post(
-                                        allUrl.device.workmode,
+                                        allUrl.project.workmode,
                                         {
                                             username:this.username,
                                             client_key:this.client_key,
@@ -2452,7 +2434,7 @@
                             }
                             this_.loading.batchProcessingFun = true;
 
-                            baseApi.websocket1(allUrl.home.wss,data=>{
+                            baseApi.websocket1(allUrl.websocket.wss,data=>{
                                 if(data.data.status == '1'){
                                     baseApi.ajax_post_ws(
                                         allUrl.gisMap.lampcontrolDimming,
@@ -2490,7 +2472,7 @@
                                         if(i >= ids_length){
                                             this_.loading.batchProcessingFun = false;
                                             this_.batchProcessing = type;
-                                            this_.getData(this_.currentPage);
+                                            this_.getLightList(this_.currentPage);
                                             websocket.close();
                                         }
                                     }else{
@@ -2509,7 +2491,7 @@
                                         if(i >= ids_length){
                                             this_.loading.batchProcessingFun = false;
                                             this_.batchProcessing = type;
-                                            this_.getData(this_.currentPage);
+                                            this_.getLightList(this_.currentPage);
                                             websocket.close();
                                         }
                                     }
@@ -2556,30 +2538,23 @@
                                       type: 'success'
                                     });
                                     this.batchProcessing = type;
-                                    this.getData(this.currentPage);
+                                    this.getLightList(this.currentPage);
                                     this.networkSectionList();
                                     this.loading.batchProcessingFun = false;
                                 },
                               this)
                             }).catch(() => {
-                                if(this.version == 0){
-                                  this.$message({
-                                    type: 'info',
-                                    message: this.version == 0?'已取消删除':'Canceled deleting'
-                                  });          
-                                }else{
-                                  this.$message({
+                                this.$message({
                                     type: 'info',
                                     message: 'Undeleted'
-                                  });   
-                                }
+                                });
                             });
                         }
                     }else if(this.lampcontrolOperationType == '-1'){
                         if(this.version == 0){
                             this.$message({
                               showClose: true,
-                              message:this.version == 0?'请先选中修改类型':'Please select the modified type first',
+                              message:'Please select the modified type first',
                               type: 'warning'
                             });
                         }else{
@@ -2593,7 +2568,7 @@
                         if(this.multipleSelection.length == 0){
                             this.$message({
                               showClose: true,
-                              message:this.version==0?'请先选中灯控':'Please select the light control first',
+                              message:'Please select the light control first',
                               type: 'warning'
                             });
                         }else{
@@ -2620,9 +2595,9 @@
                                       message:data.msg,
                                       type: 'success'
                                     });
-                                    this.policyName = this.version=='0'?'策略':'policy'
+                                    this.policyName = 'policy'
                                     this.batchProcessing = type;
-                                    this.getData(this.currentPage);
+                                    this.getLightList(this.currentPage);
                                     this.loading.batchProcessingFun = false;
                                 },
                             this)
@@ -2632,7 +2607,7 @@
                         if(this.multipleSelection.length == 0){
                             this.$message({
                               showClose: true,
-                              message:this.version==0?'请先选中灯控':'Please select the light control first',
+                              message:'Please select the light control first',
                               type: 'warning'
                             });
                         }else{
@@ -2652,11 +2627,11 @@
                                     ids+=','+d.id;
                                 }
                             }
-                            baseApi.websocket1(allUrl.home.wss,(data,websocket)=>{
+                            baseApi.websocket1(allUrl.websocket.wss,(data,websocket)=>{
                                 this_.loading.batchProcessingFun = true;
                                 if(data.data.status == '1'){
                                     baseApi.ajax_post_ws(
-                                        allUrl.device.lampcontrolTurnonoff,
+                                        allUrl.project.lampcontrolTurnonoff,
                                         {
                                             username:this_.username,
                                             client_key:this_.client_key,
@@ -2668,17 +2643,17 @@
                                         },
                                         this_
                                     )
-                                }else if(data.data.status == '2'){
-                                    if(data.data.code == '0000'){
+                                }else if(data.status == '2'){
+                                    if(data.code == '0000'){
                                         this_.$notify({
-                                          title: this_.version==0?'操作成功':'Successful operation',
-                                          message: this_.version==0?'路灯 '+data.data.data.number:'lamp '+data.data.data.number,
+                                          title: 'Successful operation',
+                                          message: 'lamp '+data.data.number,
                                           type: 'success'
                                         });
                                         this_.giveCommandJournal.push({
                                             time:this_.GMTToZero2(new Date()),
-                                            text:data.data.msg,
-                                            number:data.data.data.number,
+                                            text:data.msg,
+                                            number:data.data.number,
                                             type:true
                                         })
                                         i++;
@@ -2687,26 +2662,18 @@
                                         if(i >= ids_length){
                                             this_.loading.batchProcessingFun = false;
                                             this_.batchProcessing = type;
-                                            this_.getData(this_.currentPage);
+                                            this_.getLightList(this_.currentPage);
                                             websocket.close();
                                         }
                                     }else{
-                                        console.log(2,'--------')
-                                        if(this_.version == 0){
-                                            this_.$notify.error({
-                                              title: '操作失败',
-                                              message: this_.version==0?'路灯 '+data.data.data.number+':'+data.data.msg:'lamp '+data.data.data.number+':'+data.data.msg
-                                            });
-                                        }else{
-                                            this_.$notify.error({
-                                              title: 'operation failed',
-                                              message: 'Lamp'+data.data.data.number+':'+data.data.msg
-                                            });
-                                        }
+                                        this_.$notify.error({
+                                          title: 'operation failed',
+                                          message: 'Lamp'+data.data.number+':'+data.msg
+                                        });
                                         this_.giveCommandJournal.push({
                                             time:this_.GMTToZero2(new Date()),
-                                            text:data.data.msg,
-                                            number:data.data.data.number,
+                                            text:data.msg,
+                                            number:data.data.number,
                                             type:false
                                         })
                                         i++;
@@ -2715,7 +2682,7 @@
                                         if(i >= ids_length){
                                             this_.loading.batchProcessingFun = false;
                                             this_.batchProcessing = type;
-                                            this_.getData(this_.currentPage);
+                                            this_.getLightList(this_.currentPage);
                                             websocket.close();
                                         }
                                     }
@@ -2727,6 +2694,18 @@
                     }
                 }
             },
+            GMTToZero2(time){
+                let now = new Date(time);
+                let hour = now.getHours();//得到小时
+                let minu = now.getMinutes();//得到分钟
+                let sec = now.getSeconds();//得到秒
+                if (hour < 10) hour = "0" + hour;
+                if (minu < 10) minu = "0" + minu;
+                if (sec < 10) sec = "0" + sec;
+                let times = "";
+                times = hour + ":" + minu + ":" + sec;
+                return times
+            },
             /*获取表格字段*/
             getFields(){
                 baseApi.ajax_post(
@@ -5240,7 +5219,7 @@
                                 .el-slider{
                                     position: relative;
                                     top: 0;
-                                    width: 8rem;
+                                    width: 5rem;
                                     .el-slider__runway{
                                         margin: 0.7rem 0 0.7rem 1rem;
                                         height: 0.6rem;
@@ -5292,6 +5271,15 @@
                                     color: #666666;
                                 }
                             }
+                            .el-loading-spinner{
+                                height: 100%;
+                                top: 0;
+                                margin-top: 0;
+                                .circular{
+                                    height: 100%;
+                                    width: 100%;
+                                }
+                            }
                         }
                     }
                     .table_top_r{