|
@@ -34,7 +34,7 @@
|
|
|
<p class="p"><i class="iconfont icon-dizhi"></i><span class="span2">{{detailData.location}}</span></p>
|
|
|
<div class="data_bpx">
|
|
|
<div class="li">
|
|
|
- <p class="p1">{{Number(deviceTotalData.light_num).formatNumberRgx()}}</p>
|
|
|
+ <p class="p1">{{Number(deviceTotalData.total).formatNumberRgx()}}</p>
|
|
|
<p class="p2">Lights</p>
|
|
|
</div>
|
|
|
<div class="li">
|
|
@@ -240,7 +240,7 @@
|
|
|
<span class="btn" @click="gisFun(scope.row,'GIS')" title="GIS">
|
|
|
<i class="iconfont icon-GIS"></i>
|
|
|
</span>
|
|
|
- <span class="btn" @click="monitorFun(scope.row)" title="Weather">
|
|
|
+ <span class="btn" @click="monitorFun(scope.row)" title="Parameter">
|
|
|
<i class="iconfont icon-canshu"></i>
|
|
|
</span>
|
|
|
</template>
|
|
@@ -281,8 +281,8 @@
|
|
|
</div>
|
|
|
<div class="div2">
|
|
|
<div>
|
|
|
- <span>{{'brightness'}}: {{lampLightSlider}}%</span>
|
|
|
- <span @click="lampLightSliderSave()" v-loading="loading.lampLightSlider">{{'save'}}</span>
|
|
|
+ <span>{{'Brightness'}}: {{lampLightSlider}}%</span>
|
|
|
+ <span @click="lampLightSliderSave()" v-loading="loading.lampLightSlider">{{'Save'}}</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-slider v-model="lampLightSlider"></el-slider>
|
|
@@ -1002,6 +1002,7 @@
|
|
|
online_num:0,
|
|
|
fault_count:0,
|
|
|
network_num:0,
|
|
|
+ total:0,
|
|
|
},
|
|
|
|
|
|
/*侧边栏*/
|
|
@@ -1820,6 +1821,7 @@
|
|
|
role:'role',
|
|
|
remRatio:'remRatio',
|
|
|
sideBarCompanyType:'sideBarCompanyType',
|
|
|
+ browserLanguage:'browserLanguage',
|
|
|
}),
|
|
|
historicalNavListENFor(){
|
|
|
let list = [];
|
|
@@ -2108,6 +2110,7 @@
|
|
|
}
|
|
|
if(downloadVal == 0){
|
|
|
this.deviceTotalData = data.data.total_data;
|
|
|
+ this.deviceTotalData.total = data.data.total;
|
|
|
this.deviceList = data.data.lamps;
|
|
|
let i = (this.currentPage - 1)*this.pageSize+1;
|
|
|
for(let d of this.deviceList){
|
|
@@ -3583,85 +3586,139 @@
|
|
|
let WDstr = '';
|
|
|
JDstr = 'longitude';
|
|
|
WDstr = 'latitude';
|
|
|
-
|
|
|
let lat = 0;
|
|
|
let lng = 0;
|
|
|
- if(!isNaN(this.lampLongitude) && !isNaN(this.lampLatitude) &&!(this.lampLongitude ==0 &&this.lampLongitude ==0)){
|
|
|
- let bd_decrypt = this.bd_decrypt(this.lampLongitude,this.lampLatitude)
|
|
|
- this.lampLatitude = Number(bd_decrypt.lat.toFixed(8));
|
|
|
- this.lampLongitude = Number(bd_decrypt.lng.toFixed(8));
|
|
|
- console.log(this.lampLatitude,this.lampLongitude,'----s')
|
|
|
- lat = bd_decrypt.lat;
|
|
|
- lng = bd_decrypt.lng;
|
|
|
- this_.mapDWIsTrue = false;
|
|
|
- this.map = new google.maps.Map(document.getElementById('lampAmapWrapper'), {
|
|
|
- center:{lat: this.lampLatitude, lng: this.lampLongitude},
|
|
|
- zoom: 16,
|
|
|
- gestureHandling: 'greedy',
|
|
|
- streetViewControl:false,
|
|
|
- mapTypeControlOptions:{
|
|
|
- style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,
|
|
|
- position:google.maps.ControlPosition.RIGHT_TOP
|
|
|
- },
|
|
|
- mapTypeId:google.maps.MapTypeId.ROADMAP,
|
|
|
- });
|
|
|
- // console.log('---------1',lat,lng)
|
|
|
- }else{
|
|
|
- this_.mapDWIsTrue = true;
|
|
|
- this.map = new google.maps.Map(document.getElementById('lampAmapWrapper'), {
|
|
|
- center:{lat: 0, lng: 0},
|
|
|
- zoom: 16,
|
|
|
- gestureHandling: 'greedy',
|
|
|
- streetViewControl:false,
|
|
|
- mapTypeControlOptions:{
|
|
|
- style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,
|
|
|
- position:google.maps.ControlPosition.RIGHT_TOP
|
|
|
- },
|
|
|
- mapTypeId:google.maps.MapTypeId.ROADMAP,
|
|
|
- });
|
|
|
- }
|
|
|
- // console.log(Number(lat),Number(lng))
|
|
|
- this.geocoder = new google.maps.Geocoder();
|
|
|
- let bgColor = 'linear-gradient(#fc8440, #fe7121)';
|
|
|
- let borderColor = 'rgba(253, 122, 48, 0.18)';
|
|
|
- this_.positionPicker = new RichMarker({
|
|
|
- position:new google.maps.LatLng(Number(lat),Number(lng)),
|
|
|
- map: this_.map,
|
|
|
- draggable: true,
|
|
|
- content:'<div class="lm_img_mover" style="text-align:center;border:11px solid '+borderColor+'; border-radius:50%;cursor:pointer;"><div style="text-align:center;background:'+bgColor+';background-clip: padding-box;border:2px solid #fff; height: 16px; width: 16px; border-radius:50%;"></div></div>'
|
|
|
- })
|
|
|
- var controlDiv = document.createElement('DIV');
|
|
|
- controlDiv.className = "google_Location_box"
|
|
|
- var controlUI = document.createElement('DIV');
|
|
|
- controlUI.className = "google_Location"
|
|
|
- controlDiv.appendChild(controlUI);
|
|
|
- var svg = document.createElementNS('http://www.w3.org/2000/svg','svg');
|
|
|
- svg.setAttribute('viewBox','25 25 50 50');
|
|
|
- svg.setAttribute('class','circular');
|
|
|
- svg.setAttribute('styel','display:none');
|
|
|
- var circle = document.createElementNS('http://www.w3.org/2000/svg','circle');
|
|
|
- circle.setAttribute('cx','50');
|
|
|
- circle.setAttribute('cy','50');
|
|
|
- circle.setAttribute('r','20');
|
|
|
- circle.setAttribute('fill','none');
|
|
|
- circle.setAttribute('class','path');
|
|
|
+ console.log(this.browserLanguage)
|
|
|
+ if(this.browserLanguage == 'google'){
|
|
|
+ if(!isNaN(this.lampLongitude) && !isNaN(this.lampLatitude) &&!(this.lampLongitude ==0 &&this.lampLongitude ==0)){
|
|
|
+ let bd_decrypt = this.bd_decrypt(this.lampLongitude,this.lampLatitude)
|
|
|
+ this.lampLatitude = Number(bd_decrypt.lat.toFixed(8));
|
|
|
+ this.lampLongitude = Number(bd_decrypt.lng.toFixed(8));
|
|
|
+ console.log(this.lampLatitude,this.lampLongitude,'----s')
|
|
|
+ lat = bd_decrypt.lat;
|
|
|
+ lng = bd_decrypt.lng;
|
|
|
+ this_.mapDWIsTrue = false;
|
|
|
+ this.map = new google.maps.Map(document.getElementById('lampAmapWrapper'), {
|
|
|
+ center:{lat: this.lampLatitude, lng: this.lampLongitude},
|
|
|
+ zoom: 16,
|
|
|
+ gestureHandling: 'greedy',
|
|
|
+ streetViewControl:false,
|
|
|
+ mapTypeControlOptions:{
|
|
|
+ style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,
|
|
|
+ position:google.maps.ControlPosition.RIGHT_TOP
|
|
|
+ },
|
|
|
+ mapTypeId:google.maps.MapTypeId.ROADMAP,
|
|
|
+ });
|
|
|
+ // console.log('---------1',lat,lng)
|
|
|
+ }else{
|
|
|
+ this_.mapDWIsTrue = true;
|
|
|
+ this.map = new google.maps.Map(document.getElementById('lampAmapWrapper'), {
|
|
|
+ center:{lat: 0, lng: 0},
|
|
|
+ zoom: 16,
|
|
|
+ gestureHandling: 'greedy',
|
|
|
+ streetViewControl:false,
|
|
|
+ mapTypeControlOptions:{
|
|
|
+ style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,
|
|
|
+ position:google.maps.ControlPosition.RIGHT_TOP
|
|
|
+ },
|
|
|
+ mapTypeId:google.maps.MapTypeId.ROADMAP,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // console.log(Number(lat),Number(lng)
|
|
|
+ this.geocoder = new google.maps.Geocoder();
|
|
|
+ let bgColor = 'linear-gradient(#fc8440, #fe7121)';
|
|
|
+ let borderColor = 'rgba(253, 122, 48, 0.18)';
|
|
|
+ this_.positionPicker = new RichMarker({
|
|
|
+ position:new google.maps.LatLng(Number(lat),Number(lng)),
|
|
|
+ map: this_.map,
|
|
|
+ draggable: true,
|
|
|
+ content:'<div class="lm_img_mover" style="text-align:center;border:11px solid '+borderColor+'; border-radius:50%;cursor:pointer;"><div style="text-align:center;background:'+bgColor+';background-clip: padding-box;border:2px solid #fff; height: 16px; width: 16px; border-radius:50%;"></div></div>'
|
|
|
+ })
|
|
|
+ var controlDiv = document.createElement('DIV');
|
|
|
+ controlDiv.className = "google_Location_box"
|
|
|
+ var controlUI = document.createElement('DIV');
|
|
|
+ controlUI.className = "google_Location"
|
|
|
+ controlDiv.appendChild(controlUI);
|
|
|
+ var svg = document.createElementNS('http://www.w3.org/2000/svg','svg');
|
|
|
+ svg.setAttribute('viewBox','25 25 50 50');
|
|
|
+ svg.setAttribute('class','circular');
|
|
|
+ svg.setAttribute('styel','display:none');
|
|
|
+ var circle = document.createElementNS('http://www.w3.org/2000/svg','circle');
|
|
|
+ circle.setAttribute('cx','50');
|
|
|
+ circle.setAttribute('cy','50');
|
|
|
+ circle.setAttribute('r','20');
|
|
|
+ circle.setAttribute('fill','none');
|
|
|
+ circle.setAttribute('class','path');
|
|
|
|
|
|
- svg.appendChild(circle);
|
|
|
- controlDiv.appendChild(svg);
|
|
|
-
|
|
|
- google.maps.event.addDomListener(controlDiv, 'click', function() {
|
|
|
- if (navigator.geolocation && this_.googleMapLocattion) {
|
|
|
- this_.googleMapLocattion = false;
|
|
|
- $('.google_Location').css('display','none');
|
|
|
- $('.google_Location_box .circular').css('display','inline-block');
|
|
|
- let options ={
|
|
|
- enableHighAccuracy:false,
|
|
|
- timeout:3000,
|
|
|
- maximumAge:3000
|
|
|
+ svg.appendChild(circle);
|
|
|
+ controlDiv.appendChild(svg);
|
|
|
+
|
|
|
+ google.maps.event.addDomListener(controlDiv, 'click', function() {
|
|
|
+ if (navigator.geolocation && this_.googleMapLocattion) {
|
|
|
+ this_.googleMapLocattion = false;
|
|
|
+ $('.google_Location').css('display','none');
|
|
|
+ $('.google_Location_box .circular').css('display','inline-block');
|
|
|
+ let options ={
|
|
|
+ enableHighAccuracy:false,
|
|
|
+ timeout:3000,
|
|
|
+ maximumAge:3000
|
|
|
+ }
|
|
|
+ navigator.geolocation.getCurrentPosition(successHandler,errorHandler,options)
|
|
|
}
|
|
|
- navigator.geolocation.getCurrentPosition(successHandler,errorHandler,options)
|
|
|
+ });
|
|
|
+ this_.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(controlDiv);
|
|
|
+ if(this_.screenMap && this_.mapDWIsTrue){
|
|
|
+ this_.geocoder.geocode({address:this_.screenMap},function(status, result){
|
|
|
+ // console.log(status, result)
|
|
|
+ if(result === 'OK'){
|
|
|
+ this_.mapDWIsTrue = false;
|
|
|
+ lng = status[0].geometry.location.lng();
|
|
|
+ lat = status[0].geometry.location.lat();
|
|
|
+ // console.log(lng,lat)
|
|
|
+ this_.positionPicker.setPosition(new google.maps.LatLng(lat,lng))
|
|
|
+ this_.map.setCenter(new google.maps.LatLng(lat,lng));
|
|
|
+ }else{
|
|
|
+ this_.mapDWIsTrue = true;
|
|
|
+ this_.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: 'Unrecognized, please change the search content',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function_navigator(this_,lat,lng);
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ function_navigator(this_,lat,lng);
|
|
|
}
|
|
|
- });
|
|
|
+ google.maps.event.addListener(this_.positionPicker,"position_changed",function(){
|
|
|
+ $('.lampLongitude'+this_.lampId).text(this.getPosition().lng().toFixed(8));
|
|
|
+ $('.lampLatitude'+this_.lampId).html(this.getPosition().lat().toFixed(8));
|
|
|
+ let bd_encrypt = this_.bd_encrypt(this.getPosition().lng().toFixed(8),this.getPosition().lat().toFixed(8))
|
|
|
+ this_.lampLongitude = bd_encrypt.bd_lng;
|
|
|
+ this_.lampLatitude = bd_encrypt.bd_lat;
|
|
|
+ })
|
|
|
+ let time = setInterval(function(){
|
|
|
+ if($('.lm_img_mover').length >0){
|
|
|
+ let div = $('<div class="lamp_coordinate_en lamp_coordinate_'+this_.lampId+'"><span><span>'+ JDstr +' : <span class="lampLongitude'+this_.lampId+'">'+this_.lampLongitude+'</span></span><span>'+ WDstr +' : <span class="lampLatitude'+this_.lampId+'">'+this_.lampLatitude+'</span></span></span><i class="determine_l"></i><i class="cancel_l"></i></div>')
|
|
|
+ $('.lm_img_mover').parent().append(div);
|
|
|
+
|
|
|
+ $('.lamp_coordinate_'+this_.lampId).children('i').mouseup(function(e){
|
|
|
+ let className = e.target.className.split(' ');
|
|
|
+ if(className[0] == 'determine_l'){
|
|
|
+ this_.lightControlData.longitude = this_.lampLongitude;
|
|
|
+ this_.lightControlData.latitude = this_.lampLatitude;
|
|
|
+ $('.lamp_coordinate_'+this_.lampId).css('display','none');
|
|
|
+ $('.lamp_'+this_.lampId).unbind("mousedown");
|
|
|
+ this_.amapWrapper = false;
|
|
|
+ }else if(className[0] == 'cancel_l'){
|
|
|
+ this_.amapWrapper = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ clearInterval(time)
|
|
|
+ }
|
|
|
+ },1)
|
|
|
+ // console.log(navigator.geolocation , this_.mapDWIsTrue)
|
|
|
+ }
|
|
|
function successHandler(position){
|
|
|
this_.map.setCenter(new google.maps.LatLng(position.coords.latitude,position.coords.longitude));
|
|
|
lat = position.coords.latitude;
|
|
@@ -3683,31 +3740,6 @@
|
|
|
type: 'warning'
|
|
|
});
|
|
|
}
|
|
|
- this_.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(controlDiv);
|
|
|
- if(this_.screenMap && this_.mapDWIsTrue){
|
|
|
- this_.geocoder.geocode({address:this_.screenMap},function(status, result){
|
|
|
- // console.log(status, result)
|
|
|
- if(result === 'OK'){
|
|
|
- this_.mapDWIsTrue = false;
|
|
|
- lng = status[0].geometry.location.lng();
|
|
|
- lat = status[0].geometry.location.lat();
|
|
|
- // console.log(lng,lat)
|
|
|
- this_.positionPicker.setPosition(new google.maps.LatLng(lat,lng))
|
|
|
- this_.map.setCenter(new google.maps.LatLng(lat,lng));
|
|
|
- }else{
|
|
|
- this_.mapDWIsTrue = true;
|
|
|
- this_.$message({
|
|
|
- showClose: true,
|
|
|
- message: 'Unrecognized, please change the search content',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- }
|
|
|
- function_navigator(this_,lat,lng);
|
|
|
- })
|
|
|
- }else{
|
|
|
- function_navigator(this_,lat,lng);
|
|
|
- }
|
|
|
- // console.log(navigator.geolocation , this_.mapDWIsTrue)
|
|
|
function function_navigator(this_) {
|
|
|
if (navigator.geolocation && this_.mapDWIsTrue && this_.googleMapLocattion) {
|
|
|
this_.googleMapLocattion = false;
|
|
@@ -3736,7 +3768,7 @@
|
|
|
if($('.google_Location').length>0 && $('.google_Location_box .circular').length>0){
|
|
|
$('.google_Location').css('display','inline-block');
|
|
|
$('.google_Location_box .circular').css('display','none');
|
|
|
- clearInterval(time1);
|
|
|
+ // clearInterval(time1);
|
|
|
clearInterval(time2);
|
|
|
}
|
|
|
},1)
|
|
@@ -3749,7 +3781,7 @@
|
|
|
if($('.google_Location').length>0 && $('.google_Location_box .circular').length>0){
|
|
|
$('.google_Location').css('display','inline-block');
|
|
|
$('.google_Location_box .circular').css('display','none');
|
|
|
- clearInterval(time1);
|
|
|
+ // clearInterval(time1);
|
|
|
clearInterval(time3);
|
|
|
}
|
|
|
},1)
|
|
@@ -3759,34 +3791,132 @@
|
|
|
type: 'warning'
|
|
|
});
|
|
|
}
|
|
|
- google.maps.event.addListener(this_.positionPicker,"position_changed",function(){
|
|
|
- $('.lampLongitude'+this_.lampId).text(this.getPosition().lng().toFixed(8));
|
|
|
- $('.lampLatitude'+this_.lampId).html(this.getPosition().lat().toFixed(8));
|
|
|
- let bd_encrypt = this_.bd_encrypt(this.getPosition().lng().toFixed(8),this.getPosition().lat().toFixed(8))
|
|
|
- this_.lampLongitude = bd_encrypt.bd_lng;
|
|
|
- this_.lampLatitude = bd_encrypt.bd_lat;
|
|
|
- })
|
|
|
- let time = setInterval(function(){
|
|
|
- if($('.lm_img_mover').length >0){
|
|
|
- let div = $('<div class="lamp_coordinate_en lamp_coordinate_'+this_.lampId+'"><span><span>'+ JDstr +' : <span class="lampLongitude'+this_.lampId+'">'+this_.lampLongitude+'</span></span><span>'+ WDstr +' : <span class="lampLatitude'+this_.lampId+'">'+this_.lampLatitude+'</span></span></span><i class="determine_l"></i><i class="cancel_l"></i></div>')
|
|
|
- $('.lm_img_mover').parent().append(div);
|
|
|
-
|
|
|
- $('.lamp_coordinate_'+this_.lampId).children('i').mouseup(function(e){
|
|
|
- let className = e.target.className.split(' ');
|
|
|
- if(className[0] == 'determine_l'){
|
|
|
- this_.lightControlData.longitude = this_.lampLongitude;
|
|
|
- this_.lightControlData.latitude = this_.lampLatitude;
|
|
|
- $('.lamp_coordinate_'+this_.lampId).css('display','none');
|
|
|
- $('.lamp_'+this_.lampId).unbind("mousedown");
|
|
|
- this_.amapWrapper = false;
|
|
|
- }else if(className[0] == 'cancel_l'){
|
|
|
- this_.amapWrapper = false;
|
|
|
- }
|
|
|
- })
|
|
|
- clearInterval(time)
|
|
|
- }
|
|
|
- },1)
|
|
|
|
|
|
+ if(this.browserLanguage == 'bd'){
|
|
|
+ if(!isNaN(this.lampLongitude) && !isNaN(this.lampLatitude)){
|
|
|
+ let bd_decrypt = this.bd_decrypt(this.lampLongitude,this.lampLatitude)
|
|
|
+ this.lampLongitude = bd_decrypt.lat
|
|
|
+ this.lampLatitude = bd_decrypt.lng
|
|
|
+ this.map = new AMap.Map("lampAmapWrapper", {
|
|
|
+ resizeEnable: true,
|
|
|
+ center:[this.lampLongitude,this.lampLatitude],
|
|
|
+ zoom: 18,
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.map = new AMap.Map("lampAmapWrapper", {
|
|
|
+ resizeEnable: true,
|
|
|
+ zoom: 18,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.geocoder = new AMap.Geocoder({
|
|
|
+ });
|
|
|
+ AMapUI.loadUI(['misc/PositionPicker'], function(PositionPicker) {
|
|
|
+ this_.positionPicker = new PositionPicker({
|
|
|
+ mode: 'dragMarker',
|
|
|
+ map: this_.map,
|
|
|
+ iconStyle: { //自定义外观
|
|
|
+ url: require('../img/GIS/off-icon.png'),
|
|
|
+ ancher: [19, 19],
|
|
|
+ size: [38, 38],
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this_.positionPicker.on('success', function(positionResult) {
|
|
|
+ let bd_encrypt = this_.bd_encrypt(positionResult.position.lng,positionResult.position.lat)
|
|
|
+ console.log(bd_encrypt,bd_encrypt.bd_lng)
|
|
|
+ positionResult.position.lng = bd_encrypt.bd_lng.toFixed(5);
|
|
|
+ positionResult.position.lat = bd_encrypt.bd_lat.toFixed(5);
|
|
|
+
|
|
|
+ $('.lampLongitude'+this_.lampId).text(positionResult.position.lng);
|
|
|
+ $('.lampLatitude'+this_.lampId).html(positionResult.position.lat);
|
|
|
+
|
|
|
+ this_.lampLongitude = positionResult.position.lng;
|
|
|
+ this_.lampLatitude = positionResult.position.lat;
|
|
|
+ });
|
|
|
+ // this_.positionPicker.on('fail', function(positionResult) {
|
|
|
+ // // console.log(positionResult.position)
|
|
|
+ // });
|
|
|
+ this_.map.addControl(new AMap.ToolBar({
|
|
|
+ liteStyle: true
|
|
|
+ }))
|
|
|
+ if(this_.lampLongitude && this_.lampLatitude && !(this_.lampLongitude>180||this_.lampLongitude<-180||this_.lampLatitude>90||this_.lampLatitude<-90)){
|
|
|
+ if(this_.screenMap){
|
|
|
+ this_.geocoder.getLocation(this_.screenMap, function(status, result) {
|
|
|
+ if (status === 'complete' && result.info === 'OK') {
|
|
|
+ if(result.geocodes.length >0){
|
|
|
+ this_.positionPicker.start([result.geocodes[0].location.lng,result.geocodes[0].location.lat])
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this_.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: this_.version==0?'无法识别,请更改搜索内容':'Unrecognized, please change the search content',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ this_.positionPicker.start()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this_.map.plugin('AMap.Geolocation', function() {
|
|
|
+ let geolocation = new AMap.Geolocation({
|
|
|
+ enableHighAccuracy: true,//是否使用高精度定位,默认:true
|
|
|
+ timeout: 5000, //超过10秒后停止定位,默认:无穷大
|
|
|
+ buttonOffset: new AMap.Pixel(14, 125),//定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
|
|
|
+ zoomToAccuracy: true, //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
|
|
+ buttonPosition:'RB'
|
|
|
+ });
|
|
|
+ this_.map.addControl(geolocation);
|
|
|
+ geolocation.getCurrentPosition();
|
|
|
+ AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
|
|
|
+ AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this_.positionPicker.start([this_.lampLatitude,this_.lampLongitude]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ let time = setInterval(function(){
|
|
|
+ if($('.amap-marker').children('.amap-marker-content').children('img').parent().length>0){
|
|
|
+ let div = $('<div class="lamp_coordinate lamp_coordinate_'+this_.lampId+'"><span><span>'+JDstr+' : <span class="lampLongitude'+this_.lampId+'">0</span></span><span>'+WDstr+' : <span class="lampLatitude'+this_.lampId+'">0</span></span></span><i class="determine_l"></i><i class="cancel_l"></i></div>')
|
|
|
+ $('.amap-marker').children('.amap-marker-content').children('img').parent().append(div);
|
|
|
+ $('.lampLongitude'+this_.lampId).text(this_.lampLongitude);
|
|
|
+ $('.lampLatitude'+this_.lampId).html(this_.lampLatitude);
|
|
|
+ $('.lamp_coordinate_'+this_.lampId).children('i').mousedown(function(){
|
|
|
+ this_.map.setStatus({'dragEnable':false})
|
|
|
+ })
|
|
|
+ $('.lamp_coordinate_'+this_.lampId).children('i').mouseup(function(e){
|
|
|
+ let className = e.target.className.split(' ');
|
|
|
+ if(className[0] == 'determine_l'){
|
|
|
+ console.log(this_.lampLongitude,this_.lampLatitude,'----')
|
|
|
+ this_.lightControlData.longitude = this_.lampLongitude;
|
|
|
+ this_.lightControlData.latitude = this_.lampLatitude;
|
|
|
+ this_.map.setStatus({'dragEnable':true})
|
|
|
+ $('.lamp_coordinate_'+this_.lampId).css('display','none');
|
|
|
+ $('.lamp_'+this_.lampId).unbind("mousedown");
|
|
|
+ this_.positionPicker.stop();
|
|
|
+ this_.amapWrapper = false;
|
|
|
+ }else if(className[0] == 'cancel_l'){
|
|
|
+ this_.positionPicker.stop();
|
|
|
+ this_.amapWrapper = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ clearInterval(time)
|
|
|
+ }
|
|
|
+ },1)
|
|
|
+ }
|
|
|
+ //解析定位结果
|
|
|
+ function onComplete(data) {
|
|
|
+ this_.positionPicker.start([data.position.getLng(),data.position.getLat()])
|
|
|
+ }
|
|
|
+ //解析定位错误信息
|
|
|
+ function onError() {
|
|
|
+ // console.log(data)
|
|
|
+ this_.positionPicker.start([114,34]);
|
|
|
+ this_.$message({
|
|
|
+ showClose: true,
|
|
|
+ message:'精确定位失败',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -4042,12 +4172,12 @@
|
|
|
{name:'Voltage',icon:'circle'},
|
|
|
{name:'Current',icon:'circle'},
|
|
|
{name:'power',icon:'circle'},
|
|
|
- {name:'brightness',icon:'circle',select:false}
|
|
|
+ {name:'brightness',icon:'circle'}
|
|
|
];
|
|
|
legendSelected['Voltage'] = true;
|
|
|
legendSelected['Current'] = true;
|
|
|
legendSelected['power'] = true;
|
|
|
- legendSelected['brightness'] = false;
|
|
|
+ legendSelected['brightness'] = true;
|
|
|
for(let d of data.lamppower){
|
|
|
d = parseInt(d);
|
|
|
if(d > dataListMax){
|
|
@@ -6777,7 +6907,8 @@
|
|
|
line-height: 40px;
|
|
|
width: 450px;
|
|
|
top: 0px;
|
|
|
- left: 78px;
|
|
|
+ left: 50px;
|
|
|
+ display: flex;
|
|
|
>span{
|
|
|
display: inline-block;
|
|
|
padding: 0 20px;
|
|
@@ -6799,6 +6930,17 @@
|
|
|
z-index: 1;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+ .determine_l{
|
|
|
+ background: url(../img/GIS/determine-icon.png);
|
|
|
+ display:inline-block;
|
|
|
+ width: 38px;height: 38px;
|
|
|
+ }
|
|
|
+ .cancel_l{
|
|
|
+ background: url(../img/GIS/cancel-icon.png);
|
|
|
+ display:inline-block;
|
|
|
+ width: 38px;height: 38px;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.lamp_light_slider{
|