importErrDialog.vue 1.72 KB
<template>
  <GLDialog
    mode="small"
    title="操作结果"
    :visible.sync="importObj.show"
    :before-close="handleClose"
  >
    <template #default>
      <div class="importObj-content">
        <div class="success item">
          <div class="num">{{importObj.successCount}}</div>
          有效数据
        </div>
        <div class="line"></div>
        <div class="error item">
          <div class="num">{{importObj.errorCount}}</div>
          异常数据
        </div>
      </div>
    </template>
    <template #footer>
      <el-button
        size="small"
        @click="handleClose"
      >确定</el-button>
      <el-button
        type="primary"
        size="small"
        @click="handleConfirm"
      >导出错误结果</el-button>
    </template>
  </GLDialog>
</template>

<script type='text/ecmascript-6'>
import { aToExport } from '@/common/constant'
export default {
  name: '',

  props: {
    importObj: {
      type: Object,
      default: () => { }
    }
  },
  data () {
    return {
      loading: false,
      checked: false
    }
  },
  mounted () {
  },
  methods: {
    handleClose () {
      this.$emit('update:importObj', {})
    },
    handleConfirm () {
      aToExport(this.importObj.errorUrl)
      this.handleClose()
    }
  }
}
</script>

<style scoped lang='scss'>
.importObj-content {
  height: 100%;
  display: flex;
  align-items: center;
  .item {
    flex: 1;
    text-align: center;
    .num {
      font-weight: 700;
      font-size: 26px;
      line-height: 32px;
      margin-bottom: 10px;
    }
  }
  .error {
    .num {
      color: #eb4e4e;
    }
  }
  .success {
    .num {
      color: #2cca74;
    }
  }
  .line {
    width: 1px;
    height: 56px;
    background: #e8e8ea;
  }
}
</style>