Selaa lähdekoodia

Merge remote-tracking branch 'origin/visu_resources_01_siping_2.5d' into visu_resources_01_siping_2.5d

王通 2 vuotta sitten
vanhempi
commit
0dfac8be31
4 muutettua tiedostoa jossa 202 lisäystä ja 53 poistoa
  1. 42 3
      src/api/tianzhangzhi.js
  2. 39 0
      src/components/supermap-2.5d.vue
  3. 3 19
      src/views/monitor.vue
  4. 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',
   })
 }

+ 39 - 0
src/components/supermap-2.5d.vue

@@ -101,6 +101,45 @@
         that.createRightClickDescription();
       },
       /**
+       * 地图落点
+       */
+      setMarkersRadius(makerList){
+        let that = this;
+        that.handler = new Cesium.ScreenSpaceEventHandler(this.scene.canvas);
+        clearInterval(that.aac);
+        for (let i in makerList) {
+          let longitude = makerList[i].lng;
+          let latitude = makerList[i].lat;
+          that.viewer.entities.add({
+            name:"",
+            position: Cesium.Cartesian3.fromDegrees(longitude, latitude),
+            billboard: {
+              image: iconList[makerList[i].icon],
+              width: 48,
+              height: 48,
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+              disableDepthTestDistance:Number.POSITIVE_INFINITY
+            },
+            description: makerList[i].bindPopupHtml,
+            click: makerList[i].click,
+            parameter: makerList[i].parameter,
+            ellipse: {
+              semiMinorAxis:makerList[i].radius,
+              semiMajorAxis: makerList[i].radius,
+              height: 0.0,
+              material: Cesium.Color.RED.withAlpha(0),
+              outline: true,
+              outlineColor: Cesium.Color.BLUE.withAlpha(0.5),
+              outlineWidth: 2,
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+            },
+          });
+        }
+        that.viewer.scene.globe.depthTestAgainstTerrain=false;
+        that.createLeftClickDescription();
+        that.createRightClickDescription();
+      },
+      /**
        *鼠标左击事件是原来的气泡
        */
       createLeftClickDescription() {

+ 3 - 19
src/views/monitor.vue

@@ -221,8 +221,8 @@ export default {
     this.bottomMenuList() //获取底部公共组件消息和任务
     this.getTreeselect()
     this.deptId = Cookies.get("deptId")
-    this.getSensorListByDeptId()
-    this.getDlblistBydeptId()
+    // this.getSensorListByDeptId()
+    // this.getDlblistBydeptId()
     this.selectDeviceType(-1)
   },
   data() {
@@ -702,7 +702,7 @@ export default {
           setTimeout(() => {
             that.$refs.supermap.clearM()
             that.$refs.supermap.setMarkers(this.cameraMarkersList)
-          }, 1000)
+          }, 3000)
         }
       })
     },
@@ -777,22 +777,6 @@ export default {
               '                </span>' +
               '</div>'
             this.cameraMarkersList.push(markersMap)
-            //   cameraAccount: "1"
-            // cameraCode: "1000010"
-            // cameraFactory: "2"
-            // cameraIp: "1"
-            // cameraName: "2"
-            // cameraPasword: "2"
-            // cameraPort: 2
-            // cameraRadius: 20
-            // cameraRegion: "3"
-            // dataDeptId: null
-            // dataStatus: null
-            // eventType: null
-            // height: "11"
-            // id: "0d165fc362514f79b12a899ea66295fd"
-            // latitude: "49.325625"
-            // longitude: "125.3333"
           }
           setTimeout(() => {
             that.$refs.supermap.clearM()

+ 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>
@@ -66,7 +74,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>
@@ -87,7 +95,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>
@@ -107,7 +115,15 @@
 
 <script>
 import {
-  getTianzhangList,selectVisuGridLength,selectGridLandInfo,remoteGetRegionalFlag
+  getTianzhangList,
+  selectVisuGridLength,
+  selectGridLandInfo,
+  getTianList,
+  getFlagList,
+  getGridList,
+  getFarmList,
+  getLandList,
+  remoteGetRegionalFlag
 } from '@/api/tianzhangzhi'
 
 import supermap from '@/components/supermap-2.5d' //超图
@@ -129,61 +145,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()//获取任务列表