<template>
    <div>
        <el-dialog
                class="BatchProcessDL"
                title=""
                :visible.sync="visible"
                width="400px"
                :close-on-click-modal="false"
                :modal="false"
                :modal-append-to-body="modalAppendToBody"
                center>
            <!--<div class="be_careful" v-if="dType === 'warning'"><i class="warn-img"></i><p>{{dMessage}}</p></div>-->
            <div class="img-box">
                <i class="warn-img" v-if="dType === 'warning'"></i>
                <i class="delete-img" v-if="dType === 'delete'"></i>
            </div>
            <p>{{dMessage}}</p>
            <span slot="footer" class="dialog-footer">
              <el-button @click="visible = false">取 消</el-button>
              <el-button type="primary" @click="comfirm()">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
    export default {
        props:      {
            dVisible: {
                type: Boolean,
            },
            dType:    {
                type: String,   // error/warning
            },
            dMessage: {
                type: String,   // error/warning
            },
            modalAppendToBody:   {
                type:    Boolean,
                require: true,
                default: false,
            },
        },
        components: {},
        data() {
            return {
                visible:         false,
                uploadfileParam: {},
            };
        },
        methods: {
            init(type, message) {
                this.dType = type;
                this.dMessage = message;
                this.show();
            },
            show() {
                this.visible = true;
            },
            comfirm() {
                this.visible = false;
                this.$emit("comfirmCallback");
            }
        },
        mounted() {
        },
        watch:{
            dVisible(val) {
                this.visible = val;
            },
            visible(val) {
                this.$emit("update:dVisible", val);
            }
        }
    };
</script>
