From 46b328deebfc604ecfe6e34afe08403d95356614 Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Wed, 12 Apr 2023 09:52:51 +0800
Subject: [PATCH] 1、设备详情显示修改 2、监测因子对比改成监测因子相关性对比 3、监测因子相关性对比显示修改
---
src/views/car/index.vue | 186 ++++++++++++++++++++++++++++------------------
1 files changed, 113 insertions(+), 73 deletions(-)
diff --git a/src/views/car/index.vue b/src/views/car/index.vue
index d3ac8e8..58540b7 100644
--- a/src/views/car/index.vue
+++ b/src/views/car/index.vue
@@ -136,7 +136,7 @@
������������������������(���������������)
</div>
</el-upload>
- <div style="display: flex">
+ <!-- <div style="display: flex">
<span class="statspan">������������������:</span
><el-input v-model="startL" style="width: 12rem"></el-input>
</div>
@@ -154,6 +154,30 @@
<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>
+ </div> -->
+ <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">
+ <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
+ 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>
</div>
</div>
@@ -464,6 +488,7 @@
components: { index },
data() {
return {
+ tableData: [],
fileList: [],
file: '',
insdialogVisible: false,
@@ -541,7 +566,6 @@
}
},
},
-<<<<<<< HEAD
timeOne: '',
threeOptions: {
onPick: ({ maxDate, minDate }) => {
@@ -565,8 +589,6 @@
}
},
},
-=======
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
sensorDate: null,
noneData: false,
defaultData: [],
@@ -691,6 +713,7 @@
endTime: '',
dataDate: '',
sensorTime: [],
+ Lu: [],
startL: '',
Lname: '',
endL: '',
@@ -765,34 +788,66 @@
// console.log(file, fileList)
},
handleChange(file, fileList) {
- this.file = file
- console.log(this.file.raw)
- this.fileList = fileList
+ var str = file.name //���������4���
+ let a = str.substring(str.length - 3)
+ // console.log(a)
+ if (a === 'png') {
+ this.file = file.raw
+ console.log(this.file.raw)
+ this.fileList = fileList
+ } else {
+ this.$message('���������png���������������')
+ }
+ // console.log(file.name, 'file')
},
insLuDuan() {
- if (this.startL == '') {
- this.$message({
- message: '���������������������',
- type: 'warning',
- })
- return false
- } else if (this.endL == '') {
- this.$message({
- message: '���������������������',
- type: 'warning',
- })
- return false
- } else if (this.Lname == '') {
+ // if (this.startL == '') {
+ // this.$message({
+ // message: '���������������������',
+ // type: 'warning',
+ // })
+ // return false
+ // } else if (this.endL == '') {
+ // this.$message({
+ // message: '���������������������',
+ // type: 'warning',
+ // })
+ // return false
+ // } else
+ if (this.Lname == '') {
this.$message({
message: '������������������',
type: 'warning',
})
return false
}
+ if (this.tableData.length === 0) {
+ this.$message({
+ message: '���������������',
+ type: 'warning',
+ })
+ // console.log(1);
+ return false
+ }
+ // console.log(this.tableData);
var times = this.newTime2(this.dateValue)
const formData = new FormData()
- formData.append(`time1`, this.startL)
- formData.append(`time2`, this.endL)
+ let pv = JSON.stringify(this.tableData)
+ // let big = {
+ // table: pv,
+ // road: this.Lname,
+ // time3: times[0],
+ // time4: times[1],
+ // mac: this.carMac,
+ // files: this.file,
+ // }
+ // console.log(big)
+
+ // console.log(pv);
+ // formData.append(`time1`, this.startL)
+ // formData.append(`time2`, this.endL)
+
+ formData.append(`table`, pv)
formData.append(`road`, this.Lname)
formData.append(`time3`, times[0])
formData.append(`time4`, times[1])
@@ -812,8 +867,7 @@
message: '������������������',
type: 'success',
})
- this.startL = ''
- this.endL = ''
+ this.tableData = []
this.Lname = ''
}
})
@@ -828,8 +882,9 @@
this.qnull()
},
qnull() {
- this.startL = ''
- this.endL = ''
+ // this.startL = ''
+ // this.endL = ''
+ this.tableData = []
this.Lname = ''
},
// ������������������
@@ -1148,7 +1203,6 @@
timeArrSub[i] = v.split(' ')[0]
if (i === 1) timeArrSub[2] = v.split(' ')[1]
})
-<<<<<<< HEAD
if (
that.carMac === 'p5dnd7a0243626' &&
timeArrSub[0] === '2022-12-11' &&
@@ -1156,36 +1210,25 @@
(timeArrSub[1] === '2022-12-12' &&
timeArrSub[2] === '00:00:00'))
) {
-=======
- if (that.carMac === 'p5dnd7a0243626' && timeArrSub[0] === '2022-12-11' && (timeArrSub[1] === '2022-12-11' || timeArrSub[1] === '2022-12-12' && timeArrSub[2] === '00:00:00')) {
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
if (value.a34004) point.a34004 = parseInt(value.a34004 * 2.7)
if (value.a34002) point.a34002 = parseInt(value.a34002 * 2.2)
if (value.a21026) point.a21026 = parseInt(value.a21026 - 0 + 5)
if (value.a21004) point.a21004 = parseInt(value.a21004 - 20)
// point.a21004 = parseInt(value.a21004)
-<<<<<<< HEAD
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)
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
if (value.a05024 < 15) {
point.a05024 = parseInt(value.a05024 + 3)
} else if (value.a05024 > 18) {
point.a05024 = parseInt(value.a05024 - 3)
} else point.a05024 = parseInt(value.a05024)
point.a99054 = parseFloat(value.a99054).toFixed(3)
-<<<<<<< HEAD
if (
value.dustld - 0 !== 0 &&
value.dustld - 0 < 100 &&
(that.carMac === 'p5dnd7a0243622' ||
that.carMac === 'p5dnd7a0243625')
) {
-=======
- if (value.dustld - 0 !== 0 && value.dustld - 0 < 100 && (that.carMac === 'p5dnd7a0243622' || that.carMac === 'p5dnd7a0243625')) {
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
point.dustld = 100
} else {
point.dustld = value.dustld - 0
@@ -1198,37 +1241,19 @@
point.a21005 = parseFloat(value.a21005).toFixed(3)
point.a05024 = parseInt(value.a05024)
point.a99054 = parseFloat(value.a99054).toFixed(3)
-<<<<<<< HEAD
if (
value.dustld - 0 !== 0 &&
value.dustld - 0 < 100 &&
(that.carMac === 'p5dnd7a0243622' ||
that.carMac === 'p5dnd7a0243625')
) {
-=======
- if (value.dustld - 0 !== 0 && value.dustld - 0 < 100 && (that.carMac === 'p5dnd7a0243622' || that.carMac === 'p5dnd7a0243625')) {
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
point.dustld = 100
} else {
point.dustld = value.dustld - 0
}
}
-<<<<<<< HEAD
-=======
- // point.a34004 = parseInt(value.a34004)
- // point.a34002 = parseInt(value.a34002)
- // point.a21026 = parseInt(value.a21026)
- // point.a21004 = parseInt(value.a21004)
- // point.a21005 = parseFloat(value.a21005).toFixed(3)
- // point.a05024 = parseInt(value.a05024)
- // point.a99054 = parseFloat(value.a99054).toFixed(3)
- // if (value.dustld - 0 !== 0 && value.dustld - 0 < 100 && (that.carMac === 'p5dnd7a0243622' || that.carMac === 'p5dnd7a0243625')) {
- // point.dustld = 100
- // } else {
- // point.dustld = value.dustld - 0
- // }
// point.dustld = value.dustld - 0
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
+ point.times = value.time
trackPoints.push(point)
}
})
@@ -1291,13 +1316,7 @@
selectedColor: '#ee1111', // ���������������
autoSelect: true, // ������������������������������������������
riseTime: 1800, // ���������������������������
-<<<<<<< HEAD
onClick: (e) => {},
-=======
- onClick: (e) => {
- // console.log(e)
- },
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
})
that.shapeLayer.setData(data)
that.view.addLayer(that.shapeLayer)
@@ -1430,11 +1449,7 @@
// ���������������10���������������
lng = (lng * 180) / Math.PI
lat = (lat * 180) / Math.PI
-<<<<<<< HEAD
// console.log(lng, lat,123)
-=======
- // console.log(lng, lat)
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
return new BMapGL.Point(lng, lat)
}
@@ -1792,26 +1807,51 @@
backgroundColor: '0.05',
fontWeight: 'bold',
}
-<<<<<<< HEAD
label.addEventListener('click', (e) => {
- console.log(e)
+ // console.log(e)
// var ps = e.target.latLng.lat
// var ps1 = e.target.latLng.lng
// var p1 = new BMap.Point(ps1, ps);
// var marker = new BMap.Marker(p1);;
// that.map.addOverlay(marker);
var times = e.target.domElement.children[0].getAttribute('data-times')
- console.log(times)
+ // console.log(times)
if (that.startL == '') {
that.startL = times
+ // that.Lu.startLu.push(that.startL)
+ // console.log(that.Lu.startLu, 'start')
} else {
+ // that.tableData=[]
that.endL = times
+ comparedate(that.startL, that.endL)
+ // var endLu = []
+ // that.Lu.endLu.push(that.endL)
+ // console.log(that.Lu.endLu, 'end')
+ // that.startL = ''
+ // that.endL = ''
+ // that.tableData.push(that.Lu)
+ // console.log(that.tableData, 'table')
}
})
-=======
->>>>>>> 5bbcdadbb201985f7bafcc60bd679d9e6f0e4229
label.setStyle(labelStyle)
that.map.addOverlay(label)
+ }
+ //���������������������������
+ function comparedate(date1, date2) {
+ let oDate1 = new Date(date1)
+ let oDate2 = new Date(date2)
+ if (oDate1.getTime() > oDate2.getTime()) {
+ that.startL = ''
+ that.endL = ''
+ that.$message('���������������������������������������������������')
+ return false
+ } else if (oDate1.getTime() < oDate2.getTime()) {
+ var cardNumObj = { start: that.startL, end: that.endL }
+ that.tableData.push(cardNumObj)
+ console.log(that.tableData, 'that.tableData')
+ that.startL = ''
+ that.endL = ''
+ }
}
// ������������,������������������
@@ -2095,7 +2135,7 @@
border: 1px solid white;
background-color: white;
width: 20rem;
- height: 23rem;
+ height: 30rem;
position: absolute;
top: 3rem;
left: 1rem;
--
Gitblit v1.8.0