<template>
    <el-dialog :visible.sync="visible" :close-on-click-modal="false" :fullscreen="true" custom-class="upload-dialog"
        :before-close="beforeCloseStudyDig">
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
            <el-tab-pane :label="$t('trials:inspection:pullImage:title:byPatient')" name="byPatient">
                <byPatient :calledAeList="calledAeList" :callingAeList="callingAeList"
                    v-if="activeName === 'byPatient'" />
            </el-tab-pane>
            <el-tab-pane :label="$t('trials:inspection:pullImage:title:byTrials')" name="byTrials">
                <byTrials :calledAeList="calledAeList" :callingAeList="callingAeList"
                    v-if="activeName === 'byTrials'" />
            </el-tab-pane>
            <el-tab-pane :label="$t('trials:inspection:pullImage:title:byTool')" name="byTool">
                <byTool :calledAeList="calledAeList" :callingAeList="callingAeList" v-if="activeName === 'byTool'" />
            </el-tab-pane>
        </el-tabs>
    </el-dialog>
</template>
<script>
import byPatient from './byPatient.vue'
import byTrials from './byTrials.vue'
import byTool from './byTool.vue'
export default {
    name: 'pullImage',
    components: { byPatient, byTrials, byTool },
    props: {
        visible: {
            required: true,
            default: false,
        },
        calledAeList: {
            required: true,
            default: () => {
                return []
            },
        },
        callingAeList: {
            required: true,
            default: () => {
                return []
            },
        },
    },
    data() {
        return {
            activeName: 'byPatient', // byPatient byTrials
        }
    },
    methods: {
        handleClick() { },
        beforeCloseStudyDig() {
            this.$setOpenWindow()
            this.$emit('update:visible', false)
            this.$emit('getList')
        },
    },
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__header {
    padding: 0;
    padding-top: 10px;
}

::v-deep .title {
    line-height: 24px;
    font-size: 18px;
    color: #303133;
    padding: 20px 0;
    padding-bottom: 10px;
}

::v-deep .el-dialog__headerbtn {
    z-index: 99;
}
</style>