<template>
  <div class="quick_box">
    <div class="title_box">
      <span class="title">快捷入口</span>
      <span style="color: #409eff; font-size: 14px">管理</span>
    </div>
    <div class="access_box">
        <!-- { name: '工序接收', url: 'plan', page: '/zhgd-work/taskCope' },
        { name: '工序报工', url: 'rule', page: '/workReport/index' },
        { name: '工序检验', url: 'product', page: '/workCheck/index' },
        { name: '生产追溯维护', url: 'craft', page: '/retrospectDefend/index' },
        { name: '电子档案维护', url: 'quality', page: '/eleFilesEdit/index' }, -->
      <div class="access_box_item" @click="turnPage('/zhgd-work/taskCope')" v-if="permission.wel_taskCope">
        <img src="@/assets/product.png" alt="" />
        <span>工序接收</span>
      </div>
      <div class="access_box_item" @click="turnPage('/workReport/index')" v-if="permission.wel_workReport">
        <img src="@/assets/plan.png" alt="" />
        <span>工序报工</span>
      </div>
       <div class="access_box_item" @click="turnPage('/workCheck/index')" v-if="permission.wel_workCheck">
        <img src="@/assets/rule.png" alt="" />
        <span>工序检验</span>
      </div>
       <div class="access_box_item" @click="turnPage('/retrospectDefend/index')" v-if="permission.wel_retrospectDefend">
        <img src="@/assets/output.png" alt="" />
        <span>生产追溯维护</span>
      </div>
      <div class="access_box_item" @click="turnPage('/eleFilesEdit/index')" v-if="permission.wel_eleFilesEdit">
        <img src="@/assets/craft.png" alt="" />
        <span>电子档案维护</span>
      </div>
      <!-- <div
        class="access_box_item"
        v-for="item in accessData"
        :key="item.name"
        @click="turnPage(item.page)"
      >
        <img
          v-show="item.url == 'product' && permission.wel_taskCope"
          src="@/assets/product.png"
          alt=""
        />
        <img
          v-show="item.url == 'plan' && permission.wel_workReport"
          src="@/assets/plan.png"
          alt=""
        />
        <img
          v-show="item.url == 'rule' && permission.wel_workCheck"
          src="@/assets/rule.png"
          alt=""
        />
        <img
          v-show="item.url == 'output' && permission.wel_retrospectDefend"
          src="@/assets/output.png"
          alt=""
        />
        <img
          v-show="item.url == 'craft' && permission.wel_eleFilesEdit"
          src="@/assets/craft.png"
          alt=""
        />
        <span>{{ item.name }}</span>
      </div> -->
    </div>
    <!-- 工序报工 -->
    <!-- <taskCope></taskCope> -->
  </div>
</template>

<script>
import taskCope from '@/views/zhgd-work/taskCope/index.vue';
import { mapGetters } from 'vuex';
export default {
  components: { taskCope },
  computed: {
    ...mapGetters(['userInfo', 'permission']),
  },
  data() {
    return {
      accessData: [
        { name: '工序接收', url: 'plan', page: '/zhgd-work/taskCope' },
        { name: '工序报工', url: 'rule', page: '/workReport/index' },
        { name: '工序检验', url: 'product', page: '/workCheck/index' },
        { name: '生产追溯维护', url: 'craft', page: '/retrospectDefend/index' },
        { name: '电子档案维护', url: 'quality', page: '/eleFilesEdit/index' },
      ],
    };
  },
  methods: {
    turnPage(page) {
      if (page) {
        this.$router.push(page);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.quick_box {
  padding: 20px;
  // border-bottom: 1px solid #eee;
  height: 50%;

  .title_box {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .title {
      font-weight: 550;
    }
  }

  .access_box {
    display: flex;
    flex-wrap: wrap;
    // margin-top: 10px;

    .access_box_item {
      display: flex;
      flex-direction: column;
      width: 32%;
      align-items: center;
      justify-content: center;
      margin-block: 10px;
      font-size: 14px;
      cursor: pointer;

      img {
        width: 20px;
        margin-bottom: 5px;
      }
    }
  }
}
</style>