<template>
  <div>
    <!--主表格-->
    <el-table
      class="table"
      ref="table_form"
      :data="list"
      element-loading-text="Loading"
      border
      fit
      highlight-current-row
    >
      <el-table-column label="序号" align="center" width="80px" type="index" />
      <template v-if="type == '查看设备'">
        <el-table-column label="设备名称" align="center">
          <template slot-scope="scope">
            {{ scope.row.name }}
          </template>
        </el-table-column>
        <el-table-column label="设备编号" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.sn }}</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.createTime }}</span>
          </template>
        </el-table-column>
      </template>
      <template v-else>
        <el-table-column label="实名照片" align="center">
          <template slot-scope="scope">
            <el-image
              style="width: 70px; height: 70px"
              :src="scope.row.avatar"
              :preview-src-list="[scope.row.avatar]"
            >
              <div slot="error" class="image-slot">
                {{ scope.row.avatar ? "加载失败" : "暂无照片" }}
              </div>
            </el-image>
          </template>
        </el-table-column>
        <el-table-column label="姓名" align="center">
          <template slot-scope="scope">
            {{ scope.row.name }}
          </template>
        </el-table-column>
        <el-table-column label="手机号" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.phone }}</span>
          </template>
        </el-table-column>
        <el-table-column label="身份证号" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.idNumber }}</span>
          </template>
        </el-table-column>

        <el-table-column label="创建时间" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.createTime }}</span>
          </template>
        </el-table-column>
      </template>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: {
    list: {
      type: Array,
    },
    type: {
      type: String,
    },
  },

  data() {
    return {};
  },
  methods: {
    isdelete() {},
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
};
</script>

<style scoped lang="scss">
</style>
