修改报警请求间隔

master
夜笙歌 2 years ago
parent 71146bb034
commit 5ac5d797e3

@ -79,7 +79,7 @@
<img src="../assets/icons/highTemperature.png"
style="width: 40px;height: 40px;left: 0px;position: absolute">
<div style="width: 60%;margin-left: 30%;">
<div>{{ warningInfo.istemperaturehigh }}</div>
<div>{{ warningInfo?.istemperaturehigh }}</div>
<div>高温预警</div>
</div>
</div>
@ -87,7 +87,7 @@
<img src="../assets/icons/highTemperature.png"
style="width: 40px;height: 40px;left: 0px;position: absolute">
<div style="width: 60%;margin-left: 30%;">
<div>{{ warningInfo.ispresshigh }}</div>
<div>{{ warningInfo?.ispresshigh }}</div>
<div>高压预警</div>
</div>
</div>
@ -95,7 +95,7 @@
<img src="../assets/icons/highTemperature.png"
style="width: 40px;height: 40px;left: 0px;position: absolute">
<div style="width: 60%;margin-left: 30%;">
<div>{{ warningInfo.ispresslower }}</div>
<div>{{ warningInfo?.ispresslower }}</div>
<div>低压预警</div>
</div>
</div>
@ -103,7 +103,7 @@
<img src="../assets/icons/highTemperature.png"
style="width: 40px;height: 40px;left: 0px;position: absolute">
<div style="width: 60%;margin-left: 30%;">
<div>{{ warningInfo.ispowerinvalue }}</div>
<div>{{ warningInfo?.ispowerinvalue }}</div>
<div>低电压预警</div>
</div>
</div>
@ -120,17 +120,17 @@
<img src="../assets/icons/highTemperature.png"
style="width: 40px;height: 40px;position: absolute;top: 10px;left: 0px">
<div style="position: absolute;top: 10px;left: 50px;font-size: 16px">
{{ i.ispresslower === 1 ? '低压' : '' }}
{{ i.ispresshigh === 1 ? '高压' : '' }} {{ i.istemperaturehigh === 1 ? '高温' : '' }}
{{ i.ispowerinvalue === 1 ? '低电压' : '' }}
{{ i?.ispresslower === 1 ? '低压' : '' }}
{{ i?.ispresshigh === 1 ? '高压' : '' }} {{ i?.istemperaturehigh === 1 ? '高温' : '' }}
{{ i?.ispowerinvalue === 1 ? '低电压' : '' }}
</div>
<div style="position: absolute;top:50px;left: 0px">{{ i.createTime }}</div>
<div style="position: absolute;top:70px;left: 0px">传感器id{{ i.sensorid }}</div>
<div style="position: absolute;top: 10px;right: 0px;font-size: 24px">{{ i.carLicense }}</div>
<div style="position: absolute;top:50px;left: 0px">{{ i?.createTime }}</div>
<div style="position: absolute;top:70px;left: 0px">传感器id{{ i?.sensorid }}</div>
<div style="position: absolute;top: 10px;right: 0px;font-size: 24px">{{ i?.carLicense }}</div>
<div style="position: absolute;top: 50px;right: 0px">
{{ i.tyreposition?.split('-')[0] }}{{
i.tyreposition?.split('-')[1] === '1' ? '左' : '右'
}}{{ i.tyreposition?.split('-')[2] === '1' ? '外' : '内' }}
{{ i?.tyreposition?.split('-')[0] }}{{
i?.tyreposition?.split('-')[1] === '1' ? '左' : '右'
}}{{ i?.tyreposition?.split('-')[2] === '1' ? '外' : '内' }}
</div>
<div
style="width: 100%;border-top: 1px solid #aaa;margin: 10px 0;position:absolute;top: 100px"></div>
@ -220,21 +220,25 @@ export default {
let domList = this.$refs.warningRef
let domParent = this.$refs.warningRefP
let listLength = Math.floor(domParent.clientHeight / 120)
this.warringWaitList = []
this.warringList = []
let i = 1
let timeout = null
let first = false
let timeoutF = () => {
timeout = setInterval(() => {
if (i >= listLength) {
first = true
clearInterval(timeout)
}
this.warringList.splice(this.warringList.length, 0, this.warringWaitList.splice(0, 1)[0])
if(this.warringWaitList.length > 0) {
this.warringList.splice(this.warringList.length, 0, this.warringWaitList.splice(0, 1)[0])
}
i++
}, 1000)
}
timeoutF()
setInterval(() => {
if (this.warringWaitList.length > 0) {
if (first && this.warringWaitList.length > 0) {
this.warringList.splice(1, 0)
this.warringList.splice(this.warringList.length, 0, this.warringWaitList.splice(0, 1)[0])
}
@ -245,9 +249,9 @@ export default {
// domParent.scrollTop += 100
})
setInterval(()=>{
setInterval(() => {
this.setInfo()
},6*1000*1000)
}, 6 * 1000 * 1000)
// })
},
beforeDestroy() {

@ -36,8 +36,8 @@ export default defineConfig(({mode, command}) => {
'/dev-api': {
// target: 'https://ticptest.tercelo.com/dev-api',
// target: 'http://47.94.93.46/dev-api',
// target: 'http://10.11.41.249:8080',
target: 'http://localhost:8080',
target: 'http://10.11.41.249:8080',
// target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}

Loading…
Cancel
Save