智慧农业大数据平台
xiebin
2022-08-04 ea79643ffd2d0c4548a5de4a90ae8bfbfeb67c95
农场页面物联网接口
1 files modified
20 ■■■■ changed files
src/views/farm/index.vue 20 ●●●● patch | view | raw | blame | history
src/views/farm/index.vue
@@ -143,9 +143,9 @@
            </div>
            <div v-show="zydksb =='sb'" class="lists-box sb">
                <div>
                <div v-for="(item, index) in equipmentList" :key="index">
                    <div class="title">
                        <img src="/img/icon/jk.png" alt />监控设备
                        <img src="/img/icon/jk.png" alt />{{item.name}}
                    </div>
                    <div class="type off">在线</div>
                </div>
@@ -316,7 +316,8 @@
import {
    getLandList,
    getFarmingRecordList,
    getFarmPlantList
    getFarmPlantList,
    getStationAndVideoList
} from '@/api/farm/farmingrecord'
export default {
@@ -342,7 +343,9 @@
            plotDetailsPlantList: [],
            // 地块详情中的农事操作
            plotDetailsRecordList: [],
            currentClickPlot: {}
            currentClickPlot: {},
            // 物联网设备
            equipmentList: {},
        }
    },
    created () {
@@ -355,6 +358,7 @@
            this.getFarmingRecordList()
            this.getFarmPlantList()
            this.getLandList()
            this.getStationAndVideo()
        })
    },
    methods: {
@@ -473,6 +477,14 @@
                })
                this.plotLists = res.data.data
            })
        },
        getStationAndVideo () {
            var that = this
            getStationAndVideoList({ type: 'ALL',farmId: this.currentDetails.id }).then((res) => {
                if (JSON.stringify(res.data) != '{}' && res.data.data) {
                    that.equipmentList = res.data.data.staList
                }
            })
        }
    }
}