<template>
  <div class="dialog">
    <el-dialog
      :title="dialogObj.title"
      :show-close=false
      :visible.sync="dialogObj.visible"
      :close-on-click-modal="false"
      width="600px"
      center>
      <p style="text-align: center;">{{dialogObj.message}}</p>
      <p class="tip" v-if="dialogObj.tip">{{dialogObj.tip}}</p>
      <span slot="footer" class="dialog-footer">
        <el-button @click="confirm" v-if="dialogObj.confirmMsg">{{dialogObj.confirmMsg}}</el-button>
        <el-button type="primary" @click="hide" v-if="dialogObj.hideMsg">{{dialogObj.hideMsg}}</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    dialogObj: {
      type: Object,
      default: () => {
        return null;
      }
    }
  },
  data() {
    return {
    }
  },
  created() {},
  methods: {
    confirm() {
      this.$emit('confirm');
    },
    hide() {
      // this.$emit('hide');
      this.dialogObj.visible = false;
    }
  }
}
</script>

<style lang="scss" scoped>
.tip {
  margin-top: 20px;
  text-align: center;
  color: #C0C0C0;
}
</style>
