Bladeren bron

新页面

彭宇 2 jaren geleden
bovenliggende
commit
0190bd26d2
4 gewijzigde bestanden met toevoegingen van 160 en 995 verwijderingen
  1. 17 0
      src/api/afforestation.js
  2. 13 6
      src/api/leader.js
  3. 73 926
      src/views/afforestation.vue
  4. 57 63
      src/views/leader.vue

+ 17 - 0
src/api/afforestation.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+
+// 获取
+export function getAfforestation(year) {
+  return request({
+    url: '/center-fire/VisuAfforestationController/getAfforestation?year='+year,
+    method: 'get',
+  })
+}
+// 点击左侧人员列表获取轨迹
+export function getAfforestationArea(afforestationId) {
+  return request({
+    url: '/center-fire/VisuAfforestationController/getAfforestationArea?afforestationId='+afforestationId,
+    method: 'get',
+  })
+}
+

+ 13 - 6
src/api/leader.js

@@ -1,16 +1,23 @@
 import request from '@/utils/request'
 
-// 获取初始化数据
-export function getForestLeader() {
+// 获取左侧人员列表
+export function getForestLeader(linJob,linType) {
   return request({
-    url: '/center-fire/VisuForestLeaderController/getForestLeader',
+    url: '/center-fire/VisuForestLeaderController/getForestLeader?linJob='+linJob+"&linType="+linType,
     method: 'get',
   })
 }
-// 点击左侧动物列表
-export function selectForestAnimalListByType(type) {
+// 点击左侧人员列表获取轨迹
+export function getLeaderTrack(trackById) {
   return request({
-    url: '/center-fire/VisuForestAnimalController/selectForestAnimalListByType/'+type,
+    url: '/center-fire/VisuForestLeaderController/getLeaderTrack?trackById='+trackById,
+    method: 'get',
+  })
+}
+// 巡林计划
+export function getPlanList(trackById) {
+  return request({
+    url: '/center-fire/VisuForestLeaderController/getPlanList',
     method: 'get',
   })
 }

File diff suppressed because it is too large
+ 73 - 926
src/views/afforestation.vue


+ 57 - 63
src/views/leader.vue

@@ -15,14 +15,14 @@
           <div class="i-list-con h-25">
             <div id="personnel-chart" style="width: 100%;height:12vh;"></div>
             <div class="d-l-con-icon">
-              <div class="icon-con w-50" v-for="(item,index) in visuForestCloudRYBO" v-if="index%2==0">
+              <div class="icon-con w-50" v-for="(item,index) in visuForestCloudRYBO" v-if="index%2==0" @click="getForestLeader(item.jobValue,item.jobType)">
                 <div class="icon icon-mid el-icon-user"></div>
                 <div class="icon-text">
                   <h5>{{item.job}}</h5>
                   <h6>{{item.number}}</h6>
                 </div>
               </div>
-              <div class="icon-con w-50  m-btm-no" v-for="(item,index) in visuForestCloudRYBO" v-if="index%2!=0">
+              <div class="icon-con w-50  m-btm-no" v-for="(item,index) in visuForestCloudRYBO" v-if="index%2!=0" @click="getForestLeader(item.jobValue,item.jobType)">
                 <div class="icon icon-mid el-icon-user"></div>
                 <div class="icon-text">
                   <h5>{{item.job}}</h5>
@@ -32,14 +32,19 @@
             </div>
           </div>
         </div>
+<!--        avatar: ""-->
+<!--        deptName: "锦程社区第一网格"-->
+<!--        nickName: "李猛"-->
+<!--        userId: 102-->
+<!--        userName: "limeng"-->
         <div class="forthis">
           <div class="i-list-con h-27">
             <div class="d-l-con-icon">
-              <div class="icon-con" v-for="(item,index) in peopleList">
+              <div class="icon-con" v-for="(item,index) in peopleList" @click="getLeaderTrack(item.userId)">
                 <div class="icon icon-mid el-icon-user"></div>
                 <div class="icon-text personnel-name">
-                  <h6>{{item.count}}</h6>
-                  <h5>{{item.resourceName}}</h5>
+                  <h6>{{item.nickName}}</h6>
+                  <h5>{{item.deptName}}</h5>
                 </div>
               </div>
             </div>
@@ -59,10 +64,10 @@
           <div class="i-list-con h-73">
 
             <div class="h-19 overflow-y">
-              <div class="d-l-con" v-for="(item,index) in xunLinListOne">
+              <div class="d-l-con" v-for="(item,index) in xunLinListOne" @click="setConnectList(item.planLine)">
                 <div class="d-l-l-text">
                   <i class="i-small"></i>
-                  <h4>{{item.name}}</h4>
+                  <h4>{{item.planName}}</h4>
                 </div>
               </div>
             </div>
@@ -85,7 +90,7 @@
 
 <script>
   import {
-    getForestLeader
+    getForestLeader,getLeaderTrack,getPlanList
   } from '@/api/leader'
   import {
     getBaseInfo
@@ -113,56 +118,9 @@
         indentText: '收起左右栏',
         indentdisabled: false,
         visuForestCloudRYBO: [],//人员类型列表
-        peopleList: [{
-          count: '姓名',
-          resourceName: '部门'
-        },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          },
-          {
-            count: '姓名',
-            resourceName: '部门'
-          }
-        ],
-        xunLinListOne: [{
-          name: '第一计划'
-        }, {
-          name: '第二计划'
-        }, {
-          name: '第三计划'
-        }, {
-          name: '第四计划'
-        }]
+        peopleList: [],//人员列表
+        connectList: [],//画线
+        xunLinListOne: []//巡林计划
       }
     },
     created() {
@@ -203,17 +161,53 @@
         //获取左侧菜单列表
         getBaseInfo().then(res => {
           that.visuForestCloudRYBO = res.data.visuForestCloudRYBO
-          console.log(that.visuForestCloudRYBO)
           this.personnelChart()
         })
+        //获取巡林计划
+        getPlanList().then(res => {
+          this.xunLinListOne=res.data
+          console.log(res.data)
+        })
       },
-      //获取左侧菜单列表
-      getForestLeader() {
-        getForestLeader().then(res => {
-          console.log(res)
+      //获取左侧人员列表
+      getForestLeader(linJob,linType) {
+        this.peopleList=[];
+        getForestLeader(linJob,linType).then(res => {
+          this.peopleList=res.data
+        })
+      },
+      //点击左侧人员列表获取轨迹
+      getLeaderTrack(userId) {
+        let that=this
+        getLeaderTrack(userId).then(res => {
+          if(res.data!=null&&res.data.length>0){
+            for (let i = 0; i < res.data.length; i++) {
+              let latlng = {
+                lat: res.data[i].latitude,
+                lng: res.data[i].longitude
+              }
+              this.connectList.push(latlng)
+            }
+            setTimeout(() => {
+              that.$refs.supermap.clearC()
+              that.$refs.supermap.setConnectList(this.connectList, 'red')
+            }, 1000)
+          }else{
+            that.$refs.supermap.clearC()
+          }
         })
       },
 
+      setConnectList(points){
+        if(points!=null&&points!=""){
+          this.connectList=JSON.parse(points);
+          this.$refs.supermap.clearC()
+          this.$refs.supermap.setConnectList(this.connectList, 'red')
+        }else{
+          this.$refs.supermap.clearC()
+        }
+      },
+
       //吉祥物收起左右框
       indent() {
         let list = document.getElementsByClassName('el-tooltip__popper')