From fbbb03338e7001ee635800a49de79ce2e4933ecf Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Wed, 20 Mar 2024 11:16:07 +0800
Subject: [PATCH] fix: 手持设备分钟
---
src/views/car/index.vue | 479 +++++++++++++++++++++++++++++++++++------------------------
1 files changed, 284 insertions(+), 195 deletions(-)
diff --git a/src/views/car/index.vue b/src/views/car/index.vue
index d1d20bb..617a935 100644
--- a/src/views/car/index.vue
+++ b/src/views/car/index.vue
@@ -2,7 +2,7 @@
<div class="main_body">
<el-container style="height: 100%">
<el-aside
- v-if="this.$store.state.aside"
+ v-if="$store.state.aside"
width="300px"
style="background-color: rgb(238, 241, 246); padding-top: 10px"
>
@@ -13,8 +13,7 @@
font-weight: 500;
color: rgb(64, 158, 255);
"
- >���������������</span
- >
+ >���������������</span>
<el-menu style="margin-top: 10px">
<el-menu-item
v-for="(item, index) in defaultData"
@@ -44,7 +43,7 @@
</el-menu-item>
</el-menu>
</el-aside>
- <el-dialog> </el-dialog>
+ <el-dialog />
<el-container style="position: relative">
<div class="carTop">
<span style="float: left; margin: 1px 10px 0 0">
@@ -53,8 +52,7 @@
type="primary"
icon="el-icon-setting"
@click="dialogFormVisible = true"
- >6���������</el-button
- >
+ >6���������</el-button>
</span>
<span
v-for="(item, index) in snesorParams"
@@ -62,7 +60,7 @@
class="left"
:class="{ click: changeColor == index }"
@click="changeCode(index)"
- >{{ item }}
+ >{{ item }}
</span>
<span
v-for="(item, index) in viewOptions"
@@ -70,12 +68,17 @@
class="right"
:class="{ click: changeColor1 == index }"
@click="changeCode1(index)"
- >{{ item }}
+ >{{ item }}
</span>
- <span v-if="webSocketView" style="float: right; margin: 2px 10px 0 0">
- <el-button size="medium" type="primary" @click="wsStart()"
- >������������</el-button
- >
+ <span
+ v-if="webSocketView"
+ style="float: right; margin: 2px 10px 0 0"
+ >
+ <el-button
+ size="medium"
+ type="primary"
+ @click="wsStart()"
+ >������������</el-button>
</span>
<!-- <el-date-picker
v-if="historyView"
@@ -116,20 +119,20 @@
size="small"
style="margin-left: 1.5rem"
@click="insertL"
- >������</el-button
>
+ ������
+ </el-button>
<el-input
- placeholder="���������������"
v-model="inputnum"
+ placeholder="���������������"
class="inputNum"
clearable
- >
- </el-input>
+ />
<div class="insLu">
<el-upload
- class="upload-demo"
ref="upload"
+ class="upload-demo"
action=""
:on-change="handleChange"
:on-remove="handleRemove"
@@ -137,10 +140,18 @@
:auto-upload="false"
:limit="1"
>
- <el-button slot="trigger" size="small" type="primary"
- >������������</el-button
+ <el-button
+ slot="trigger"
+ size="small"
+ type="primary"
>
- <div slot="tip" class="el-upload__tip" style="color: red">
+ ������������
+ </el-button>
+ <div
+ slot="tip"
+ class="el-upload__tip"
+ style="color: red"
+ >
������������������������(���������������)
</div>
</el-upload>
@@ -164,42 +175,57 @@
<el-button @click="insqu">������</el-button>
<el-button @click="qnull">������</el-button>
</div> -->
- <el-table :data="tableData" style="width: 100%">
- <el-table-column label="������������" width="180">
+ <el-table
+ :data="tableData"
+ style="width: 100%"
+ >
+ <el-table-column
+ label="������������"
+ width="180"
+ >
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.start }}</span>
</template>
</el-table-column>
- <el-table-column label="������������" width="180">
+ <el-table-column
+ label="������������"
+ width="180"
+ >
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.end }}</span>
</template>
</el-table-column>
</el-table>
<div style="display: flex">
- <span class="statspan">������������:</span
- ><el-input
+ <span class="statspan">������������:</span><el-input
v-model="Lname"
style="width: 12rem; margin-left: 1.7rem"
- ></el-input>
+ />
</div>
<div style="display: flex; margin-left: 4rem">
- <el-button type="primary" @click="insLuDuan">������</el-button>
- <el-button @click="insqu">������</el-button>
- <el-button @click="qnull">������</el-button>
+ <el-button
+ type="primary"
+ @click="insLuDuan"
+ >
+ ������
+ </el-button>
+ <el-button @click="insqu">
+ ������
+ </el-button>
+ <el-button @click="qnull">
+ ������
+ </el-button>
</div>
</div>
<el-date-picker
- style="float: right; margin-right: 10px"
- @change="dateChange"
v-model="dateValue"
+ style="float: right; margin-right: 10px"
type="datetimerange"
- :picker-options="threeOptions"
range-separator="���"
start-placeholder="������������"
end-placeholder="������������"
- >
- </el-date-picker>
+ @change="dateChange"
+ />
<!-- ������/��������������������� -->
<el-select
v-model="dataTypeValue"
@@ -219,8 +245,16 @@
/>
</el-select>
</div>
- <div v-if="noneData" class="noneData">������������������������������</div>
- <div id="map_container" v-loading="loading" />
+ <div
+ v-if="noneData"
+ class="noneData"
+ >
+ ������������������������������
+ </div>
+ <div
+ id="map_container"
+ v-loading="loading"
+ />
<!-- ������������ -->
</el-container>
</el-container>
@@ -236,19 +270,38 @@
<!-- <img src="/img/pollutionlevel.png" class="sensorLevel">
<div id="cpm">���������������������</div> -->
<!-- 6��������������� -->
- <el-dialog title="6���������" :visible.sync="dialogFormVisible" width="1000px">
- <el-descriptions title="������6���" :column="3" border>
+ <el-dialog
+ title="6���������"
+ :visible.sync="dialogFormVisible"
+ width="1000px"
+ >
+ <el-descriptions
+ title="������6���"
+ :column="3"
+ border
+ >
<el-descriptions-item
label="PM2.5 | ug/m��"
label-class-name="my-label"
content-class-name="my-content"
- >22</el-descriptions-item
>
- <el-descriptions-item label="PM10 | ug/m��">34</el-descriptions-item>
- <el-descriptions-item label="SO2 | ug/m��">4</el-descriptions-item>
- <el-descriptions-item label="NO2 | ug/m��">16</el-descriptions-item>
- <el-descriptions-item label="CO | mg/m��">0.5</el-descriptions-item>
- <el-descriptions-item label="O3 | ug/m��">149</el-descriptions-item>
+ 22
+ </el-descriptions-item>
+ <el-descriptions-item label="PM10 | ug/m��">
+ 34
+ </el-descriptions-item>
+ <el-descriptions-item label="SO2 | ug/m��">
+ 4
+ </el-descriptions-item>
+ <el-descriptions-item label="NO2 | ug/m��">
+ 16
+ </el-descriptions-item>
+ <el-descriptions-item label="CO | mg/m��">
+ 0.5
+ </el-descriptions-item>
+ <el-descriptions-item label="O3 | ug/m��">
+ 149
+ </el-descriptions-item>
</el-descriptions>
<!-- <el-descriptions title="���������������" border>
</el-descriptions> -->
@@ -264,44 +317,81 @@
>
���������������
</div>
- <el-table :data="sensorTableData" border>
- <el-table-column prop="sensorName" label="������" />
- <el-table-column prop="unit" label="������" />
+ <el-table
+ :data="sensorTableData"
+ border
+ >
+ <el-table-column
+ prop="sensorName"
+ label="������"
+ />
+ <el-table-column
+ prop="unit"
+ label="������"
+ />
<el-table-column label="������">
<template slot-scope="scope">
- <el-input v-model="scope.row.tab1" placeholder="���������������" />
+ <el-input
+ v-model="scope.row.tab1"
+ placeholder="���������������"
+ />
<!-- <span v-show="!scope.row.show">{{ scope.row.tab1 }}</span> -->
</template>
</el-table-column>
<el-table-column label="������">
<template slot-scope="scope">
- <el-input v-model="scope.row.tab2" placeholder="���������������" />
+ <el-input
+ v-model="scope.row.tab2"
+ placeholder="���������������"
+ />
</template>
</el-table-column>
<el-table-column label="������">
<template slot-scope="scope">
- <el-input v-model="scope.row.tab3" placeholder="���������������" />
+ <el-input
+ v-model="scope.row.tab3"
+ placeholder="���������������"
+ />
</template>
</el-table-column>
<el-table-column label="������">
<template slot-scope="scope">
- <el-input v-model="scope.row.tab4" placeholder="���������������" />
+ <el-input
+ v-model="scope.row.tab4"
+ placeholder="���������������"
+ />
</template>
</el-table-column>
<el-table-column label="������">
<template slot-scope="scope">
- <el-input v-model="scope.row.tab5" placeholder="���������������" />
+ <el-input
+ v-model="scope.row.tab5"
+ placeholder="���������������"
+ />
</template>
</el-table-column>
<el-table-column label="������">
<template slot-scope="scope">
- <el-input v-model="scope.row.tab6" placeholder="���������������" />
+ <el-input
+ v-model="scope.row.tab6"
+ placeholder="���������������"
+ />
</template>
</el-table-column>
</el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">��� ���</el-button>
- <el-button type="primary" @click="customLevel">��� ���</el-button>
+ <div
+ slot="footer"
+ class="dialog-footer"
+ >
+ <el-button @click="dialogFormVisible = false">
+ ��� ���
+ </el-button>
+ <el-button
+ type="primary"
+ @click="customLevel"
+ >
+ ��� ���
+ </el-button>
</div>
</el-dialog>
</div>
@@ -490,11 +580,11 @@
2.0) /
3.0
return ret
- },
+ }
}
export default {
components: { index },
- data() {
+ data () {
return {
inputnum: 50,
tableData: [],
@@ -512,7 +602,7 @@
'CO',
'O3',
'TVOC',
- '���������',
+ '���������'
],
changeColor: 0,
changeColor1: 0,
@@ -524,33 +614,33 @@
viewOptions: ['������', '������'],
dateValue: [],
pickerOptions: {
- disabledDate(time) {
+ disabledDate (time) {
return time.getTime() > Date.now()
},
shortcuts: [
{
text: '������',
- onClick(picker) {
+ onClick (picker) {
picker.$emit('pick', new Date())
- },
+ }
},
{
text: '������',
- onClick(picker) {
+ onClick (picker) {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
picker.$emit('pick', date)
- },
+ }
},
{
text: '���������',
- onClick(picker) {
+ onClick (picker) {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', date)
- },
- },
- ],
+ }
+ }
+ ]
},
timeOne: '',
threeOptions: {
@@ -560,7 +650,7 @@
// ������������������������������������������������������������
if (maxDate) this.timeOne = ''
},
- disabledDate: (time) => {
+ disabledDate: time => {
if (this.timeOne) {
const WEEK = 3 * 24 * 3600 * 1000 - 1 // ������������3���������1��������� ������3���������
const minTime = this.timeOne // ������������
@@ -573,7 +663,7 @@
} else {
return time.getTime() > new Date()
}
- },
+ }
},
timeOne: '',
threeOptions: {
@@ -583,7 +673,7 @@
// ������������������������������������������������������������
if (maxDate) this.timeOne = ''
},
- disabledDate: (time) => {
+ disabledDate: time => {
if (this.timeOne) {
const WEEK = 3 * 24 * 3600 * 1000 - 1 // ������������3���������1��������� ������3���������
const minTime = this.timeOne // ������������
@@ -596,7 +686,7 @@
} else {
return time.getTime() > new Date()
}
- },
+ }
},
sensorDate: null,
noneData: false,
@@ -612,7 +702,7 @@
tab3: '115',
tab4: '150',
tab5: '250',
- tab6: '350',
+ tab6: '350'
},
{
sensorName: 'PM10',
@@ -622,7 +712,7 @@
tab3: '250',
tab4: '350',
tab5: '420',
- tab6: '500',
+ tab6: '500'
},
{
sensorName: 'SO2',
@@ -632,7 +722,7 @@
tab3: '650',
tab4: '800',
tab5: '',
- tab6: '',
+ tab6: ''
},
{
sensorName: 'NO2',
@@ -642,7 +732,7 @@
tab3: '700',
tab4: '1200',
tab5: '2340',
- tab6: '3090',
+ tab6: '3090'
},
{
sensorName: 'CO',
@@ -652,7 +742,7 @@
tab3: '35',
tab4: '60',
tab5: '90',
- tab6: '120',
+ tab6: '120'
},
{
sensorName: 'O3',
@@ -662,7 +752,7 @@
tab3: '300',
tab4: '400',
tab5: '800',
- tab6: '1000',
+ tab6: '1000'
},
{
sensorName: 'TVOC',
@@ -672,7 +762,7 @@
tab3: '0.5',
tab4: '0.7',
tab5: '0.9',
- tab6: '1',
+ tab6: '1'
},
{
sensorName: '���������',
@@ -682,8 +772,8 @@
tab3: '1000',
tab4: '10000',
tab5: '20000',
- tab6: '50000',
- },
+ tab6: '50000'
+ }
],
carWs: null,
map: null,
@@ -703,12 +793,12 @@
dataTypeList: [
{
value: 'history',
- label: '������������',
+ label: '������������'
},
{
value: 'webSocket',
- label: '������������',
- },
+ label: '������������'
+ }
],
dataTypeValue: 'history',
historyView: true,
@@ -728,12 +818,12 @@
endL: '',
timeValue: [
new Date(2020, 1, 1, 0, 0, 0),
- new Date(2022, 12, 31, 23, 59, 59),
- ],
+ new Date(2022, 12, 31, 23, 59, 59)
+ ]
}
},
watch: {
- dataTypeValue(n, o) {
+ dataTypeValue (n, o) {
if (this.dataTypeValue === 'webSocket') {
this.dateValue = []
this.historyView = false
@@ -744,16 +834,16 @@
this.webSocketView = false
}
},
- dateValue(n, o) {
+ dateValue (n, o) {
if (n === null) {
this.dateValue = []
}
},
- viewKey(n, o) {
+ viewKey (n, o) {
// console.log(n)
},
deep: true,
- immediate: true,
+ immediate: true
// timeValue: {
// handler(newVal, oldVal) {
// this.sensorTime = this.newTime()
@@ -774,7 +864,7 @@
// immediate: true
// }
},
- mounted() {
+ mounted () {
// this.$watch('carMac', () => {
if (this.dataType === 'history') {
this.getStart()
@@ -783,8 +873,8 @@
}
// })
},
- beforeDestroy() {},
- created() {
+ beforeDestroy () {},
+ created () {
this.newTime(this.timeValue)
this.newDate()
this.getCarData()
@@ -793,11 +883,11 @@
// })
},
methods: {
- handleRemove(file, fileList) {
+ handleRemove (file, fileList) {
// console.log(file, fileList)
},
- handleChange(file, fileList) {
- var str = file.name //���������4���
+ handleChange (file, fileList) {
+ var str = file.name // ���������4���
let a = str.substring(str.length - 3)
// console.log(a)
if (a === 'png') {
@@ -809,7 +899,7 @@
}
// console.log(file.name, 'file')
},
- insLuDuan() {
+ insLuDuan () {
// if (this.startL == '') {
// this.$message({
// message: '���������������������',
@@ -826,14 +916,14 @@
if (this.Lname == '') {
this.$message({
message: '������������������',
- type: 'warning',
+ type: 'warning'
})
return false
}
if (this.tableData.length === 0) {
this.$message({
message: '���������������',
- type: 'warning',
+ type: 'warning'
})
// console.log(1);
return false
@@ -861,20 +951,20 @@
formData.append(`time3`, times[0])
formData.append(`time4`, times[1])
formData.append(`mac`, this.carMac)
- this.fileList.map((v) => {
+ this.fileList.map(v => {
formData.append(`files`, v.raw)
})
this.$request({
url: 'cruiser/getDailyDustld',
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' }, // ���������������������������������
- data: formData,
- }).then((res) => {
+ data: formData
+ }).then(res => {
console.log(res)
if (res.code === 0) {
this.$message({
message: '������������������',
- type: 'success',
+ type: 'success'
})
this.tableData = []
this.Lname = ''
@@ -882,24 +972,24 @@
})
},
- //������������
- insertL() {
+ // ������������
+ insertL () {
$('.insLu').show()
},
- insqu() {
+ insqu () {
$('.insLu').hide()
this.qnull()
},
- qnull() {
+ qnull () {
// this.startL = ''
// this.endL = ''
this.tableData = []
this.Lname = ''
},
// ������������������
- newTime2(timeArr) {
+ newTime2 (timeArr) {
var arr = []
- timeArr.map((v) => {
+ timeArr.map(v => {
var date = new Date(v)
var y = date.getFullYear()
var m = date.getMonth() + 1
@@ -917,7 +1007,7 @@
return arr
},
// ���������������������
- deviceDetail(mac, item, items, indexs) {
+ deviceDetail (mac, item, items, indexs) {
// console.log('������������������������')
// console.log(mac)
// console.log(item)
@@ -932,7 +1022,7 @@
device: items,
macName: mac,
indexs: indexs,
- items: [items.latitude, items.longitude],
+ items: [items.latitude, items.longitude]
},
query: {
monitorPointInfo: JSON.stringify(item),
@@ -940,65 +1030,65 @@
macName: mac,
indexs: indexs,
items: [items.latitude, items.longitude],
- equipment: 'car',
- },
+ equipment: 'car'
+ }
})
},
// 6���������������
- customLevel() {
+ customLevel () {
this.getStart()
this.dialogFormVisible = false
},
// ���������������������������������
- changeCarData(e) {
+ changeCarData (e) {
this.carMac = e.mac
this.getStart()
},
// ���������������������������
- getCarData() {
+ getCarData () {
this.$request({
url: '/cruiser/selectCruisers',
- method: 'get',
+ method: 'get'
})
- .then((res) => {
+ .then(res => {
this.defaultData = res.data
this.carMac = res.data[0].mac
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
// ������mac������������������������������
- getMacDate() {
+ getMacDate () {
this.isDataList = []
this.$request({
url: '/cruiser/getDates',
method: 'get',
params: {
- mac: this.carMac,
- },
+ mac: this.carMac
+ }
})
- .then((res) => {
+ .then(res => {
for (let i = 0; i < res.data.length; i++) {
// this.isDataList[i].value = res.data.data[i]
// this.isDataList[i].label = res.data.data[i]
// this.isDataList[i] = { value: res.data.data[i], label: res.data.data[i] }
this.isDataList.push({
value: res.data[i],
- label: res.data[i],
+ label: res.data[i]
})
}
})
- .catch((err) => {
+ .catch(err => {
console.log(err)
})
},
// ���������������������������������������
- Rad(d) {
+ Rad (d) {
return (d * Math.PI) / 180.0 // ���������������������������������������������������
},
// ���������������������������������������������������������������������������������������
- GetDistance(lat1, lng1, lat2, lng2) {
+ GetDistance (lat1, lng1, lat2, lng2) {
var radLat1 = this.Rad(lat1)
var radLat2 = this.Rad(lat2)
var a = radLat1 - radLat2
@@ -1019,7 +1109,7 @@
return s
},
// ���������������
- newDate() {
+ newDate () {
var aData = new Date()
var month =
aData.getMonth() < 9
@@ -1029,11 +1119,11 @@
this.sensorDate = aData.getFullYear() + '-' + month + '-' + date
},
// ���������������
- newTime(timeArr) {
+ newTime (timeArr) {
let str = ''
let str2 = ''
this.sensorTime = []
- timeArr.map((v) => {
+ timeArr.map(v => {
v = JSON.stringify(v)
str2 = v.substr(12, 8).split(':')
str2[0] =
@@ -1045,7 +1135,7 @@
})
},
// ������������
- dateChange(e) {
+ dateChange (e) {
if (e === null) {
this.sensorDate = []
} else {
@@ -1079,7 +1169,7 @@
// this.isDisTime = false
// },
// ������������������������
- blurChange() {
+ blurChange () {
// ������������������
this.newTime(this.timeValue)
if (this.view) {
@@ -1092,7 +1182,7 @@
this.getStart()
},
// ���������������������������
- wsStart() {
+ wsStart () {
if (this.ws) {
this.ws.close()
console.log('������ws')
@@ -1140,7 +1230,7 @@
}
},
// ���������������������
- getStart() {
+ getStart () {
this.noneData = false
if (this.ws) {
this.ws.close()
@@ -1159,9 +1249,9 @@
time1: this.sensorDate[0],
time2: this.sensorDate[1],
type: this.sensorKey,
- range: this.inputnum,
- },
- }).then((res) => {
+ range: this.inputnum
+ }
+ }).then(res => {
// console.log(res)
if (!res.data.length) {
this.noneData = true
@@ -1174,7 +1264,7 @@
})
},
// ������������������������
- initStart(res) {
+ initStart (res) {
// console.log(res.data, 'res.data')
this.abc += 1
const that = this
@@ -1234,8 +1324,7 @@
if (value.a21026) point.a21026 = parseInt(value.a21026 - 0 + 5)
if (value.a21004) point.a21004 = parseInt(value.a21004 - 20)
// point.a21004 = parseInt(value.a21004)
- if (value.a21005)
- point.a21005 = parseFloat(value.a21005 - 0 + 0.85).toFixed(3)
+ if (value.a21005) { point.a21005 = parseFloat(value.a21005 - 0 + 0.85).toFixed(3) }
if (value.a05024 < 15) {
point.a05024 = parseInt(value.a05024 + 3)
} else if (value.a05024 > 18) {
@@ -1261,15 +1350,15 @@
point.a05024 = parseInt(value.a05024)
point.a99054 = parseFloat(value.a99054).toFixed(3)
if (value.dustld - 0 >= 0 && value.dustld - 0 < 40) {
- point.dustld = value.dustld - 0 + 170
+ point.dustld = value.dustld - 0 // + 170
} else if (value.dustld - 0 >= 40 && value.dustld - 0 < 60) {
- point.dustld = value.dustld - 0 + 130
+ point.dustld = value.dustld - 0 // + 130
} else if (value.dustld - 0 >= 60 && value.dustld - 0 < 100) {
- point.dustld = value.dustld - 0 + 110
+ point.dustld = value.dustld - 0 // + 110
} else if (value.dustld - 0 >= 100 && value.dustld - 0 < 150) {
- point.dustld = value.dustld - 0 + 70
+ point.dustld = value.dustld - 0 // + 70
} else if (value.dustld - 0 >= 150 && value.dustld - 0 < 180) {
- point.dustld = value.dustld - 0 + 30
+ point.dustld = value.dustld - 0 // + 30
} else {
point.dustld = value.dustld - 0
}
@@ -1298,7 +1387,7 @@
// ������������������
skyColors: ['rgba(186, 0, 255, 0)', 'rgba(186, 0, 255, 0.2)'], // ������������
building: false, // ������������������
- poiText: true, // ������poi������
+ poiText: true // ������poi������
})
that.map.addControl(new BMapGL.NavigationControl3D()) // ������3d������
if (this.responseJSON.length === 0) {
@@ -1311,7 +1400,7 @@
if (that.firstPlayFlag) {
that.map.centerAndZoom(that.centerPoint, that.mapZoom)
that.view = new mapvgl.View({
- map: that.map,
+ map: that.map
})
that.firstPlayFlag = false
} else {
@@ -1324,7 +1413,7 @@
draw(that.sensor, that.viewType, that.carMac)
// drawLine()// ������
drawStartAndEnd() // ���������������������
- function draw(sensor, type, carMac, point) {
+ function draw (sensor, type, carMac, point) {
var levels = getGrading(sensor, type, carMac, point)
$.each(levels, function (index, value) {
var color = value.color
@@ -1338,7 +1427,7 @@
selectedColor: '#ee1111', // ���������������
autoSelect: true, // ������������������������������������������
riseTime: 1800, // ���������������������������
- onClick: (e) => {},
+ onClick: e => {}
})
that.shapeLayer.setData(data)
that.view.addLayer(that.shapeLayer)
@@ -1353,7 +1442,7 @@
}
// ���������������������������������
- function drawPolygon(sensor) {
+ function drawPolygon (sensor) {
$.each(that.showPoints, function (item, point) {
var sw = getPoint(225, point.lng, point.lat, that.distance)
var ne = getPoint(45, point.lng, point.lat, that.distance)
@@ -1365,7 +1454,7 @@
new BMapGL.Point(sw.lng, sw.lat), // ���������
new BMapGL.Point(ne.lng, sw.lat), // ���������
new BMapGL.Point(ne.lng, ne.lat), // ���������
- new BMapGL.Point(sw.lng, ne.lat), // ���������
+ new BMapGL.Point(sw.lng, ne.lat) // ���������
],
{ strokeWeight: 0.5, strokeOpacity: 0.0, fillColor: color }
)
@@ -1376,14 +1465,14 @@
}
// ���������������������
- function drawStartAndEnd() {
+ function drawStartAndEnd () {
var startIcon = new BMapGL.Icon(
require('@/assets/images/start.png'),
new BMapGL.Size(48, 48)
)
var startMark = new BMapGL.Marker(that.showPoints[0], {
icon: startIcon,
- offset: new BMapGL.Size(0, -20),
+ offset: new BMapGL.Size(0, -20)
})
that.map.addOverlay(startMark)
var endIcon = new BMapGL.Icon(
@@ -1394,14 +1483,14 @@
that.showPoints[that.showPoints.length - 1],
{
icon: endIcon,
- offset: new BMapGL.Size(0, -20),
+ offset: new BMapGL.Size(0, -20)
}
)
that.map.addOverlay(endMark)
}
// ���������������������
- function drawLine() {
+ function drawLine () {
var data = []
var points = []
$.each(trackPoints, function (index, value) {
@@ -1412,8 +1501,8 @@
data.push({
geometry: {
type: '"LineString"',
- coordinates: [points],
- },
+ coordinates: [points]
+ }
})
var lineLayer = new mapvgl.LineLayer({
color: 'red',
@@ -1421,14 +1510,14 @@
animation: true,
duration: 10, // ������������2s
trailLength: 0.1, // ������������������������0.4
- interval: 0.3, // ���������������������������������0.2
+ interval: 0.3 // ���������������������������������0.2
})
that.view.addLayer(lineLayer)
lineLayer.setData(data)
}
// ������������>=size���������points
- function getShowPoints(size) {
+ function getShowPoints (size) {
var points = []
points.push(trackPoints[0])
for (var i = 1; i < trackPoints.length; i++) {
@@ -1453,7 +1542,7 @@
}
// ���������������������������������������
- function getPoint(angle, lng, lat, distance) {
+ function getPoint (angle, lng, lat, distance) {
var EARTH_RADIUS = 6378137
// ���������������������������������������
var ra = distance / EARTH_RADIUS
@@ -1478,7 +1567,7 @@
return new BMapGL.Point(lng, lat)
}
- function getGrading(sensor, type, carMac) {
+ function getGrading (sensor, type, carMac) {
var levels = []
var level0 = {}
var level1 = {}
@@ -1541,77 +1630,77 @@
data0.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
case 1:
data1.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
case 2:
data2.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
case 3:
data3.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
case 4:
data4.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
case 5:
data5.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
case 6:
data6.push({
geometry: {
type: 'Polygon',
- coordinates: [polygon],
+ coordinates: [polygon]
},
properties: {
- height: height,
- },
+ height: height
+ }
})
break
}
@@ -1626,7 +1715,7 @@
levels.push(level0, level1, level2, level3, level4, level5, level6)
return levels
}
- function getColorAndLevel(senosor, data) {
+ function getColorAndLevel (senosor, data) {
var levelData = that.sensorTableData
var colorAndLevel = {}
var color
@@ -1807,12 +1896,12 @@
}
// point���������label������
- function setLabelStyle(content, point) {
+ function setLabelStyle (content, point) {
var label = new BMapGL.Label(
`<span class="my-maptip" data-times="${point.times}">${content}<span>`, // ���lable������������
{
offset: new BMapGL.Size(-8, -10), // label������������������������label������������������������
- position: point,
+ position: point
}
)
// label���������
@@ -1830,9 +1919,9 @@
lineHeight: '20px',
fontFamily: '������������',
backgroundColor: '0.05',
- fontWeight: 'bold',
+ fontWeight: 'bold'
}
- label.addEventListener('click', (e) => {
+ label.addEventListener('click', e => {
// console.log(e)
// var ps = e.target.latLng.lat
// var ps1 = e.target.latLng.lng
@@ -1861,8 +1950,8 @@
label.setStyle(labelStyle)
that.map.addOverlay(label)
}
- //���������������������������
- function comparedate(date1, date2) {
+ // ���������������������������
+ function comparedate (date1, date2) {
let oDate1 = new Date(date1)
let oDate2 = new Date(date2)
if (oDate1.getTime() > oDate2.getTime()) {
@@ -1880,7 +1969,7 @@
}
// ������������,������������������
- function showNoPoints() {
+ function showNoPoints () {
that.map.centerAndZoom('���������', 17)
setTimeout(function () {
document.getElementById('cpm').style.display = 'block'
@@ -1900,7 +1989,7 @@
})
// var that = this
- function clickChange() {
+ function clickChange () {
$('.carTop').on('click', () => {
// console.log('���������')
that.view.removeAllLayers()
@@ -1929,7 +2018,7 @@
clickChange()
}
},
- changeCode(index) {
+ changeCode (index) {
this.changeColor = index
// var pr = ''
switch (index) {
@@ -1971,7 +2060,7 @@
})
this.initStart()
},
- changeCode1(index) {
+ changeCode1 (index) {
this.changeColor1 = index
if (index === 0) {
this.viewKey = '2D'
@@ -1979,8 +2068,8 @@
this.viewKey = '3D'
}
this.getStart()
- },
- },
+ }
+ }
}
</script>
<style lang="less" scoped>
--
Gitblit v1.8.0