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

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

parent bc0726c1
......@@ -44,8 +44,8 @@ export default {
},
registDetetors() {
if (!this.detetorsStatus) {
// let wsUrl= ws_config.BASE_URL
let wsUrl = `ws://${window.wsHost}/holows/subscribe`
let wsUrl= ws_config.BASE_URL
// let wsUrl = `ws://${window.wsHost}/holows/subscribe`
let ws1 = initWs({
name: "callDetetorA",
url: wsUrl,
......
......@@ -756,8 +756,8 @@ export default {
// 注册车辆实时ws
let socket = initWs({
name: "callCar",
// url: ws_config.BASE_URL,
url: `ws://${window.wsHost}/holows/subscribe`,
url: ws_config.BASE_URL,
// url: `ws://${window.wsHost}/holows/subscribe`,
callback: this.callCar,
});
socket.ws.onopen = () => {
......
......@@ -14,13 +14,13 @@
<span class="left">号牌颜色:</span>{{ convertDict("PlateColor", model.licenseColor) }}
</div>
<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 class="detailItem" v-show="notExceed">
<span class="left">车身颜色:</span>{{ convertDict("CarColor", model.originalColor) }}
</div>
<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 class="detailItem">
<span class="left">车辆类型:</span>{{ convertDict("CarType", model.originalType) }}
......@@ -40,14 +40,14 @@
<div class="detailItem">
<span class="left">ID :</span>{{ model.id }}
</div>
<div class="detailItem" v-show="notExceed" :title="`经度:${Number(model.longitude).toFixed(6)}`">
<span class="left">经度:</span>{{ Number(model.longitude).toFixed(6) }}
<div class="detailItem" v-show="notExceed" :title="`经度:${decimalToDMS(parseFloat(model.longitude))}`">
<span class="left">经度:</span>{{ decimalToDMS(parseFloat(model.longitude)) }}
</div>
<div class="detailItem" v-show="notExceed" :title="`纬度:${Number(
<div class="detailItem" v-show="notExceed" :title="`纬度:${decimalToDMS(parseFloat(
model.latitude
).toFixed(6)}`">
))}`">
<span class="left">纬度:</span>{{
Number(model.latitude).toFixed(6)
decimalToDMS(parseFloat(model.latitude))
}}
</div>
</div>
......@@ -86,6 +86,15 @@ export default {
closeDetail() {
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: {
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