<template>

    <el-dialog :close-on-click-modal="!deleteLoading" v-dlg-drag :title="dialogTitle" :visible.sync="deleteDialog">
        
            <div class="message-box__content">
                
                <div class="message-box-title" >
                    <slot name="title"></slot>
                </div>
                <div class="message-box-info">
                    <slot name="info"></slot>
                </div>
            </div>
            <slot name="content"></slot>
        
        <div slot="footer" class="dialog-footer">
            <el-button @click="deleteDialog = false">{{"取消"}}</el-button>
            <el-button type="primary" @click="deleteCallback.call(vmContext,deleteParam)">{{"确定"}}</el-button>
        </div>
    </el-dialog>
</template>
<script type="text/javascript">
export default {
  data() {
    return {
      deleteDialog: false,
    };
  },
  props: {

    vmContext: {
      type: Object,
      default() {
        return {};
      }
    },
    dialogTitle: {
      type: String,
      default: '',
    },
    deleteLoading: {
      type: Boolean,
      default: false,
    },
    deleteCallback: {
      type: Function,
      default() {
        return () => {};
      }
    },
    deleteParam: {
      type: String,
      default: ''
    },
    value: {
      type: Boolean,
      default: false,
    }
  },
  computed: {
  },
  watch: {
    deleteDialog() {
      this.$emit('input', this.deleteDialog);
    },
    value() {
      this.deleteDialog = this.value;
    },
  },
  created() {
    this.deleteDialog = this.value;
  }
};
</script>

<style scoped>
.el-message-box__content .icon{float:left;}
.message-box__content{}
.message-box__content .icon{float:left;margin-right:20px;}
.message-box__content .message-box-title{font-size:16px;padding:2px 0;color:#333;}
.message-box__content .message-box-p{font-size:16px;padding:20px 0;color:#333;}
.message-box__content .message-box-info{color:#999;padding:2px 0;}
.dialog-footer,.el-message-box__btns{text-align:center;}


/deep/ .el-dialog__header {
    background: #0067b3;
    padding: 12px 30px;
    line-height: 25px;}
/deep/ .el-dialog__title {
    font-family: PingFangSC-Regular;
    font-size: 18px;
    color: #fff;
    font-weight: 200;
    line-height: 25px;
    height: 25px;
}
/deep/ .el-dialog__footer {
    background: #eff3f9;
    padding: 20px 30px;
}
/deep/ .el-dialog{
    width: 40%;
}
</style>
