<template>
    <vxe-modal v-model="dialogVisible" :title="title" resize :show-footer="false" destroy-on-close transfer height="80vh" mask-closable @hide="close" :width="width">
        <template #default>
            <iframe :src="src" class="iframe-wrapper"></iframe>
        </template>
    </vxe-modal>
</template>

<script setup name="addSpec" lang="ts">
import { propTypes } from '@/utils/propTypes';

const emit = defineEmits(['update:show', 'close', 'success']);

const dialogVisible = ref(false);
const props = defineProps({
    show: propTypes.bool.def(false),
    title: propTypes.string.def('查看追溯信息'),
    width: propTypes.string.def('366px'),
    src: propTypes.string.def('')
});
const close = () => {
    emit('update:show', false);
    emit('close', true);
};
watch(
    () => props.show,
    (val) => {
        dialogVisible.value = val;
    },
    { immediate: true }
);
</script>
<style lang="scss" scoped>
.iframe-wrapper {
    width: 100%;
    height: calc(100% - 1.6em);
    border: none;
}
</style>
