<template>
    <Modal
        :fullscreen="false"
        :styles="styles"
        :title="title"
        :mask-closable="false"
        class-name="modal-table"
        :width="width"
        :value="true"
    >
        <common-table-alloc :readonly="readonly" :conf_guid="conf_guid" :rowData="rowData"></common-table-alloc>
        <Button slot="footer" type="primary" @click.stop.prevent="onOK">关闭</Button>
    </Modal>
</template>
<script>
import CommonTableAlloc from '../../../../../common-table-alloc'
export default {
    name: 'CommonTableAllocModal',
    components: {
        CommonTableAlloc
    },
    data() {
        return {}
    },

    props: {
        title: {
            type: String,
            default: '分配'
        },

        styles: {
            type: Object,
            default() {
                return {
                    top: '20px'
                }
            }
        },

        conf_guid: {
            type: String
        },

        rowData: Object,

        height: {
            type: Number,
            default: 200
        },

        width: {
            type: Number | String,
            default: 984
        },

        /**
         * 是否只读
         */
        readonly: {
            type: Boolean,
            default: false
        }
    },

    methods: {
        onOK() {
            this.remove()
        },
        remove() {
            setTimeout(() => {
                this.destroy()
            }, 300)
        },
        destroy() {
            this.$destroy()
            document.body.removeChild(this.$el)
        }
    }
}
</script>
<style lang="less">
</style>
