소스 검색

可视化底部林班数据改为后台维护

彭宇 2 년 전
부모
커밋
1faaefb32e
2개의 변경된 파일116개의 추가작업 그리고 92개의 파일을 삭제
  1. 3 3
      src/components/supermap.vue
  2. 113 89
      src/components/vBottomMenu.vue

+ 3 - 3
src/components/supermap.vue

@@ -1451,15 +1451,15 @@
 				if (banCheckList != null && banCheckList.length > 0) {
 					for (let i = 0; i < banCheckList.length; i++) {
 
-            that.deckglLayer = window.L.supermap.tiledMapLayer(banCheckList[i].farmAddress, {})
+            that.deckglLayer = window.L.supermap.tiledMapLayer(banCheckList[i].supermapAddress, {})
             that.deckglLayerList_Data.push(that.deckglLayer)
             that.map.addLayer(that.deckglLayer)
-						if (banCheckList[i].farmAddress != null) {
+						if (banCheckList[i].supermapAddress != null) {
               var getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({
                 queryParameter: {
                   name: banCheckList[i].name,
                 },
-                datasetNames: banCheckList[i].datasetNames,
+                datasetNames: [banCheckList[i].datasetNames],
                 maxFeatures:20000,
                 fromIndex: 0,
                 toIndex: 999999

+ 113 - 89
src/components/vBottomMenu.vue

@@ -57,12 +57,12 @@
                 <!--                  placeholder="输入关键字进行过滤"-->
                 <!--                  v-model="filterbanText">-->
                 <!--                </el-input>-->
-                <el-tree :data="deptOptionsLiandong_baishan" ref="banDept" node-key="id" :check-strictly="true"
+                <el-tree :data="deptBanOptionsLiandong" ref="banDept" node-key="id"  :check-strictly="true"
                          :filter-node-method="filterbanNode" @node-click="handlebanNodeClick" :accordion="true" empty-text="加载中,请稍候"
                          :props="defaultProps"></el-tree>
               </div>
               <div class="forestban-right">
-                <el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="filterban">
+                <el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="filterban" @change="searchFilterban(filterchang)">
                 </el-input>
                 <el-checkbox-group v-model="banCheckList_Data">
                   <el-checkbox v-for="(item,index) in filterbanList" :label="item"
@@ -84,7 +84,7 @@
                 <!--                  placeholder="输入关键字进行过滤"-->
                 <!--                  v-model="filterchangText">-->
                 <!--                </el-input>-->
-                <el-tree :data="deptOptionsLiandong" ref="changDept" node-key="id"
+                <el-tree :data="deptChangOptionsLiandong" ref="changDept" node-key="id"
                          :check-strictly="true" :filter-node-method="filterchangNode"
                          @node-click="handlechangNodeClick" :accordion="true" empty-text="加载中,请稍候"
                          :props="defaultProps"></el-tree>
@@ -359,7 +359,7 @@ import {
   selectMessageById
 } from '@/api/forest'
 import {
-  selectFarmByDeptId
+  selectFarmByDeptId,linBanTreeselect,selectBanBylinBanTreesId
 } from '@/api/vBottomMenu'
 import {
   treeselectAll as deptTreeselect
@@ -391,6 +391,7 @@ export default {
       filterbanText: '',
       filterchangText: '',
       filterbanList: [],
+      filterbanListAll: [],
       filterchangList: [],
       filterchangListAll: [],
       eventId: null,
@@ -455,31 +456,32 @@ export default {
           click: 'wrj'
         }
       ],
-      deptOptionsLiandong: [],
-      deptOptionsLiandong_baishan: [
-        {
-          label: '板石头国有林场',
-          id: 1,
-          children: [
-          ]
-        }, {
-          label: '五间房国有林场',
-          id: 2,
-          children: []
-        }, {
-          label: '三道沟国有林场',
-          id: 3,
-          children: []
-        }, {
-          label: '大镜沟国有林场',
-          id: 4,
-          children: []
-        }, {
-          label: '实验国有林场',
-          id: 5,
-          children: []
-        }
-      ],
+      deptChangOptionsLiandong: [],//查询林场部门树结构
+      deptBanOptionsLiandong: [],//查询林班层级树结构
+      // deptOptionsLiandong_baishan: [
+      //   {
+      //     label: '板石头国有林场',
+      //     id: 1,
+      //     children: [
+      //     ]
+      //   }, {
+      //     label: '五间房国有林场',
+      //     id: 2,
+      //     children: []
+      //   }, {
+      //     label: '三道沟国有林场',
+      //     id: 3,
+      //     children: []
+      //   }, {
+      //     label: '大镜沟国有林场',
+      //     id: 4,
+      //     children: []
+      //   }, {
+      //     label: '实验国有林场',
+      //     id: 5,
+      //     children: []
+      //   }
+      // ],
 
       defaultProps: {
         children: 'children',
@@ -499,9 +501,13 @@ export default {
     }
   },
   created() {
-    /** 查询部门树结构 */
+    /** 查询林场部门树结构 */
     deptTreeselect().then(response => {
-      this.deptOptionsLiandong = response.data
+      this.deptChangOptionsLiandong = response.data
+    })
+    /** 查询林班层级树结构 */
+    linBanTreeselect().then(response => {
+      this.deptBanOptionsLiandong = response.data
     })
   },
   methods: {
@@ -547,64 +553,68 @@ export default {
     handlebanNodeClick(node, data, value) {
       //获取林班列表
       this.filterban = ''
-      if(node.id==1){
-        this.filterbanList=[
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/BanShiTouGuoYouLinChang',
-            farmName: '板石街道',
-            datasetNames: ['bs:banshijiedao'],
-            name: 'banshijiedao@bs'
-          },
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/BanShiTouGuoYouLinChang',
-            farmName: '河口街道',
-            datasetNames: ['bs:hekoujiedao'],
-            name: 'hekoujiedao@bs'
-          },
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/BanShiTouGuoYouLinChang',
-            farmName: '七道江镇',
-            datasetNames: ['bs:qidaojiangzhen'],
-            name: 'qidaojiangzhen@bs'
-          },
-        ]
-      }else if (node.id==2){
-        this.filterbanList=[
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/WuJianFangGuoYouLinChang',
-            farmName: '六道江镇',
-            datasetNames: ['bs:WuJianFangGuoYouLinChang'],
-            name: 'WuJianFangGuoYouLinChang@bs'
-          },
-        ]
-      }else if (node.id==3){
-        this.filterbanList=[
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/SanDaoGouGuoYouLinChang',
-            farmName: '三道沟镇',
-            datasetNames: ['bs:SanDaoGouGuoYouLinChang'],
-            name: 'SanDaoGouGuoYouLinChang@bs'
-          },
-        ]
-      }else if (node.id==4){
-        this.filterbanList=[
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/DaJingGouGuoYouLinChang',
-            farmName: '红土崖镇',
-            datasetNames: ['bs:DaJingGouGuoYouLinChang'],
-            name: 'DaJingGouGuoYouLinChang@bs'
-          },
-        ]
-      }else if (node.id==5){
-        this.filterbanList=[
-          {
-            farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/ShiYanGuoYouLinChang',
-            farmName: '大阳岔镇',
-            datasetNames: ['bs:ShiYanGuoYouLinChang'],
-            name: 'ShiYanGuoYouLinChang@bs'
-          }
-        ]
-      }
+      selectBanBylinBanTreesId(node.id).then(res => {
+        this.filterbanList = res.data
+        this.filterbanListAll = res.data
+      })
+      // if(node.id==1){
+      //   this.filterbanList=[
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/BanShiTouGuoYouLinChang',
+      //       farmName: '板石街道',
+      //       datasetNames: ['bs:banshijiedao'],
+      //       name: 'banshijiedao@bs'
+      //     },
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/BanShiTouGuoYouLinChang',
+      //       farmName: '河口街道',
+      //       datasetNames: ['bs:hekoujiedao'],
+      //       name: 'hekoujiedao@bs'
+      //     },
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/BanShiTouGuoYouLinChang',
+      //       farmName: '七道江镇',
+      //       datasetNames: ['bs:qidaojiangzhen'],
+      //       name: 'qidaojiangzhen@bs'
+      //     },
+      //   ]
+      // }else if (node.id==2){
+      //   this.filterbanList=[
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/WuJianFangGuoYouLinChang',
+      //       farmName: '六道江镇',
+      //       datasetNames: ['bs:WuJianFangGuoYouLinChang'],
+      //       name: 'WuJianFangGuoYouLinChang@bs'
+      //     },
+      //   ]
+      // }else if (node.id==3){
+      //   this.filterbanList=[
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/SanDaoGouGuoYouLinChang',
+      //       farmName: '三道沟镇',
+      //       datasetNames: ['bs:SanDaoGouGuoYouLinChang'],
+      //       name: 'SanDaoGouGuoYouLinChang@bs'
+      //     },
+      //   ]
+      // }else if (node.id==4){
+      //   this.filterbanList=[
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/DaJingGouGuoYouLinChang',
+      //       farmName: '红土崖镇',
+      //       datasetNames: ['bs:DaJingGouGuoYouLinChang'],
+      //       name: 'DaJingGouGuoYouLinChang@bs'
+      //     },
+      //   ]
+      // }else if (node.id==5){
+      //   this.filterbanList=[
+      //     {
+      //       farmAddress: 'http://121.36.228.94:8090/iserver/services/map-baishan/rest/maps/ShiYanGuoYouLinChang',
+      //       farmName: '大阳岔镇',
+      //       datasetNames: ['bs:ShiYanGuoYouLinChang'],
+      //       name: 'ShiYanGuoYouLinChang@bs'
+      //     }
+      //   ]
+      // }
     },
     // 返回图片列表
     assetTypeAnImage(filePath) {
@@ -841,6 +851,20 @@ export default {
         this.filterchangList = this.filterchangListAll
       }
     },
+    searchFilterban(filterban) {
+      //林场列表搜索
+      let searchFilterbannew = []
+      if (filterban != null && filterban != '') {
+        for (var i = 0; i < this.filterbanListAll.length; i++) {
+          if (this.filterbanListAll[i].farmName.indexOf(filterban) > -1) {
+            searchFilterbannew.push(this.filterbanListAll[i])
+          }
+        }
+        this.filterbanList = searchFilterbannew
+      } else {
+        this.filterbanList = this.filterbanListAll
+      }
+    },
 
     //标记警报
     updateAlert() {