Commit bc8709b6 authored by 董国亮's avatar 董国亮

修订速度的小数点fixed,经纬度转度分秒,轨迹socket从配置获取

parent bc0726c1
...@@ -44,8 +44,8 @@ export default { ...@@ -44,8 +44,8 @@ export default {
}, },
registDetetors() { registDetetors() {
if (!this.detetorsStatus) { if (!this.detetorsStatus) {
// let wsUrl= ws_config.BASE_URL let wsUrl= ws_config.BASE_URL
let wsUrl = `ws://${window.wsHost}/holows/subscribe` // let wsUrl = `ws://${window.wsHost}/holows/subscribe`
let ws1 = initWs({ let ws1 = initWs({
name: "callDetetorA", name: "callDetetorA",
url: wsUrl, url: wsUrl,
......
...@@ -756,8 +756,8 @@ export default { ...@@ -756,8 +756,8 @@ export default {
// 注册车辆实时ws // 注册车辆实时ws
let socket = initWs({ let socket = initWs({
name: "callCar", name: "callCar",
// url: ws_config.BASE_URL, url: ws_config.BASE_URL,
url: `ws://${window.wsHost}/holows/subscribe`, // url: `ws://${window.wsHost}/holows/subscribe`,
callback: this.callCar, callback: this.callCar,
}); });
socket.ws.onopen = () => { socket.ws.onopen = () => {
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
<span class="left">号牌颜色:</span>{{ convertDict("PlateColor", model.licenseColor) }} <span class="left">号牌颜色:</span>{{ convertDict("PlateColor", model.licenseColor) }}
</div> </div>
<div class="detailItem"> <div class="detailItem">
<span class="left">行驶速度:</span>{{ model.speed || 0 }} km/h <span class="left">行驶速度:</span>{{ Number(model.speed).toFixed(2) || 0 }} km/h
</div> </div>
<div class="detailItem" v-show="notExceed"> <div class="detailItem" v-show="notExceed">
<span class="left">车身颜色:</span>{{ convertDict("CarColor", model.originalColor) }} <span class="left">车身颜色:</span>{{ convertDict("CarColor", model.originalColor) }}
</div> </div>
<div class="detailItem" v-show="notExceed"> <div class="detailItem" v-show="notExceed">
<span class="left">航向角:</span>{{ model.courseAngle || 0 }} <span class="left">航向角:</span>{{ Number(model.courseAngle).toFixed(1) || 0 }}
</div> </div>
<div class="detailItem"> <div class="detailItem">
<span class="left">车辆类型:</span>{{ convertDict("CarType", model.originalType) }} <span class="left">车辆类型:</span>{{ convertDict("CarType", model.originalType) }}
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
<div class="detailItem"> <div class="detailItem">
<span class="left">ID :</span>{{ model.id }} <span class="left">ID :</span>{{ model.id }}
</div> </div>
<div class="detailItem" v-show="notExceed" :title="`经度:${Number(model.longitude).toFixed(6)}`"> <div class="detailItem" v-show="notExceed" :title="`经度:${decimalToDMS(parseFloat(model.longitude))}`">
<span class="left">经度:</span>{{ Number(model.longitude).toFixed(6) }} <span class="left">经度:</span>{{ decimalToDMS(parseFloat(model.longitude)) }}
</div> </div>
<div class="detailItem" v-show="notExceed" :title="`纬度:${Number( <div class="detailItem" v-show="notExceed" :title="`纬度:${decimalToDMS(parseFloat(
model.latitude model.latitude
).toFixed(6)}`"> ))}`">
<span class="left">纬度:</span>{{ <span class="left">纬度:</span>{{
Number(model.latitude).toFixed(6) decimalToDMS(parseFloat(model.latitude))
}} }}
</div> </div>
</div> </div>
...@@ -86,6 +86,15 @@ export default { ...@@ -86,6 +86,15 @@ export default {
closeDetail() { closeDetail() {
this.$emit("actionFinished", this.dialogId, false); this.$emit("actionFinished", this.dialogId, false);
}, },
decimalToDMS(decimal) {
const isNegative = decimal < 0;
const absDecimal = Math.abs(decimal);
const degrees = Math.floor(absDecimal);
const minutes = Math.floor((absDecimal - degrees) * 60);
const seconds = ((absDecimal - degrees - minutes / 60) * 3600).toFixed(2);
return `${isNegative ? '-' : ''}${degrees}° ${minutes}' ${seconds}"`;
}
}, },
computed: { computed: {
overWidth() { overWidth() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment