智慧农业大数据平台
guoshilong
2022-08-19 8ea122ff1ec010e9819a55f6750c4cfd513b9945
农场选择,已注释
1 files modified
47 ■■■■■ changed files
src/views/equipment/index.vue 47 ●●●●● patch | view | raw | blame | history
src/views/equipment/index.vue
@@ -21,6 +21,20 @@
                        :value="item.id"
                    ></el-option>
                </el-select>
<!--
                <el-select
                    class="equipment-plot-select"
                    v-model="farmName"
                    placeholder="选择地块"
                    @change="farmChangeValue($event)"
                >
                    <el-option
                        v-for="(item, index) in farmList"
                        :key="index"
                        :label="item.farmName"
                        :value="item.id"
                    ></el-option>
                </el-select> -->
            </div>
        </div>
@@ -207,6 +221,9 @@
    getLandList
} from '@/api/land/land'
import {
    getFarmList
} from '@/api/farm/farmingrecord'
import {
    getStationAndVideoByLandId,
    getStationDateByStcd
} from '@/api/equipment/equipment'
@@ -220,6 +237,9 @@
            plotNameObj: {},
            plotName: '',
            plotList: [],
            farmNameObj:{},
            farmName:"",
            farmList:[],
            currentDetails: {},
            echartsBosShow: false,
            vidList: [],
@@ -233,6 +253,7 @@
    created () {
        this.getParams()
        this.getLandList()
        // this.getFarmList()
    },
    mounted () {
@@ -394,6 +415,32 @@
                this.getStationAndVideoByLandId(this.plotNameObj.id, 'ALL')
            })
        },
        // farmChangeValue(value){
        //     this.getStationAndVideoByFarmId(value,'ALL')
        // },
        // getFarmList(){
        //     getFarmList().then((res)=>{
        //         this.farmList = res.data.data
        //         this.farmNameObj = this.farmList[0]
        //         this.farmName = this.farmNameObj
        //     })
        //     // this.getStationAndVideoByFarmId(this.farmNameObj.id,'ALL')
        // },
        // getStationAndVideoByFarmId(id,type){
        //     this.vidList = []
        //     this.staList = []
        //     var landList = []
        //     getLandList(id).then((res)=>{
        //         landList = res.data.data
        //         landList.forEach((e)=>{
        //             getStationAndVideoByLandId(e.id,type).then((res)=>{
        //                 this.vidList.push(res.data.data.vidList)
        //                 this.staList.push(res.data.data.staList)
        //             })
        //         })
        //     })
        // },
        // 根据地块id查询监控和监测设备
        getStationAndVideoByLandId (id, type) {
            getStationAndVideoByLandId(id, type).then((res) => {