<template>
    <div>
       <el-table border :data="result.tableData">
      <!-- <el-table-column align="center" v-for="(item,index) in tableData.title" :label="item"></el-table-column> -->

      <el-table-column
        align="center"
        v-for="(item, index) in result.tableTitle"
        :prop="item.prop"
        :key="index"
        :label="item.label"
      
      >
        <template slot-scope="scope" >    
          <div v-if="item.type == 'word'">
            {{ scope.row[item.prop] }}
            <!-- {{ scope.row }} -->
          </div>
          <div v-if="item.prop == 'steps'">
            <el-steps :active="scope.row.flowNow" align-center>
              <el-step
                v-for="(item1, index1) in result.checkResult"
                :key="index1"
                :title="item1"
                icon="iconfont iconrun-line"
              >
              
              </el-step>
            </el-steps>
          </div>

          
   
        </template>
      </el-table-column>
           <el-table-column
           align=center
      fixed="right"
      label="操作"
      width="200">
      <template slot-scope="scope">
        <el-button @click="handleCheck(scope.row)" type="text" size="small">查看</el-button>
        <el-button type="text" size="small"  @click="handleEdit(scope.$index, scope.row)">修改</el-button>
       
        <el-button type="text" size="small"  @click="handleDelete(scope.$index, scope.row)">删除</el-button>
      </template>
    </el-table-column>

    </el-table>
    </div>
</template>
<script>
import bus from "../../utils/bus.js"
export default {
    props:{
        ProcessTable:Object
    },
    name:"ProcessTable",
    data(){
        return{
            //路由标题
            routerTitle:"",
             //模拟数据
      result: {
        //流程图
        checkResult: [
          "成立检查组",
          "制定检查方案",
          "检查存在问题",
          "制定整改方案",
          "整改完成",
          "登记问题台帐",
        ],
        //表头
        tableTitle: [
          {
            prop: "recordTime",
            label: "记录时间",
            type:'word',
          },
          {
            prop: "checkResult",
            label: "检查时间",
            type:'steps',
          },
        ],

        //表格数据
        tableData: [
          {
            id: "",
            recordTime: "2020-1-1",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            checkResult: {
                value:3,
            },
          },
          {
            id: "",
            recordTime: "2020-2-1",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 4,
          },
          {
            id: "",
            recordTime: "2020-3-1",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 2,
          },
        ],
      },
        }
    },
    methods:{
          //查看
    handleCheck(value){
       this.routerTitle=this.$route.meta.title;
      console.log(value,".....")
      if(this.routerTitle=="本库检查"){
          this.$router.push({name:"LibraryDetail"})
      }
     
       
    },
   mounted(){
      
      
   }
    }
}
</script>