TipsBox.vue 2.19 KB
<template>
  <div :class="['tips-box',{finish: step == 3}, {hide:hideTips}]">
    <div class="text flex">
      <img
        :src="info.icon"
        class="icon"
      >
      {{info.text}}
    </div>
    <template v-if="info.description">
      <div class="description">{{info.description}}</div>
    </template>
  </div>
</template>

<script type='text/ecmascript-6'>
export default {
  name: 'TipsBox',
  props: {
    step: [Number, String],
    tableData: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      step_1: {
        icon: require('./images/info-1.png'),
        text: '请选择离职员工与接手员工,系统将自动扫描名下资产。'
      },
      step_2: {
        icon: require('./images/info-2.png'),
        text: '注意:涉及实物交接',
        description: '检测到部分车辆已签署代保管协议。请点击表格右侧的 [上传凭证] 按钮,针对每一辆高风险车辆上传对应的交接单或合影。'
      },
      step_3: {
        icon: require('./images/info-3.png'),
        text: '交接成功',
        description: '本地权限已变更。'
      },
    }
  },
  computed: {
    info () {
      return this[`step_${this.step}`]
    },
    hideTips () {
      const { tableData, step } = this
      let flag = false
      if (step == 2) {
        let len = tableData.findIndex(item => item.signCustodyStatus)
        console.log(len)
        if (len == -1) flag = true
      }
      return flag
    }
  },
  mounted () {
  },
  methods: {
  }
}
</script>

<style scoped lang='scss'>
.flex {
  display: flex;
  align-items: center;
}
.tips-box {
  border-radius: 4px;
  background: #fafafa;
  padding: 16px 20px;
  color: #333333;
  .text {
    font-size: 16px;
    font-weight: 700;
    .icon {
      width: 24px;
      height: 24px;
      margin-right: 8px;
    }
  }
  .description {
    font-size: 14px;
    margin-top: 20px;
    line-height: 20px;
  }
}
.hide{
  display: none;
}
.finish {
  .text {
    justify-content: center;
  }
  .description {
    margin-top: 8px;
    color: #999999;
    text-align: center;
  }
}
</style>