JX.LI il y a 2 ans
Parent
commit
3de76b7873
2 fichiers modifiés avec 160 ajouts et 34 suppressions
  1. 42 3
      src/api/tianzhangzhi.js
  2. 118 31
      src/views/tianzhangzhi.vue

+ 42 - 3
src/api/tianzhangzhi.js

@@ -1,5 +1,44 @@
 import request from '@/utils/request'
 
+export function getFlagList(param) {
+  return request({
+    url: '/center-resources/VisuForestDataCenterController/getFlagList',
+    method: 'post',
+    data: param
+  })
+}
+export function getFarmList(param) {
+  return request({
+    url: '/center-resources/VisuForestDataCenterController/getFarmList',
+    method: 'post',
+    data: param
+  })
+}
+export function getLandList(param) {
+  return request({
+    url: '/center-resources/VisuForestDataCenterController/getLandList',
+    method: 'post',
+    data: param
+  })
+}
+
+export function getGridList(param) {
+  return request({
+    url: '/center-resources/VisuForestDataCenterController/getGridList',
+    method: 'post',
+    data: param
+  })
+}
+
+// 田长列表 NEW
+export function getTianList(param) {
+  return request({
+    url: '/center-resources/VisuForestDataCenterController/getTianList',
+    method: 'post',
+    data: param
+  })
+}
+
 // 获取左侧田长列表
 export function getTianzhangList() {
   return request({
@@ -13,7 +52,7 @@ export function selectVisuGridLength(param) {
   return request({
     url: '/center-resources/VisuForestTianzhangzhiController/selectVisuGridLength',
     method: 'post',
-    data:param
+    data: param
   })
 }
 
@@ -22,14 +61,14 @@ export function selectGridLandInfo(param) {
   return request({
     url: '/center-resources/VisuForestTianzhangzhiController/selectGridLandInfo',
     method: 'post',
-    data:param
+    data: param
   })
 }
 
 // 网格长获取耕地和基本田列表
 export function remoteGetRegionalFlag(id) {
   return request({
-    url: '/center-resources/VisuForestTianzhangzhiController/remoteGetRegionalFlag/'+id,
+    url: '/center-resources/VisuForestTianzhangzhiController/remoteGetRegionalFlag/' + id,
     method: 'get',
   })
 }

+ 118 - 31
src/views/tianzhangzhi.vue

@@ -14,13 +14,21 @@
               <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
             </div>
             <div class="i-list-con h-27">
+              <el-input
+                v-model="name"
+                placeholder="请输入姓名"
+                clearable
+                size="small"
+                prefix-icon="el-icon-search"
+                style="margin-bottom: 20px"
+              />
               <div class="d-l-con-icon">
-                <div class="icon-con" :class="{on:listCurrentIndex1==item.id}"
-                     v-for="(item,index) in visuTianzhangList" @click="selectVisuGridLength(item.id)">
+                <div class="icon-con" :class="{on:listCurrentIndex1==item.gridId}"
+                     v-for="(item,index) in visuTianzhangList2" @click="getGridList(item.gridId)">
                   <div class="icon icon-mid el-icon-user"></div>
                   <div class="icon-text personnel-name">
-                    <h6>姓名:{{ item.tianName }}</h6>
-                    <h6>电话:{{ item.tianPhone }}</h6>
+                    <h6>姓名:{{ item.name }} </h6>
+                    <h6 v-if=" item.phone != undefined">电话:{{ item.phone }}</h6>
                   </div>
                 </div>
               </div>
@@ -37,11 +45,11 @@
             <div class="i-list-con h-27">
               <div class="d-l-con-icon">
                 <div class="icon-con" :class="{on:listCurrentIndex2==item. gridId}"
-                     v-for="(item,index) in visuGridLengthList" @click="selectGridLandInfo(item.gridId)">
+                     v-for="(item,index) in visuGridLengthList" @click="selectGridLandInfo(item)">
                   <div class="icon icon-mid el-icon-user"></div>
                   <div class="icon-text personnel-name">
-                    <h6>网格名称:{{ item.gridName }}</h6>
-                    <h6>网格长:{{ item.gridLengthName }}</h6>
+                    <h6>网格名称:{{ item.gridNetworkName }}</h6>
+                    <!--                    <h6>网格长:{{ item.gridLengthName }}</h6>-->
                   </div>
                 </div>
               </div>
@@ -65,7 +73,7 @@
               <div class="h-19 overflow-y">
                 <div class="d-l-con" :class="{on:listCurrentIndex3==item.id}"
                      v-for="(item,index) in gengdiList"
-                     @click="getPointListByGd(item.id)">
+                     @click="getFlagList(item.id,1)">
                   <div class="d-l-l-text">
                     <i class="i-small"></i>
                     <h4>{{ item.name }}</h4>
@@ -86,7 +94,7 @@
               <div class="h-19 overflow-y">
                 <div class="d-l-con" :class="{on:listCurrentIndex4==item.id}"
                      v-for="(item,index) in yongjiutianList"
-                     @click="getPointListByYjt(item.id)">
+                     @click="getFlagList(item.id,2)">
                   <div class="d-l-l-text">
                     <i class="i-small"></i>
                     <h4>{{ item.name }}</h4>
@@ -106,7 +114,15 @@
 
 <script>
 import {
-  getTianzhangList,selectVisuGridLength,selectGridLandInfo,remoteGetRegionalFlag
+  getTianzhangList,
+  selectVisuGridLength,
+  selectGridLandInfo,
+  getTianList,
+  getFlagList,
+  getGridList,
+  getFarmList,
+  getLandList,
+  remoteGetRegionalFlag
 } from '@/api/tianzhangzhi'
 
 import supermap from '@/components/supermap' //超图
@@ -128,61 +144,132 @@ export default {
     return {
       listCurrentIndex1: '',
       listCurrentIndex2: '',
+      name: '',
       listCurrentIndex3: '',
       listCurrentIndex4: '',
       visuTianzhangList: [], //田长列表
+      visuTianzhangList2: [], //田长列表
       visuGridLengthList: [], //网格网格长列表
       gengdiList: [], //耕地列表
       yongjiutianList: [], //永久田列表
     }
   },
   created() {
-    this.getInit()
+    this.getTianList()
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
     window.showDialog = this.showDialog
     window.choseLayerSwitching = this.choseLayerSwitching
     window.choseLayerSwitchingList = this.choseLayerSwitchingList
     /** ----------------------------------底部按钮公用组件结束------------------------------------- */
   },
-  mounted(){
+  mounted() {
     this.bottomMenuList() //获取底部公共组件消息和任务
   },
+  watch:
+    {
+      name(val) {
+        this.visuTianzhangList2 = [];
+        for (let i in this.visuTianzhangList) {
+          if (this.visuTianzhangList[i].name.indexOf(val) != -1) {
+            this.visuTianzhangList2.push(this.visuTianzhangList[i]);
+          }
+        }
+      }
+    },
   methods: {
-    getPointListByGd(id){
+    selectGridLandInfo(data) {
+      if (data.gridFarmId != undefined) {
+        this.getLandList(data.gridFarmId)
+      }
+      if (data.gridLandId != undefined) {
+        this.getFarmList(data.gridLandId)
+      }
+    },
+    getGridList(gridId) {
+      let that = this
+      getGridList({leadType: "6", gridId: gridId}).then(function (response) {
+        console.log(JSON.stringify(response.data));
+        that.visuGridLengthList = response.data
+      })
+    },
+
+    getLandList(gridLandId) {
+      let that = this
+      getLandList({gridLandId: gridLandId}).then(function (response) {
+        console.log(JSON.stringify(response.data));
+        that.gengdiList = response.data
+      })
+    },
+
+    getFarmList(gridFarmId) {
+      let that = this
+      getFarmList({gridFarmId: gridFarmId}).then(function (response) {
+        console.log(JSON.stringify(response.data));
+        that.yongjiutianList = response.data
+      })
+    },
+
+    getFlagList(id, type) {
+      let that = this
+      getFlagList({id: id}).then(function (response) {
+        console.log(JSON.stringify(response.data));
+
+        that.$refs.supermap.clearG()
+        if (type == 1) {
+
+          that.$refs.supermap.setGraphicsList(response.data, "green")
+        }
+        if (type == 2) {
+
+          that.$refs.supermap.setGraphicsList(response.data, "red")
+        }
+
+      })
+    },
+
+    getTianList() {
+      let that = this
+      getTianList({leadType: "6"}).then(function (response) {
+        console.log(JSON.stringify(response.data));
+        that.visuTianzhangList = response.data
+        that.visuTianzhangList2 = response.data
+      })
+    },
+    getPointListByGd(id) {
       //耕地地图展示区域
       remoteGetRegionalFlag(id).then(res => {
-        this.listCurrentIndex3=id
+        this.listCurrentIndex3 = id
         this.$refs.supermap.clearG()
-        this.$refs.supermap.setGraphicsList(res.data,"green")
+        this.$refs.supermap.setGraphicsList(res.data, "green")
       })
     },
-    getPointListByYjt(id){
+    getPointListByYjt(id) {
       //永久田地图展示区域
       remoteGetRegionalFlag(id).then(res => {
-        this.listCurrentIndex4=id
+        this.listCurrentIndex4 = id
         this.$refs.supermap.clearGTwo()
-        this.$refs.supermap.setGraphicsTwoList(res.data,"red")
+        this.$refs.supermap.setGraphicsTwoList(res.data, "red")
       })
     },
-    selectVisuGridLength(id){
+    selectVisuGridLength(id) {
       //田长获取网格网格长列表
-      selectVisuGridLength({ chiefTianId: id }).then(res => {
+      selectVisuGridLength({chiefTianId: id}).then(res => {
         this.$refs.supermap.clearGTwo()
         this.$refs.supermap.clearG()
         this.visuGridLengthList = res.data
-        this.listCurrentIndex1=id
-      })
-    },
-    selectGridLandInfo(id){
-      //网格获取耕地和基本田列表
-      selectGridLandInfo({ gridId: id }).then(res => {
-        this.$refs.supermap.clearGTwo()
-        this.$refs.supermap.clearG()
-        this.gengdiList = res.data.gd
-        this.yongjiutianList = res.data.yjt
-        this.listCurrentIndex2=id
+        this.listCurrentIndex1 = id
       })
     },
+    // selectGridLandInfo(id) {
+    //   //网格获取耕地和基本田列表
+    //   selectGridLandInfo({gridId: id}).then(res => {
+    //     this.$refs.supermap.clearGTwo()
+    //     this.$refs.supermap.clearG()
+    //     this.gengdiList = res.data.gd
+    //     this.yongjiutianList = res.data.yjt
+    //     this.listCurrentIndex2 = id
+    //   })
+    // },
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
     bottomMenuList() {
       this.$refs.bottomMenu.selectTaskList()//获取任务列表