Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/visu_water' into visu_water

wang_xy 2 rokov pred
rodič
commit
e853e06182

+ 18 - 3
src/api/leader.js

@@ -17,15 +17,30 @@ export function getForestLeader(linJob,linType) {
 }
 // 点击左侧人员列表获取轨迹
 export function getLeaderTrack(trackById) {
+  alert(trackById)
   return request({
     url: '/center-water/VisuForestLeaderController/getLeaderTrack?trackById='+trackById,
     method: 'get',
   })
 }
-// 巡查监测点计划
-export function getPlanList(trackById) {
+// 点击左侧人员列表获取 巡查监测点计划
+export function getWaterPlan(reiverLengthId) {
   return request({
-    url: '/center-water/VisuForestLeaderController/getPlanList',
+    url: '/center-water/VisuForestLeaderController/getWaterPlan?reiverLengthId='+reiverLengthId,
+    method: 'get',
+  })
+}
+// 点击右巡查监测点计划 巡查监测记录
+export function getWaterRecord(id, reiverLengthId) {
+  return request({
+    url: '/center-water/VisuForestLeaderController/getWaterRecord?planId='+id+'&reiverLengthId='+reiverLengthId,
+    method: 'get',
+  })
+}
+// 点击右巡查监测点记录获取 巡查轨迹落点
+export function getWaterPoint(planId, reiverLengthId) {
+  return request({
+    url: '/center-water/VisuForestLeaderController/getWaterPoint?planId='+planId+'&reiverLengthId='+reiverLengthId,
     method: 'get',
   })
 }

+ 1 - 0
src/views/bigdata/chart-deviceReportingEvents.vue

@@ -29,6 +29,7 @@
       sjsbsbsl() {
         let that = this
         getSbsbsjsl().then(resp => {
+          console.log("设备上报事件数量", resp)
           that.data_num = resp.data.num;
           that.data_reportor = resp.data.reportor
           that.myEcharts()

+ 5 - 3
src/views/bigdata/chart-event.vue

@@ -19,7 +19,8 @@ export default {
   name: 'event',
   data() {
     return {
-      year: 2022,
+      // year: 2022,
+      year: new Date().getFullYear(),
       optionData: [],
       option2Data: []
     }
@@ -90,6 +91,7 @@ export default {
       let color = ['#FF8700', '#ffc300', '#00e473', '#009DFF', '#0034ff', '#99ff00', '#E148EB', '#E148EB', '#E148EB', '#E148EB']
       var option
       let chartData = this.option2Data
+      console.log("this.option2Data",this.option2Data)
       let arrName = []
       let arrValue = []
       let sum = 0
@@ -170,7 +172,7 @@ export default {
             }
           ]
         })
-        v.percent = ((v.value / sum) * 100).toFixed(1) + '%'
+        v.percent = sum == 0 ? '0%' : ((v.value / sum) * 100).toFixed(1) + '%'
         lineYAxis.push({
           value: i,
           textStyle: {
@@ -205,7 +207,7 @@ export default {
             axisLabel: {
               formatter: function(params) {
                 let item = chartData[params]
-                console.log(item)
+                console.log("item", item)
                 return (
                   '{circle|●}{name|' +
                   item.name +

+ 92 - 16
src/views/leader.vue

@@ -47,7 +47,7 @@
             <div class="i-list-con h-27">
               <div class="d-l-con-icon">
                 <div class="icon-con" :class="{on:listCurrentIndex1==item.userId}"
-                     v-for="(item,index) in peopleList" @click="getLeaderTrack(item.userId)">
+                     v-for="(item,index) in peopleList" @click="getWaterPlan(item.reiverLengthId)">
                   <div class="icon icon-mid el-icon-user"></div>
                   <div class="icon-text personnel-name">
                     <h6>{{ item.nickName }}</h6>
@@ -75,14 +75,37 @@
             <div class="i-list-con h-73">
 
               <div class="h-19 overflow-y">
-                <div class="d-l-con" :class="{on:listCurrentIndex2==item.planName}"
-                     v-for="(item,index) in xunLinListOne"
-                     @click="setConnectList(item.planLine,item.planName)">
-                  <div class="d-l-l-text">
-                    <i class="i-small"></i>
-                    <h4>{{ item.planName }}</h4>
-                  </div>
-                </div>
+                <el-collapse accordion>
+                  <el-collapse-item v-for="(item,index) in xunLinListOne">
+                    <template slot="title">
+                      <div class="d-l-con sj-collapse" @click="getWaterRecord(item.id, item.reiverLengthId)">
+                        <div class="d-l-l-text">
+                          <h4 class="collapse-title">{{ item.name }}</h4>
+                        </div>
+                        <div class="d-l-l-count">({{ item.recordCount }}-{{ item.planCount }})</div>
+                      </div>
+                    </template>
+                    <div class="d-l-con this-child sj-collapse" @click="getWaterPoint(child.id, child.reiverLengthId)" v-for="(child,index) in recordList" >
+                      <div class="d-l-l-text" >
+                        <h4>{{child.beginTime}} - {{child.endTime}}</h4>
+                      </div>
+                      <!--<div class="d-l-l-count">{{index}}</div>-->
+                    </div>
+                    <div class="d-l-con this-child sj-collapse" v-if="recordList == null || recordList == '' || recordList == []">
+                      <div class="d-l-l-text" >
+                        <h4 class="text-gray">暂无信息</h4>
+                      </div>
+                    </div>
+                  </el-collapse-item>
+                </el-collapse>
+                <!--<div class="d-l-con" :class="{on:listCurrentIndex2==item.planName}"-->
+                     <!--v-for="(item,index) in xunLinListOne"-->
+                     <!--@click="getWaterRecord(item.id, item.reiverLengthId)">-->
+                  <!--<div class="d-l-l-text">-->
+                    <!--<i class="i-small"></i>-->
+                    <!--<h4>{{ item.name }} ({{ item.recordCount }}-{{ item.planCount }})</h4>-->
+                  <!--</div>-->
+                <!--</div>-->
               </div>
             </div>
           </dv-border-box-13>
@@ -106,7 +129,9 @@
 import {
   getForestLeader,
   getLeaderTrack,
-  getPlanList,
+  getWaterPlan,
+  getWaterRecord,
+  getWaterPoint,
   getRy
 } from '@/api/leader'
 
@@ -140,6 +165,7 @@ export default {
       peopleList: [], //人员列表
       connectList: [], //画线
       xunLinListOne: [], //巡林计划
+      recordList: [], //巡林记录
       zrs: 0, //总人数
       zxrs: 0 //在线人数
     }
@@ -229,10 +255,10 @@ export default {
         that.zxrs = res.data.visuForestCloudRyZxBO.zxrs
         this.personnelChart()
       })
-      //获取巡计划
-      getPlanList().then(res => {
-        this.xunLinListOne = res.data
-      })
+      //获取巡查监测点计划
+      // getWaterPlan().then(res => {
+      //   this.xunLinListOne = res.data
+      // })
     },
     //获取左侧人员列表
     getForestLeader(linJob, linType) {
@@ -242,16 +268,65 @@ export default {
       this.peopleList = []
       getForestLeader(linJob, linType).then(res => {
         this.peopleList = res.data
+        this.xunLinListOne = [];//初始化右侧计划
+        this.recordList = [];//初始化右侧记录
+        console.log("人员", res.data)
       })
       this.connectList = []
       this.$refs.supermap.clearC()
     },
-    //点击左侧人员列表获取轨迹
-    getLeaderTrack(userId) {
+    //点击左侧人员列表获取 巡查监测点计划
+    getWaterPlan(reiverLengthId) {
+      this.recordList = [];
+      getWaterPlan(reiverLengthId).then(res => {
+        console.log("计划",res.data);
+        this.xunLinListOne = res.data;
+      })
+    },
+    //点击左侧巡查监测点计划获取 巡查记录
+    getWaterRecord(id, reiverLengthId) {
+      getWaterRecord(id, reiverLengthId).then(res => {
+        console.log(id+"=id, 记录 reiverLengthId="+reiverLengthId);
+        console.log("记录",res.data);
+        this.recordList = res.data;
+      })
+    },
+    //点击左侧巡查监测点计划获取 巡查记录
+    getWaterPoint(id, reiverLengthId) {
+      console.log(id+"=id, 落点 reiverLengthId="+reiverLengthId);
+      getWaterPoint(id, reiverLengthId).then(res => {
+        console.log("落点",res.data);
+        this.getPointList(res);
+        // this.pointList = res.data;
+      })
+    },
+    getPointList(res) {
+      let that = this;
+      this.connectList = [];
+      console.log("落点",res.data)
+      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()
+      }
+    },
+    //点击左侧人员列表获取计划
+    getLeaderTrack(userId) {//String reiverLengthId;
       this.listCurrentIndex1 = userId
       let that = this
       this.connectList = []
       getLeaderTrack(userId).then(res => {
+        console.log("计划",res.data);
         if (res.data != null && res.data.length > 0) {
           for (let i = 0; i < res.data.length; i++) {
             let latlng = {
@@ -388,4 +463,5 @@ export default {
 .h-27 {
   height: 27rem;
 }
+
 </style>