彭宇 il y a 2 ans
Parent
commit
9eded0c246
3 fichiers modifiés avec 34 ajouts et 5 suppressions
  1. 7 0
      src/api/forest.js
  2. 23 4
      src/components/vBottomMenu.vue
  3. 4 1
      src/views/forest.vue

+ 7 - 0
src/api/forest.js

@@ -136,3 +136,10 @@ export function sendTask(param) {
     data:param
   })
 }
+// 任务接口
+export function selectTaskBO() {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/selectTaskBO',
+    method: 'post',
+  })
+}

+ 23 - 4
src/components/vBottomMenu.vue

@@ -102,7 +102,7 @@
     <div class="btm-right">
       <el-popover placement="top" trigger="click">
         <div class="btm-r-pop-info">
-          <div class="btm-r-pop-info-box" v-for="(item,index) in 3">
+          <div class="btm-r-pop-info-box" v-for="(item,index) in taskList">
             <div class="btm-r-pop-info-tit">
               <h3>火险任务</h3>
             </div>
@@ -133,13 +133,13 @@
             </div>
           </div>
         </div>
-        <el-badge :value="12" slot="reference">
-          <el-button size="small" icon="el-icon-bank-card">任务</el-button>
+        <el-badge :value="taskCount" slot="reference">
+          <el-button size="small" icon="el-icon-bank-card" @click="refreshTaskList">任务</el-button>
         </el-badge>
       </el-popover>
       <el-popover placement="top" trigger="click">
         <div class="btm-r-pop-info">
-          <div class="btm-r-pop-info-box" v-for="(item,index) in 3">
+          <div class="btm-r-pop-info-box" v-for="(item,index) in 4">
             <div class="btm-r-pop-info-tit">
               <h3>火险任务</h3>
             </div>
@@ -186,9 +186,16 @@
 </template>
 
 <script>
+import {
+  selectTaskBO,
+} from '@/api/forest'
+
 export default {
   data() {
     return {
+      taskCount:0,//任务数量
+      taskList:0,//任务列表
+
       btmTipIndent: '', //图例收起弹出
       eventLocationVisible: false,
       showChild: false,
@@ -273,6 +280,18 @@ export default {
     }
   },
   methods: {
+    refreshTaskList(){
+      //刷新任务列表
+      this.selectTaskList()
+    },
+    selectTaskList: async function(){
+      //获取任务列表
+      selectTaskBO().then(res => {
+        this.taskList=res.data
+        this.taskCount=res.data.length
+        debugger
+      })
+    },
     handleCheckedCitiesChangeBan(value) {
       this.choseLayerSwitchingList(this.banCheckList)
     },

+ 4 - 1
src/views/forest.vue

@@ -370,6 +370,7 @@ export default {
     /** ----------------------------------weosocket开始------------------------------------- */
     // this.initWebSocket()
     /** ----------------------------------weosocket结束------------------------------------- */
+    this.selectTaskList()//获取任务
   },
   data() {
     return {
@@ -725,6 +726,9 @@ export default {
         }]
       })
     },
+    selectTaskList(){
+      this.$refs.bottomMenu.selectTaskList();
+    },
     getBaseInfo() {
       //左侧获取部门信息
       getBaseInfo().then(res => {
@@ -793,7 +797,6 @@ export default {
       //右侧获取事件列表
       getEventList({ day: day }).then(res => {
         this.eventList = res.data
-        console.log(this.eventList)
         this.eventListAll = res.data
         that.markersList = []
         if (this.eventList != null && this.eventList.length > 0) {