【类 型】:feat 添加飞机电池容量控件
【原 因】:实现 飞机电池使用状况 返航状况等 【过 程】: 【影 响】:
This commit is contained in:
parent
5a3f22a9ef
commit
94485ccf2c
16
package-lock.json
generated
16
package-lock.json
generated
@ -28,6 +28,7 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^6.2.2",
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
|
"geodist": "^0.2.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mapbox-gl": "^2.15.0",
|
"mapbox-gl": "^2.15.0",
|
||||||
"mqtt": "^2.18.9",
|
"mqtt": "^2.18.9",
|
||||||
@ -8135,6 +8136,15 @@
|
|||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/geodist": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/geodist/-/geodist-0.2.1.tgz",
|
||||||
|
"integrity": "sha512-tZFJeHXyb203sDtn15gg2Smgfo9LZRjlbNn9F9HrJ3/W2+yqy7BzSyKuGzSxYFcofa2hsfrke5wgT/ws8jrjcw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/geojson-vt": {
|
"node_modules/geojson-vt": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmmirror.com/geojson-vt/-/geojson-vt-3.2.1.tgz",
|
"resolved": "https://registry.npmmirror.com/geojson-vt/-/geojson-vt-3.2.1.tgz",
|
||||||
@ -23580,6 +23590,12 @@
|
|||||||
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
|
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"geodist": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/geodist/-/geodist-0.2.1.tgz",
|
||||||
|
"integrity": "sha512-tZFJeHXyb203sDtn15gg2Smgfo9LZRjlbNn9F9HrJ3/W2+yqy7BzSyKuGzSxYFcofa2hsfrke5wgT/ws8jrjcw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"geojson-vt": {
|
"geojson-vt": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmmirror.com/geojson-vt/-/geojson-vt-3.2.1.tgz",
|
"resolved": "https://registry.npmmirror.com/geojson-vt/-/geojson-vt-3.2.1.tgz",
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^6.2.2",
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
|
"geodist": "^0.2.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mapbox-gl": "^2.15.0",
|
"mapbox-gl": "^2.15.0",
|
||||||
"mqtt": "^2.18.9",
|
"mqtt": "^2.18.9",
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
<PublicTag icon="icon-gaodu" :val="plane.planeState.positionAlt" unit="米" state="normal" />
|
<PublicTag icon="icon-gaodu" :val="plane.planeState.positionAlt" unit="米" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-gaodu" :val="plane.planeState.fixType" unit="" state="danger" />
|
<PublicTag icon="icon-gaodu" :val="plane.planeState.currentBattery" unit="安" state="danger" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-gaodu" :val="plane.planeState.batteryRemaining" unit="米" state="danger" />
|
<PublicTag icon="icon-gaodu" :val="plane.planeState.batteryRemaining" unit="%" state="danger" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -34,11 +34,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import HeartTag from '@/components/Tag/HeartTag'
|
import HeartTag from '@/components/Tag/HeartTag'
|
||||||
import PublicTag from '@/components/Tag/PublicTag'
|
import PublicTag from '@/components/Tag/PublicTag'
|
||||||
|
import geodist from 'geodist'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PlaneStatus',
|
name: 'PlaneStatus',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
distance: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -54,9 +56,19 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
distance (val) {
|
||||||
|
console.log(val + '米')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
created () {
|
created () {
|
||||||
|
try {
|
||||||
|
const point1 = { lat: 52.518611, lon: 13.408056 }
|
||||||
|
const point2 = { lat: 51.507222, lon: -0.1275 }
|
||||||
|
this.distance = geodist(point1, point2, { unit: 'meters' })
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error calculating distance:', error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user