<template>
    <el-table
        ref="verifyTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
    >
        <el-table-column type="selection" width="55" />
        <el-table-column prop="goodsId" label="商品编码" />
        <el-table-column prop="goodsName" label="商品名称" />
        <el-table-column prop="inspectionStandard" label="执行标准" />
        <el-table-column prop="inspectionOwnItem" label="自检检验项目" />
        <el-table-column prop="inspectionUser" label="检验人" />
        <el-table-column prop="inspectionImgUrl" label="检验图片" >
            <template v-slot="{ row }">
                <template v-if="row.inspectionImgUrl != '--'">
                    <el-image
                        style="width: 60px; height: 60px;margin: 5px;"
                        v-for="(item,index) in row.inspectionImgUrl"
                        :key="index"
                        :src="item"
                        :preview-src-list="row.inspectionImgUrl"
                        fit="fill" 
                    />
                </template>
                <template v-else>
                    <span>{{ row.inspectionImgUrl }}</span>
                </template>
            </template>
        </el-table-column>
        <el-table-column prop="inspectionVideoUrl" label="检验视频" >
            <template v-slot="{ row }">
                <template v-if="row.inspectionVideoUrl != '--'">
                    <VideoUpload v-model="row.inspectionVideoUrl" :value="row.inspectionVideoUrl" :disabled="true" :isShowTip="false" />
                </template>
                <template v-else>
                    <span>{{ row.inspectionVideoUrl }}</span>
                </template>
            </template>
        </el-table-column>
    </el-table>
</template>

<script>
import VideoUpload from '@/components/VideoUpload';
export default {
    name: "SelectInspectionView",
    components: {
        VideoUpload,
    },
    props: {
        tableData: {
            type: Array,
            default: [],
        },
        selectedInspection: {
            type: Array,
            default: [],
        },
    },
    data() {
        return {
        }
    },
    created() {},
    mounted() {},
    watch:{},
    methods: {
        handleSelectionChange(val) {
            this.$emit('update:selectedInspection', val);
        },
    }
}
</script>
<style scoped lang="scss">
</style>