|
@@ -12,7 +12,12 @@
|
|
|
<el-carousel-item v-for="(item,idx) in sensorlist" :key="idx" class="carousel-item" height="100%">
|
|
|
<div class="wave-item">
|
|
|
<div class="waveChart-title">{{ item.goafDevTypename }}【{{ item.goafDevName }}】上的传感器{{ item.goafSensorName }}</div>
|
|
|
- <WaveChart :ref="'wave-chart-'+idx" key="idx" :chart-id="'wave-chart-'+idx" />
|
|
|
+ <div class="chart-box">
|
|
|
+ <div class="sensorTemperature">
|
|
|
+ <span>{{ item.sensorTemperature }}℃</span>
|
|
|
+ </div>
|
|
|
+ <WaveChart :ref="'wave-chart-'+idx" key="idx" :chart-id="'wave-chart-'+idx" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
@@ -56,6 +61,7 @@ export default {
|
|
|
return {
|
|
|
reportData: [],
|
|
|
sensorlist: [],
|
|
|
+ timer: null,
|
|
|
WarniStatisticsdata: {
|
|
|
fish: 100
|
|
|
}
|
|
@@ -64,6 +70,11 @@ export default {
|
|
|
created() {
|
|
|
this.init()
|
|
|
},
|
|
|
+ destroyed() {
|
|
|
+ if (this.timer) {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
init() {
|
|
|
this.initChart()
|
|
@@ -102,16 +113,32 @@ export default {
|
|
|
if (this.sensorlist.length < 1) return
|
|
|
const params = this.sensorlist[index]
|
|
|
const chartName = 'wave-chart-' + index
|
|
|
+ const self = this
|
|
|
getWavedata(params.goafDataId).then((resp) => {
|
|
|
const { data } = resp
|
|
|
- const x = data.tdWaveValueX.split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
- const y = data.tdWaveValueY.split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
- const z = data.tdWaveValueZ.split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
+ const x = data.tdWaveValueX.substr(0, data.tdWaveValueX.length - 1).split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
+ const y = data.tdWaveValueY.substr(0, data.tdWaveValueY.length - 1).split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
+ const z = data.tdWaveValueZ.substr(0, data.tdWaveValueZ.length - 1).split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
const params = { x, y, z }
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs[chartName][0].show(params)
|
|
|
})
|
|
|
})
|
|
|
+ if (this.timer) {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ }
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ getWavedata(params.goafDataId).then((resp) => {
|
|
|
+ const { data } = resp
|
|
|
+ const x = data.tdWaveValueX.substr(0, data.tdWaveValueX.length - 1).split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
+ const y = data.tdWaveValueY.substr(0, data.tdWaveValueY.length - 1).split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
+ const z = data.tdWaveValueZ.substr(0, data.tdWaveValueZ.length - 1).split(',').map(item => parseFloat((item / 100).toFixed(2)))
|
|
|
+ const params = { x, y, z }
|
|
|
+ self.$nextTick(() => {
|
|
|
+ self.$refs[chartName][0].show(params)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }, 1000 * 60 * 30)
|
|
|
},
|
|
|
mqttResponse(topic, message) {
|
|
|
if (!message.includes('{')) {
|
|
@@ -150,9 +177,9 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
flex-direction: column;
|
|
|
- overflow-y: auto;
|
|
|
box-sizing: border-box;
|
|
|
- overflow-x: hidden;
|
|
|
+ // overflow-y: auto;
|
|
|
+ // overflow-x: hidden;
|
|
|
&.side-left{
|
|
|
min-width: 432px;
|
|
|
}
|
|
@@ -356,31 +383,50 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.main{
|
|
|
- // width: 46.68%;
|
|
|
height: 100%;
|
|
|
width: 835px;
|
|
|
box-sizing: border-box;
|
|
|
- // padding: 0 14px;
|
|
|
.map-component{
|
|
|
height: 66.6%;
|
|
|
+ height: calc(100% - 351px);
|
|
|
}
|
|
|
.wave-wrap{
|
|
|
- height: 33.3%;
|
|
|
+ height: 350px;
|
|
|
box-shadow: 0 0 3px rgb(133, 132, 132);
|
|
|
border-top: 1px solid #eaeaea;
|
|
|
background-color: #fff;
|
|
|
+ overflow-y: auto;
|
|
|
+ box-sizing: border-box;
|
|
|
.waveChart-title{
|
|
|
width: 100%;
|
|
|
- position: absolute;
|
|
|
- background-color: #d1cfcf;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
color: #000;
|
|
|
- padding: 10px;
|
|
|
text-align: center;
|
|
|
- box-sizing: border-box;
|
|
|
+ box-shadow: 2px 4px 8px rgba(0,0,0,0.6);
|
|
|
}
|
|
|
.wave-item{
|
|
|
height: 100%;
|
|
|
- background-color: #fff
|
|
|
+ height: 350px;
|
|
|
+ background-color: #fff;
|
|
|
+ .chart-box{
|
|
|
+ height: 300px;
|
|
|
+ padding-top: 5px;
|
|
|
+ position: relative;
|
|
|
+ .sensorTemperature{
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ width: 40px;
|
|
|
+ padding-bottom: 50px;
|
|
|
+ position: absolute;
|
|
|
+ top: 125px;
|
|
|
+ right: 2px;
|
|
|
+ background-image: url(./images/home/thermometer.png);
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: bottom center;
|
|
|
+ background-size: 50px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|