<template>
  <div>
    <el-row :gutter="50">
      <el-col :span="6" v-for="(item, index) in list" :key="index">
        <div class="item" :style="{'background-image': `url(${require(`../img/backlog_bg${index + 1}.png`)})`}" @click="handlerMenu(item)">
          <el-row :gutter="40">
            <el-col :span="10">
              <img class="item-icon" :src="require(`../img/backlog_item${index + 1}.png`)" alt="">
            </el-col>
            <el-col :span="14">
              <div class="item-num" :style="{color: item.color}">{{ item.num }}</div>
              <div class="item-name">{{ item.name }}</div>
            </el-col>
          </el-row>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        { name: '我的待办', num: 5, color: '#E5B034', url: '/jxy/xy/backlog' },
        { name: '我的已办', num: 10, color: '#4CC771', url: '/jxy/xy/backlogProcessedList' },
        { name: '抄送我的', num: 3, color: '#5BB7FE', url: '/jxy/xy/backlog' },
        { name: '我的消息', num: 2, color: '#4A86FF', url: '/jxy/xy/backlog' }
      ]
    }
  },
  methods: {
    handlerMenu(item) {
      if (item.url.indexOf('http') !== -1) {
        window.open(item.url)
      } else {
        this.$router.push(item.url)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.item {
  width: 100%;
  height: 126px;
  background: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  &:hover {
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }
  &-icon {
    width: 100px;
    height: 100px;
    margin-top: 6px;
  }
  &-num {
    text-align: left;
    color: #E5B034;
    font-size: 40px;
    font-weight: 600;
    line-height: 60px;
    margin-top: 8px;
  }
  &-name {
    color: #515E78;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
  }
}
</style>
