<template>
  <div v-if="visible">
    <el-dialog
      title="错误日志"
      :visible.sync="visible"
      width="500px"
      :before-close="handleClose"
      :append-to-body="true" 
      :close-on-click-modal="false"
    >
        <div style="height:calc(100vh - 250px);overflow:auto" v-infinite-scroll="load" class="errorMessage1">
            <div v-for="(item,index) in tableData" :key="index" class='errorMessage'>
                <span style="color:blue">{{item.patentNo}}</span>
                <span>{{item.errorName}}</span>
            </div>
        </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
        tableData:[],
        visible:false,
        queryParams:{
            size:10,
            current:0
        },
        total:1
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    open(taskId){
        this.tableData = []
        this.queryParams={
            size:10,
            current:0,
            taskId:taskId
        }
        this.total = 1
        this.visible = true
    },
    handleClose(){
        this.visible = false
    },
    load(){
        if(this.total<=this.tableData.length){
            return 
        }
        this.queryParams.current += 1
        this.$api.getPatentImportLog(this.queryParams).then(response=>{
            if(response.code == 200){
                var data = response.data.data
                this.tableData = this.tableData.concat(data)
                this.total = response.data.total
            }
        }).catch(error=>{
            this.total = 0
        })
    },
  },
};
</script>
<style lang="scss" scoped>
.errorMessage{
    font-size: 16px;
    margin: 5px;
}
.errorMessage1:empty{
    text-align: center;
}
.errorMessage1:empty::after{
    content:'暂无数据';
    color:#909399;
   
}
</style>