From ea79643ffd2d0c4548a5de4a90ae8bfbfeb67c95 Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Thu, 04 Aug 2022 11:55:24 +0800
Subject: [PATCH] 农场页面物联网接口

---
 src/views/farm/index.vue |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/views/farm/index.vue b/src/views/farm/index.vue
index 9340d6a..779c7ea 100644
--- a/src/views/farm/index.vue
+++ b/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
+                }
+            })
         }
     }
 }

--
Gitblit v1.9.3