|
|
@@ -189,16 +189,16 @@
|
|
|
<el-input v-model="ruleForm.trap_number"></el-input>
|
|
|
</el-form-item>
|
|
|
<div class="addtrapbox">
|
|
|
- <el-form-item label="所在纬度" prop="lng">
|
|
|
+ <el-form-item label="所在经度" prop="lng">
|
|
|
<el-input v-model="ruleForm.lng" @blur="latblur"></el-input>
|
|
|
<p style="height: 24px; padding-left: 16px">
|
|
|
- {{ ToDegrees(ruleForm.lng, "lng") }}
|
|
|
+ {{ isNaN(ruleForm.lng)?ToDigital(ruleForm.lng, "lng"):ToDegrees(ruleForm.lng, "lng") }}
|
|
|
</p>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所在纬度" prop="lat">
|
|
|
<el-input v-model="ruleForm.lat" @blur="latblur"></el-input>
|
|
|
<p style="height: 24px; padding-left: 16px">
|
|
|
- {{ ToDegrees(ruleForm.lat, "lat") }}
|
|
|
+ {{ isNaN(ruleForm.lat)?ToDigital(ruleForm.lat, "lat"):ToDegrees(ruleForm.lat, "lat") }}
|
|
|
</p>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
@@ -533,7 +533,7 @@ export default {
|
|
|
if (e) {
|
|
|
console.log(this.$data.ruleForm);
|
|
|
if (this.$data.ruleForm.lat != "" && this.$data.ruleForm.lng != "") {
|
|
|
- this.city(this.$data.ruleForm.lat, this.$data.ruleForm.lng);
|
|
|
+ this.city(this.ToDigital(this.$data.ruleForm.lat), this.ToDigital(this.$data.ruleForm.lng));
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -668,8 +668,8 @@ export default {
|
|
|
data: this.qs.stringify({
|
|
|
trap_id: this.ruleForm.trap_id, // 非必传(num) 诱捕器id 修改项
|
|
|
trap_number: this.ruleForm.trap_number, // 必传(string) 设备编号
|
|
|
- lat: this.ToDigital(this.ruleForm.lat), // 必传(string) 纬度
|
|
|
- lng: this.ToDigital(this.ruleForm.lng), // 必传(string) 经度
|
|
|
+ lat: this.ToDegrees(this.ruleForm.lat,"lat"), // 必传(string) 纬度
|
|
|
+ lng: this.ToDegrees(this.ruleForm.lng,"lng"), // 必传(string) 经度
|
|
|
org_id: org_id, // 必传(string) 所属海关id
|
|
|
inducer_id: this.ruleForm.inducer_id, // 必传(string) 诱剂id
|
|
|
point_id: this.ruleForm.point_id, // 必传(string) 所属监测点id
|
|
|
@@ -744,7 +744,7 @@ export default {
|
|
|
this.ruleForm.org_id = [];
|
|
|
this.ruleForm.oldorg_id = e.org_list;
|
|
|
console.log(this.ruleForm);
|
|
|
- this.city(e.lat, e.lng);
|
|
|
+ this.city(this.ToDigital(e.lat), this.ToDigital(e.lng));
|
|
|
// this.getmon3(e);
|
|
|
this.addtraptf = true;
|
|
|
},
|
|
|
@@ -981,7 +981,7 @@ export default {
|
|
|
this.ruleForm.lng = this.locationForm.lng;
|
|
|
this.ruleForm.lat = this.locationForm.lat;
|
|
|
this.addLocationDialogVisible = false;
|
|
|
- this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
+ this.city(this.ToDigital(this.ruleForm.lat), this.ToDigital(this.ruleForm.lng));
|
|
|
},
|
|
|
addLocationDialogClosed() {
|
|
|
//弹框关闭时
|
|
|
@@ -1006,12 +1006,12 @@ export default {
|
|
|
dingwei() {
|
|
|
console.log(this.ruleForm);
|
|
|
if (this.ruleForm.lng != "" && this.ruleForm.lng != 0) {
|
|
|
- this.center[0] = this.ruleForm.lng;
|
|
|
+ this.center[0] = this.ToDigital(this.ruleForm.lng);
|
|
|
} else {
|
|
|
this.center = [114.05, 22.55];
|
|
|
}
|
|
|
if (this.ruleForm.lat != "" && this.ruleForm.lat != 0) {
|
|
|
- this.center[1] = this.ruleForm.lat;
|
|
|
+ this.center[1] = this.ToDigital(this.ruleForm.lat);
|
|
|
} else {
|
|
|
this.center = [114.05, 22.55];
|
|
|
}
|
|
|
@@ -1020,7 +1020,7 @@ export default {
|
|
|
this.init();
|
|
|
}, 500);
|
|
|
},
|
|
|
- //度转度°分′秒″
|
|
|
+ //度 转 度°分′秒″
|
|
|
ToDegrees(val, type) {
|
|
|
if (typeof val == "undefined" || val == "" || isNaN(val)) {
|
|
|
return val;
|
|
|
@@ -1049,10 +1049,10 @@ export default {
|
|
|
strMiao = parseFloat(strMiao).toFixed(2); //精确小数点后面两位
|
|
|
}
|
|
|
}
|
|
|
- // console.log(strDu, strFen, strMiao);
|
|
|
+ console.log(A);
|
|
|
return strDu + "°" + strFen + "′" + strMiao + "″" + A;
|
|
|
},
|
|
|
- //度°分′秒″转度
|
|
|
+ //度°分′秒″ 转 度
|
|
|
ToDigital(lnglat) {
|
|
|
if (!isNaN(lnglat)) {
|
|
|
return lnglat;
|
|
|
@@ -1113,14 +1113,14 @@ export default {
|
|
|
console.log(this.ruleForm);
|
|
|
},
|
|
|
error: function (err) {
|
|
|
- alert("服务端错误,请刷新浏览器后重试");
|
|
|
+ // alert("服务端错误,请刷新浏览器后重试");
|
|
|
},
|
|
|
});
|
|
|
// return arr;
|
|
|
},
|
|
|
latblur() {
|
|
|
if (this.ruleForm.lat != "" && this.ruleForm.lng != "") {
|
|
|
- this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
+ this.city(this.ToDigital(this.ruleForm.lat), this.ToDigital(this.ruleForm.lng));
|
|
|
}
|
|
|
},
|
|
|
},
|