<template>
  <div>
    <tabset v-ref:tabs :close="false" nav-style="tabs nav-apply-tab2" :active.sync="active">
      <tab header='任务列表' style="width: auto">
        <app-build-done v-ref:exploration :defname="defname"   :title="title" :f_lat="f_lat" :f_lng="f_lng"></app-build-done>
      </tab>
    </tabset>
  </div>
</template>
<script>
import {HttpResetClass, PagedList} from 'vue-client'
import Vue from 'vue'

export default {
  title: '已办信息',
  data () {
    return {
      labelmarksarray: [],
      tasknumber: 0,
      active: 0,
      f_lat: null,
      f_lng: null,
      defname: '已办信息',
      title: '已办信息'
    }
  },
  ready () {
    this.getApplyTaskDot()
  },
  methods: {
    diyspotmouseclick (data) {
      this.f_lat = data.f_lat
      this.f_lng = data.f_lng

      this.active = 1
    },
    async getApplyTaskDot () {
      console.log('==========查询任务点==============')
      this.tasknumber = 0
      let http = new HttpResetClass()
      let data = {
        defname: this.defname,
        userid: Vue.user.id
      }
      let res = await http.load(
        'POST',
        `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyTaskDot`,
        {data: data},
        {
          resolveMsg: null,
          rejectMsg: '任务点获取失败！！！'
        })
      this.labelmarksarray = res.data.map(item => {
        this.tasknumber += item.count
        return {
          data: {
            data: item,
            content: `<p>任务数：${item.count}</p>`
          },
          position: [item.f_lng, item.f_lat],
          isclearmarker: false,
          islabel: false
        }
      })
    }
  },
  events: {
    'refreshDot' () {
      this.getApplyTaskDot()
    }
  },
  watch: {
  },
  computed: {
  }
}
</script>
<style scoped>
.tip{
  position: absolute;
  z-index: 1000;
  color: red;
  font-size: 24px;
  right: 30px;
  padding-top: 20px;
}
</style>
<style lang="less">
.nav-apply-tab2 {
  li {
    width: 100%;
    text-align: center;
  }
}
</style>
