<template>
    <awsui-dialog
            title="批量替换"
            height="700px"
            width="900px"
            :visible.sync="dialogVisible"
            :border="false"
            :before-close="handleClose"
            :destroy-on-close=true>
        <iframe id="batchRelplaceIframe" style="border: 0px;width: 100%;height: 695px;" name="batchRelplaceIframe" :src="src"></iframe>
    </awsui-dialog>
</template>

<script>
    export default {
        name: "replace",
        props: {
            visible: {
                type: Boolean,
                default: false
            },
            methodCategory: {
                type: String,
                default: ''
            }
        },
        data() {
            return {
                dialogVisible: false,
                src: wHref + '?' + 'sid=' + this.$store.state.sessionId + '&mainPage=replace&cmd=com.actionsoft.apps.coe.pal.batch_main_page&methodCategory=' + this.methodCategory + '&wsId=' + this.$store.getters.getWsIdFn + '&teamId=' + this.$store.getters.getTeamIdFn,
            }
        },
        created() {
            const that = this;
            // 注册关闭批量创建窗口通用方法
            window.closeBatchReplaceFn = function (params) {
                that.closeDlalog();
                that.dialogVisible = false;
            }
        },
        methods: {
            handleClose(done) {
                this.closeDlalog();
                done();
            },
            closeDlalog() {// 关闭
                this.$emit('getResult');
            }
        },
        watch: {
            visible(val) {
                this.dialogVisible = val;
            }
        }
    }
</script>

<style scoped>

</style>