<template>
    <!-- 接收modal -->
    <el-dialog v-loading="startLoading"  title="接收" top="10px" :visible.sync="visible" width="90%" v-dialogDrag :close-on-click-modal="false"
      :before-close="cancel">
      <div class="dia-box" >
        <el-row style="margin-bottom:5px;">
            <el-col :span="20">
                <el-button :disabled="detectionresultFlag==2" type="success" size="mini" @click="fourCheckResult">四性检测</el-button>
                <el-button :disabled="detectionresultFlag!=2" :type="detectionresultFlag!=2?'info':'success'" size="mini" @click="handleClickBeginReceive">开始接收</el-button>
            </el-col>
            <el-col :span="4" style="text-align:right;">
                <el-button type="primary" size="mini" @click="handleClickReport">检测报告</el-button>
            </el-col>
        </el-row>
          <div class="text-p">
            <p>请点击“四性检测按钮”，对电子文件或者电子文档进行“四性”检测,再点击“开始接收”按钮，进行接收数据！</p>
          </div>
          <el-table size="small" :data="tableData" border max-height="500px">
            <el-table-column label="检测对象" prop="describe" align="center">
            </el-table-column>
            <el-table-column label="编号" prop="link" align="center">
            </el-table-column>
            <el-table-column label="结果" align="center">
                <template slot-scope="scope" v-if="scope.row.describe=='系统环境中是否安装杀毒软件检测'">
                    <el-button type="primary" size="mini" @click="handleClickResult(scope.row)">人工检测</el-button>
                </template>
            </el-table-column>
            <el-table-column label="是否通过" prop="pass" align="center">
                <template slot-scope="scope">
                    <el-tag :type="scope.row.pass?'success':'warning'">{{scope.row.pass?'通过':'不通过' }}</el-tag>
                </template>
            </el-table-column>
            <el-table-column label="错误信息" prop="msg" align="center">
            </el-table-column>
        </el-table>
        <div style="text-align:right;margin:15px 0 20px;">
          <el-button size="mini" @click="cancel">关闭</el-button>
        </div>
      </div>
    </el-dialog>
  </template>
  <script>
    import {message} from "@/utils/common";
    export default {
      props: {
        visible: {
          type: Boolean,
          default: () => false
        },
        startLoading:{
          type:Boolean,
          default:()=>false
        },
        tableData:{
          type:Array,
          default:()=>[]
        },
        tableObj:{
          type:Object,
          default:()=>{}
        },
        detectionresultFlag:{ // 检测结果是否通过
          type:Number,
          default:()=>1, // 1表示未检测，2通过，0不通过
        }
      },
      data() {
        return {
          height: window.innerHeight - 20,
        };
      },
      methods: {
        cancel() {
          this.$emit("cancel");
        },
        // 点击人工检测按钮
        handleClickResult(row){
            this.$emit('handsTest',row)
        },
        // 点击预览报表
        handleClickReport(){
            this.$emit('previewReport')
        },
        // 点击开始移交
        handleClickBeginReceive(){
          this.$emit('startReceive')
        },
        // 点击四性检测
        fourCheckResult(){
          this.$emit('fourCheck')
        }
      }
    };
  
  </script>

<style lang="scss" scoped>
.text-p{
  text-align: center;
  font-size: 14px;
  border: 1px dashed #e88f21;
  padding: 5px;
  background-color: #f2e7d8;
  p{
    margin:0;
    line-height:30px;
    text-align: left;
  }
}
</style>
  