<template>
  <div class="device-test-info-from">
    <div class="template-table">
      <EdfsTable
        class="table"
        v-loading="loading"
        :data="list"
        :usePaging="false"
        :highlight-current-row="true"
        row-class-name="row"
      >
        <template v-for="(col, idx) in tableCol" :key="idx">
          <!-- <el-table-column
            v-if="col.prop === 'status'"
            :label="col.label"
            :min-width="col.minWidth"
          >
            <template #default="scope"> </template>
          </el-table-column> -->

          <el-table-column
            v-if="col.prop.endsWith('Time')"
            :label="col.label"
            :min-width="col.minWidth"
          >
            <template #default="scope">
              {{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
            </template>
          </el-table-column>
          <el-table-column
            v-else
            :prop="col.prop"
            :label="col.label"
            :min-width="col.minWidth"
          />
        </template>
      </EdfsTable>
      <EdfsButton inner-text="提交并入库" type="success" class="save-button" />
    </div>
  </div>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import EdfsTable from '@/components/dashboard/Edfs-table/index.vue'
import EdfsButton from '@/components/dashboard/Edfs-button/index.vue'
import FormItemSelect from '@/components/dashboard/FormItemSelect.vue'

const tableCol = [
  { label: '测试内容', prop: 'content', minWidth: '10%' },
  { label: '预计结果', prop: 'result', minWidth: '10%' },
  { label: '测试结果', prop: 'status', minWidth: '10%' },
  { label: '备注', prop: 'entryTime', minWidth: '16%' },
]

const loading = ref(true)
const list = ref([])

const getList = async () => {
  loading.value = true

  loading.value = false
}

onMounted(() => {
  getList()
})
</script>

<style scoped lang="scss">
.device-test-info-from {
  height: 100%;
  width: 100%;
  .template-table {
    display: flex;
    column-gap: 24px;
    .table {
      width: 1090px;
      height: 100%;
    }
    .save-button {
      margin-top: auto;
      margin-bottom: 12px;
    }
  }
}
</style>
