<!--
 * @Author: zwq
 * @Date: 2021-11-18 14:16:25
 * @LastEditors: zwq
 * @LastEditTime: 2022-12-28 09:45:02
 * @Description:
-->
<template>
  <el-table
    :data="dataList"
    :stripe="true"
    :header-cell-style="{
      background: '#eef1f6',
      color: '#606266',
      height: '56px',
    }"
    v-loading="dataListLoading"
    style="width: 100%;"
  >
    <el-table-column type="index" header-align="center" align="center" label="序号" width="50">
    </el-table-column>
    <el-table-column prop="workingProcedureName" align="center" label="工序"> </el-table-column>
    <el-table-column prop="name" align="center" label="特性"> </el-table-column>
    <el-table-column prop="defectLevel" align="center" label="缺陷等级">
        <template slot-scope="scope">
          <span>{{
            { 1: '致命缺陷',2: '严重缺陷',3: '轻微缺陷' }[
              scope.row.defectLevel
            ]
          }}</span>
        </template> </el-table-column>
    <el-table-column prop="type" align="center" label="特性类型"> 
        <template slot-scope="scope">
          <span>{{
            { 1: "计量型", 2: "计数型"}[
              scope.row.type
            ]
          }}</span>
        </template></el-table-column>
    <el-table-column prop="measureToolName" align="center" label="量具"> </el-table-column>
    <el-table-column prop="usl" align="center" label="USL"> </el-table-column>
    <el-table-column prop="sl" align="center" label="SL"> </el-table-column>
    <el-table-column prop="lsl" align="center" label="LSL"> </el-table-column>
    <el-table-column prop="black1" align="center" label="记录数量"> </el-table-column>
    <el-table-column prop="black2" align="center" label="最大值"> </el-table-column>
    <el-table-column prop="black3" align="center" label="最小值"> </el-table-column>
    <el-table-column prop="black4" align="center" label="均值"> </el-table-column>
    <el-table-column prop="black5" align="center" label="检验结果"> </el-table-column>
    <el-table-column prop="black6" align="center" label="缺陷数量"> </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    featuresList: {
      type: Array,
      default: () => {
        [];
      },
    },
    workingProcedureName: {
      type: String,
    },
  },
  data() {
    return {
      dataListLoading: false,
      dataList: [],
    };
  },
  methods: {
    init() {
      this.dataList.splice(0,this.dataList.length)
      this.featuresList.forEach((item) => {
        item.workingProcedureName = this.workingProcedureName?this.workingProcedureName:item.workingProcedureName
      });
      this.dataList = JSON.parse(JSON.stringify(this.featuresList));
      this.dataListLoading = false;
      this.$nextTick(() => {});
    },
  },
};
</script>
