From 1ce8dd8980692da59fac09d4f868b490f7f74b88 Mon Sep 17 00:00:00 2001
From: yupan <yupanx@163.com>
Date: Thu, 27 Oct 2022 10:24:24 +0800
Subject: [PATCH] Merge branch 'master' of http://blit.7drlb.com:8888/r/moral_fronted
---
src/views/car/index.vue | 69 ++++++++++++++++++++++++++++------
1 files changed, 57 insertions(+), 12 deletions(-)
diff --git a/src/views/car/index.vue b/src/views/car/index.vue
index 724cc65..849a1f4 100644
--- a/src/views/car/index.vue
+++ b/src/views/car/index.vue
@@ -18,6 +18,12 @@
@click="changeCarData(item)"
>
<span>{{ item.name }}</span>
+ <i
+ style="vertical-align: -2.5px;font-size: 20px;margin-right:10px;margin-left:auto"
+ class="iconfont iconfaxianzuobiao"
+ @click="deviceDetail(item.mac,null,item,0)"
+ />
+<!-- @click="deviceDetail('p5dnd7a0245390',null,item,0)"-->
</el-menu-item>
</el-menu>
</el-aside>
@@ -169,6 +175,7 @@
</template>
<script>
import $ from 'jquery'
+import '@/assets/icon/iconfont.css'
var GPS = {
PI: 3.14159265358979324,
x_pi: 3.14159265358979324 * 3000.0 / 180.0,
@@ -355,7 +362,7 @@
{ sensorName: 'CO', unit: 'mg/m��', tab1: '2', tab2: '4', tab3: '14', tab4: '24', tab5: '36', tab6: '48' },
{ sensorName: 'O3', unit: 'ug/m��', tab1: '100', tab2: '160', tab3: '215', tab4: '265', tab5: '800', tab6: '800' },
{ sensorName: 'TVOC', unit: 'mg/m��', tab1: '0.1', tab2: '0.3', tab3: '0.5', tab4: '0.7', tab5: '0.9', tab6: '1' },
- { sensorName: '���������', unit: 'ug/m��', tab1: '0.05', tab2: '0.1', tab3: '0.3', tab4: '0.5', tab5: '0.9', tab6: '1' }
+ { sensorName: '���������', unit: 'ug/m��', tab1: '300', tab2: '500', tab3: '1000', tab4: '10000', tab5: '20000', tab6: '50000' }
],
carWs: null,
map: null,
@@ -449,6 +456,34 @@
})
},
methods: {
+ // ���������������������
+ deviceDetail(mac, item, items, indexs) {
+ // console.log('������������������������')
+ // console.log(mac)
+ // console.log(item)
+ // console.log(items)
+ // console.log(indexs)
+ // this.monitorPointInfo = item
+ this.$router.push({
+ name: 'deviceDetail',
+ // path: '/carDetail',
+ params: {
+ monitorPointInfo: item,
+ device: items,
+ macName: mac,
+ indexs: indexs,
+ items: [items.latitude, items.longitude]
+ },
+ query: {
+ monitorPointInfo: JSON.stringify(item),
+ device: items,
+ macName: mac,
+ indexs: indexs,
+ items: [items.latitude, items.longitude],
+ equipment: 'car'
+ }
+ })
+ },
// 6���������������
customLevel() {
this.getStart()
@@ -670,6 +705,7 @@
this.loading = false
if (this.responseJSON.length > 0) {
this.noneData = false
+ console.log(that.carMac, 'mac')
$.each(this.responseJSON, (item, value) => {
if (typeof (value.flylon) === 'undefined') {
showNoPoints()
@@ -691,7 +727,12 @@
point.a21005 = parseFloat(value.a21005).toFixed(3)
point.a05024 = parseInt(value.a05024)
point.a99054 = parseFloat(value.a99054).toFixed(3)
- point.dustld = value.dustld - 0
+ if (value.dustld - 0 !== 0 && value.dustld - 0 < 100 && that.carMac === 'p5dnd7a0243622') {
+ point.dustld = 100
+ } else {
+ point.dustld = value.dustld - 0
+ }
+ // point.dustld = value.dustld - 0
trackPoints.push(point)
}
})
@@ -736,11 +777,11 @@
}
}
// drawPolygon(sensor);//���������
- draw(that.sensor, that.viewType)
- drawLine()// ������
+ draw(that.sensor, that.viewType, that.carMac)
+ // drawLine()// ������
drawStartAndEnd()// ���������������������
- function draw(sensor, type) {
- var levels = getGrading(sensor, type)
+ function draw(sensor, type, carMac) {
+ var levels = getGrading(sensor, type, carMac)
$.each(levels, function(index, value) {
var color = value.color
var data = value.data
@@ -864,7 +905,7 @@
return new BMapGL.Point(lng, lat)
}
- function getGrading(sensor, type) {
+ function getGrading(sensor, type, carMac) {
var levels = []
var level0 = {}
var level1 = {}
@@ -913,10 +954,14 @@
if (type === '2D') {
height = 0
} else {
- height = value[sensor] * 10
- if (sensor === 'a99054') {
- height = value[sensor] * 500
- }
+ height = value[sensor]
+ // if (sensor === 'a99054') {
+ // height = value[sensor] * 500
+ // }
+ // console.log(carMac, 'carMac')
+ // if (sensor === 'dustld' && (value[sensor] - 0) < 100 && (value[sensor] - 0) !== 0 && carMac === 'p5dnd7a0243622') {
+ // height = 100 * 10
+ // }
}
switch (level) {
case 0:
@@ -1243,7 +1288,7 @@
draw(that.sensor, that.viewType)
if (that.viewType === '2D') {
that.map.setTilt(0)
- drawLine()
+ // drawLine()
drawStartAndEnd()
$('.sensorLevel').attr('src', '/img/pollutionlevel.png')
} else if (that.viewType === '3D') {
--
Gitblit v1.8.0