<template>
    <div>
          <el-table border :data="result.tableData">
      <el-table-column type="index" width="50"> </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.prop == 'recordTime'">
            {{ scope.row.recordTime }}
            <!-- {{ scope.row }} -->
          </div>
          <div v-if="item.prop == 'title'">
            {{ scope.row.title }}
          </div>

          <div v-if="item.prop == 'operation'">
               <!-- {{ scope.row }} -->
            <el-radio-group v-model="scope.row.operation.radio">
              <el-radio  label="1">{{scope.row.operation.status1}}</el-radio>
              <el-radio  label="0">{{scope.row.operation.status2}}</el-radio>
            </el-radio-group>
          </div>
        </template>
      </el-table-column>
      <!-- <el-table-column align="center" fixed="right" label="选项" width="200">
        <template slot-scope="scope">
          <el-radio-group v-model="radio">
            <el-radio :label="0">达标</el-radio>
            <el-radio :label="1">不达标</el-radio>
            
          </el-radio-group>
        </template>
      </el-table-column> -->
    </el-table>
    </div>
</template>
<script>
export default {
    name:"RadioTable",  
    data(){
        return{
             radio: "",
      //模拟数据
      result: {
        //流程图
        flow: [
          {
            id: "",
            time: "2020-1-1",
            title: "1/3",
            imgst: "",
          },
          {
            id: "",
            time: "2020-1-1",
            title: "1/2",
            imgst: "",
          },
          {
            id: "",
            time: "2020-1-1",
            title: "2/3",
            imgst: "",
          },
          {
            id: "",
            time: "2020-1-1",
            title: "自验收",
            imgst: "",
          },
          {
            id: "",
            time: "2020-1-1",
            title: "质监巡查",
            imgst: "",
          },
          {
            id: "",
            time: "2020-1-1",
            title: "质监验收",
            imgst: "",
          },
        
        ],
        //表头
        tableTitle: [
          {
            prop: "recordTime",
            label: "记录时间",
          },
          {
            prop: "title",
            label: "标题",
          },
          {
            prop: "operation",
            label: "操作",
          },
        ],

        //表格数据
        tableData: [
          {
            id: "",
            recordTime: "2020-1-1",
            title: "1/3质量",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 3,
            operation: {
                radio:"1",
              status1:"达标",
              status2:"不达标",
            },
          },
          {
            id: "",
            recordTime: "2020-1-1",
            title: "1/3品质",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 4,
            operation: {
                radio:"1",
               status1:"达标",
              status2:"不达标",
            },
          },
          {
            id: "",
            recordTime: "2020-1-1",
            title: "1/3毒素指标",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 2,
            operation: {
                radio:"1",
              status1:"达标",
              status2:"不达标",
            },
          },
           

             {
            id: "",
            recordTime: "2020-1-1",
            title: "1/2质量",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 3,
            operation: {
                 radio:"1",
              status1:"达标",
              status2:"不达标",
            },
          },
          {
            id: "",
            recordTime: "2020-1-1",
            title: "1/2品质",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 4,
            operation: {
                radio:"0",
               status1:"达标",
              status2:"不达标",
            },
          },
           {
            id: "",
            recordTime: "2020-1-1",
            title: "1/2毒素指标",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 2,
            operation: {
                 radio:"1",
                 status1:"达标",
              status2:"不达标",
            },
          },



              {
            id: "",
            recordTime: "2020-1-1",
            title: "2/3质量",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 3,
            operation: {
                radio:"0",
              status1:"达标",
              status2:"不达标",
            },
          },
          {
            id: "",
            recordTime: "2020-1-1",
            title: "2/3品质",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 4,
            operation: {
                radio:"1",
               status1:"达标",
              status2:"不达标",
            },
          },
           {
            id: "",
            recordTime: "2020-1-1",
            title: "2/3毒素指标",
            tableStr: ["1_1_1", "2_0_2", "3_1_3"],
            flowNow: 2,
            operation: {
                radio:"0",
                 status1:"达标",
              status2:"不达标",
            },
          },
        ],
      },
        }
    }
}
</script>