<style lang="scss" scoped>
.layout_container {
    height: 600px !important;
    padding: 0 20px;
}
</style>
<template>
    <el-dialog v-model="drawerVisible" align-center :title="title" width="800" @close="handleClose"
        :close-on-click-modal="showDrawerClose" :close-on-press-escape="showDrawerClose" :show-close="true">
        <div class="layout_container">
            <iframe :src="iframeSrc" frameborder="0" width="100%" height="100%" style="width: 100%; height: 100%;"></iframe>
        </div>
        <template #footer>
            <div class="layout_footer">
                <el-button type="info" @click="handleClose">取消</el-button>
            </div>
        </template>
    </el-dialog>
</template>

<script setup>
import { onMounted, ref, watch } from 'vue'


const props = defineProps({
    store: Object
});

const emit = defineEmits(['close'])
const showDrawerClose = ref(false)
const drawerVisible = ref(false)
const title = ref('附件')
const iframeSrc = ref('')

watch(() => props.store, (newValue) => {
    if (newValue && newValue.openDditFlag !== undefined) {
        drawerVisible.value = newValue.openDditFlag
    }
    if (newValue && newValue.src !== undefined) {
        iframeSrc.value = newValue.src
    }
}, { immediate: true, deep: true })

const handleClose = () => {
    iframeSrc.value = ''
    emit('close')
}



onMounted(() => {
})

</script>
