<template>
    <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane v-for="item in tabs" :key="item.Id"
            :label="`${item.AuditTime} ${item.AuditContent} (${item.CompanyName})`" :name="item.Id">
            <auditDocument v-if="activeName === item.Id" :isManage="false" :AuditRecordId="item.Id" />
        </el-tab-pane>
    </el-tabs>

</template>
<script>
import { getAuditRecordSelectList } from '@/api/trials'
import auditDocument from "@/views/trials/trials-workbench/components/auditDocument"
export default {
    name: "auditDocumentView",
    components: { auditDocument },
    data() {
        return {
            activeName: '',
            tabs: []
        }
    },
    created() {
        this.getTabs()
    },
    methods: {
        handleClick(row) {
            this.activeName = row.name
        },
        async getTabs() {
            try {
                let res = await getAuditRecordSelectList({})
                if (res.IsSuccess) {
                    this.tabs = res.Result
                    this.activeName = res.Result[0].Id
                }
            } catch (err) {
                console.log(err)
            }
        }
    }
}
</script>
<style lang="scss" scoped></style>