智慧农业大数据平台
shuishen
2022-08-10 b9ffd276b4fa8ca1918f486e70d7e4d0d04d9d9f
src/views/equipment/index.vue
@@ -69,6 +69,7 @@
                            </ul>
                        </div>
                        <div class="nape-boxs">
                            <!-- 气象监测 -->
                            <div v-for="(item, index) in stationData.weatherList" :key="index">
                                <div class="top">
                                    <div class="l">
@@ -94,6 +95,7 @@
                                    >{{tmpTDiff(item.valueDataList[item.valueDataList.length-1].startTime)}}天前更新</div>
                                </div>
                            </div>
                            <!-- 土壤监测 -->
                            <div v-for="(item, index) in stationData.soliList" :key="index">
                                <div class="top">
                                    <div class="l">
@@ -114,9 +116,12 @@
                                        <span class="old-btn" @click="historyData(item)">历史数据</span>
                                    </div>
                                    <div class="r">{{tmpTDiff(item.valueDataList[item.valueDataList.length-1].startTime)}}天前更新</div>
                                    <div
                                        class="r"
                                    >{{tmpTDiff(item.valueDataList[item.valueDataList.length-1].startTime)}}天前更新</div>
                                </div>
                            </div>
                            <!-- 空气监测 -->
                            <div v-for="(item, index) in stationData.airList" :key="index">
                                <div class="top">
                                    <div class="l">
@@ -137,9 +142,12 @@
                                        <span class="old-btn" @click="historyData(item)">历史数据</span>
                                    </div>
                                    <div class="r">{{tmpTDiff(item.valueDataList[item.valueDataList.length-1].startTime)}}天前更新</div>
                                    <div
                                        class="r"
                                    >{{tmpTDiff(item.valueDataList[item.valueDataList.length-1].startTime)}}天前更新</div>
                                </div>
                            </div>
                            <!-- 水质监测 -->
                            <div v-for="(item, index) in stationData.waterList" :key="index">
                                <div class="top">
                                    <div class="l">
@@ -196,10 +204,12 @@
<script>
import {
    getLandList,
    getStationAndVideoByLandId,
    getStationDateByStcd
    getLandList
} from '@/api/land/land'
import {
 getStationAndVideoByLandId,
    getStationDateByStcd
} from '@/api/equipment/equipment'
import { nextTick } from 'vue'
import flvjs from 'flv.js'
import dateUtils from '@/utils/dateUtils' // 1.先引入
@@ -359,12 +369,12 @@
        },
        historyData (item) {
            var valueDataList = item.valueDataList
            var values = []
            var names = []
            const valueDataList = item.valueDataList
            const values = []
            const names = []
            valueDataList.forEach(item => {
                values.push(item.value)
                names.push(item.startTime.substring(5,10) + ' ' + item.startTime.substring(11) + ':00')
                names.push(item.startTime.substring(5, 10) + ' ' + item.startTime.substring(11) + ':00')
            })
            this.initLine('EchartsBox', '单位' + item.unit, names, values)
@@ -464,7 +474,7 @@
                this.stationData = res.data.data
                if (this.stationData.soilList.length == 0 && this.stationData.weatherList.length == 0 &&
                        this.stationData.airList.length == 0 && this.stationData.waterList.length == 0) {
                    this.stationData.airList.length == 0 && this.stationData.waterList.length == 0) {
                    this.isNostaList = false
                } else {
                    this.isNostaList = true