<template>
  <div>
<!--    <el-badge :value="this.listByusers" class="item" :max="99">-->
<!--    <el-popover-->
<!--      placement="bottom"-->
<!--      width="200"-->
<!--      trigger="hover">-->
<!--      <el-table :data="gridData">-->
<!--        <el-table-column property="name" label="姓名"></el-table-column>-->
<!--      </el-table>-->
<!--      <i style="color: white"  class="el-icon-bell"  slot="reference"></i>-->
<!--    </el-popover>-->
<!--    </el-badge>-->
    <el-badge :value="this.listByusers" class="item" :max="99">
      <!-- <router-link to="task/task"> -->
        <i class="el-icon-bell" style="color: white" @click="goTask"></i>
      <!-- </router-link> -->
    </el-badge>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import { listByusers} from '@/layout/components/HeaderNotice';

export default {
  name: "HeaderNotice",
  components: {},
  computed: {
    ...mapGetters(['userId']),
  },
  data() {
    return {
      listByusers:'',
      visible: false,
    WfInstActionTaskVo:{
        userId:200,
      },
      gridData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }]
    };
  },
  created() {
    this.getNotice();
  },
  mounted() {
  },
  methods: {
    goTask(){
      if(this.$route.path != '/task/task'){
        this.$router.push({path:'/task/task'})
      }
    },
    /** 查询待办信息 */
    getNotice() {
      this.loading = true;
      let p = {
        WfInstActionTaskVo:{
          userId:200,
        },
      }
      listByusers(p).then(response => {
        this.listByusers = response;
        this.loading = false;
      });
    },
  },
};
</script>

<style coped>
.el-badge__content{
  margin-top: 12px;
}
</style>
