|
@@ -1295,7 +1295,6 @@
|
|
|
},1000)
|
|
|
}
|
|
|
|
|
|
- // this.getProjectNav('lamp')
|
|
|
// this.getProjectCompany
|
|
|
}else{
|
|
|
if(this.browserLanguage == 'bd'){
|
|
@@ -1307,7 +1306,6 @@
|
|
|
},1000)
|
|
|
}
|
|
|
// this.projectInfo(0);
|
|
|
- // this.getProjectNav()
|
|
|
}
|
|
|
AMap.mapSwitch=function(){
|
|
|
};
|
|
@@ -2188,20 +2186,22 @@
|
|
|
},
|
|
|
sectionNavGet(id,obj){
|
|
|
// console.log(id,obj)
|
|
|
- baseApi.ajax_post(
|
|
|
- allUrl.gisMap.section_nav,
|
|
|
- {
|
|
|
- username:this.username,
|
|
|
- client_key:this.client_key,
|
|
|
- token:this.token,
|
|
|
- projectid:id,
|
|
|
- },
|
|
|
- {},
|
|
|
- data =>{
|
|
|
- this.$set(obj,'roadList',data.data.list)
|
|
|
- // console.log(data)
|
|
|
- },
|
|
|
- this)
|
|
|
+ if(id){
|
|
|
+ baseApi.ajax_post(
|
|
|
+ allUrl.gisMap.section_nav,
|
|
|
+ {
|
|
|
+ username:this.username,
|
|
|
+ client_key:this.client_key,
|
|
|
+ token:this.token,
|
|
|
+ projectid:id,
|
|
|
+ },
|
|
|
+ {},
|
|
|
+ data =>{
|
|
|
+ this.$set(obj,'roadList',data.data.list)
|
|
|
+ // console.log(data)
|
|
|
+ },
|
|
|
+ this)
|
|
|
+ }
|
|
|
},
|
|
|
lampInfoGet(id){
|
|
|
this.lampId = id;
|
|
@@ -2347,19 +2347,21 @@
|
|
|
this.isShowLampStatusList=false
|
|
|
},
|
|
|
dateNav(){
|
|
|
- baseApi.ajax_post(
|
|
|
- allUrl.gisMap.dateNav,
|
|
|
- {
|
|
|
- username:this.username,
|
|
|
- client_key:this.client_key,
|
|
|
- token:this.token,
|
|
|
- project_id:this.projectId,
|
|
|
- },
|
|
|
- {},
|
|
|
- data =>{
|
|
|
- this.topDataNav =data.data;
|
|
|
- },
|
|
|
- this)
|
|
|
+ if(this.projectId){
|
|
|
+ baseApi.ajax_post(
|
|
|
+ allUrl.gisMap.dateNav,
|
|
|
+ {
|
|
|
+ username:this.username,
|
|
|
+ client_key:this.client_key,
|
|
|
+ token:this.token,
|
|
|
+ project_id:this.projectId,
|
|
|
+ },
|
|
|
+ {},
|
|
|
+ data =>{
|
|
|
+ this.topDataNav =data.data;
|
|
|
+ },
|
|
|
+ this)
|
|
|
+ }
|
|
|
},
|
|
|
/*捕虫器开关*/
|
|
|
catcherOnOff(){
|
|
@@ -2414,59 +2416,6 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- /*获取公司项目列表*/
|
|
|
- getProjectNav(type){
|
|
|
- baseApi.ajax_post(
|
|
|
- allUrl.device.projectNav,
|
|
|
- {
|
|
|
- username:this.username,
|
|
|
- client_key:this.client_key,
|
|
|
- token:this.token,
|
|
|
- },
|
|
|
- {},
|
|
|
- data =>{
|
|
|
- // console.log(data,'公司列表')
|
|
|
- this.projectNav = data.data;
|
|
|
-
|
|
|
- var storage = window.localStorage;
|
|
|
- let projectId = storage.getItem("projectId");
|
|
|
- this.companyId = storage.getItem("companyId");
|
|
|
- for(var key in data.data){
|
|
|
- this.$set(data.data[key],'type','Unfold')
|
|
|
- if(data.data[key].project_list){
|
|
|
- for(var d of data.data[key].project_list){
|
|
|
- this.$set(d,'companyId',data.data[key].id)
|
|
|
- }
|
|
|
- }
|
|
|
- if(type){
|
|
|
- console.log(type)
|
|
|
- }else{
|
|
|
- if(this.companyId != 'false' && this.companyId){
|
|
|
- if(data.data[key].id == this.companyId){
|
|
|
- this.$set(data.data[key],'type','Collapse')
|
|
|
- this.projectId = projectId;
|
|
|
- }
|
|
|
- }else{
|
|
|
- this.projectId = 0;
|
|
|
- this.companyId = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for(let d of this.projectNav){
|
|
|
- if(d.id == this.companyId){
|
|
|
- for(let dd of d.project_list){
|
|
|
- if(dd.id == this.projectId){
|
|
|
- this.$set(dd,'isOpen',true);
|
|
|
- this.sectionNavGet(dd.id,dd)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.dateNav();
|
|
|
- this.lampListGet(1);
|
|
|
- },
|
|
|
- this)
|
|
|
- },
|
|
|
/*侧栏列表*/
|
|
|
sideBarCompanyList(val,type,init){
|
|
|
baseApi.ajax_post(
|
|
@@ -2492,7 +2441,7 @@
|
|
|
}else{
|
|
|
this.projectId = data.data[0].id;
|
|
|
}
|
|
|
- this.sectionNavGet(data.data[0].id,data.data[0])
|
|
|
+ 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){
|
|
@@ -2505,26 +2454,29 @@
|
|
|
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;
|
|
|
+ for(let d of data.data){
|
|
|
+ if(d.cId == companyId){
|
|
|
+ if(d.projectList.length>0){
|
|
|
+ if(projectId){
|
|
|
+ this.projectId = projectId;
|
|
|
+ }else{
|
|
|
+ this.projectId = d.projectList[0].id;
|
|
|
+ }
|
|
|
+ this.sectionNavGet(d.id,data.data[0])
|
|
|
+ }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;
|
|
|
+ }
|
|
|
}
|
|
|
- // this.$set(data.data[0].projectList[0],'isOpen',true)
|
|
|
- this.sectionNavGet(data.data[0].id,data.data[0])
|
|
|
- }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;
|
|
@@ -2768,37 +2720,39 @@
|
|
|
}
|
|
|
},
|
|
|
lampListGet(val,callback){
|
|
|
- baseApi.ajax_post(
|
|
|
- allUrl.gisMap.lampList,
|
|
|
- {
|
|
|
- username:this.username,
|
|
|
- client_key:this.client_key,
|
|
|
- token:this.token,
|
|
|
- project_id:this.projectId,
|
|
|
- section:this.roadId,
|
|
|
- type:this.operationType,
|
|
|
- keyword:this.keyword,
|
|
|
- page:val,
|
|
|
- count:16,
|
|
|
- },
|
|
|
- {},
|
|
|
- data =>{
|
|
|
- if(callback){
|
|
|
- callback(data)
|
|
|
- }
|
|
|
- // console.log(data)
|
|
|
- this.streetLampList = data.data.lamps;
|
|
|
- this.lampListTotal = data.data.total;
|
|
|
- this.lampListPage = 1;
|
|
|
- for(let d of this.streetLampList){
|
|
|
- if(d.status == '1'){
|
|
|
- d.runState = 'Lamp on'
|
|
|
- }else{
|
|
|
- d.runState = 'Lamp off'
|
|
|
+ if(this.projectId){
|
|
|
+ baseApi.ajax_post(
|
|
|
+ allUrl.gisMap.lampList,
|
|
|
+ {
|
|
|
+ username:this.username,
|
|
|
+ client_key:this.client_key,
|
|
|
+ token:this.token,
|
|
|
+ project_id:this.projectId,
|
|
|
+ section:this.roadId,
|
|
|
+ type:this.operationType,
|
|
|
+ keyword:this.keyword,
|
|
|
+ page:val,
|
|
|
+ count:16,
|
|
|
+ },
|
|
|
+ {},
|
|
|
+ data =>{
|
|
|
+ if(callback){
|
|
|
+ callback(data)
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- this)
|
|
|
+ // console.log(data)
|
|
|
+ this.streetLampList = data.data.lamps;
|
|
|
+ this.lampListTotal = data.data.total;
|
|
|
+ this.lampListPage = 1;
|
|
|
+ for(let d of this.streetLampList){
|
|
|
+ if(d.status == '1'){
|
|
|
+ d.runState = 'Lamp on'
|
|
|
+ }else{
|
|
|
+ d.runState = 'Lamp off'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ this)
|
|
|
+ }
|
|
|
},
|
|
|
contextmenuFun(e){
|
|
|
// console.log(e,1)
|