404.vue 1.53 KB
<template>
  <div class="page">
    <div class="image-404"></div>
    <div class="right">
      <div class="text-404"></div>
      <div class="text">抱歉,你访问的页面不存在</div>
      <el-button type="primary" size="medium" @click="handleClick"
        >返回首页</el-button
      >
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import { PERMISSION_USER_MAP } from '@/utils/mappingData'

export default {
  computed: {
    ...mapState(['roles'])
  },
  methods: {
    handleClick() {
      if (this.roles === PERMISSION_USER_MAP.auditor.code) {
        this.$router.push({ path: '/task/work' })
      } else {
        this.$router.push({ path: '/' })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.page {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: #f0f2f5;
  .image-404 {
    width: 443px;
    height: 342px;
    margin-right: 121px;
    background-image: url('../assets/image/404image.png');
    background-repeat: no-repeat;
  }
  .right {
    height: 342px;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: flex-start;
    .text-404 {
      width: 161px;
      height: 74px;
      background-image: url('../assets/image/404.png');
      background-repeat: no-repeat;
    }
    .text {
      margin: 24px 0 16px 0;
      width: 240px;
      height: 28px;
      font-size: 20px;
      font-weight: 400;
      color: rgba(0, 0, 0, 0.45);
      line-height: 28px;
    }
  }
}
</style>