<template>
  <div class="dialog">
    <el-dialog
      :title="dialogObj.title"
      :show-close="false"
      v-model:visible="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>
      <template v-slot:footer>
        <span 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>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { $on, $off, $once, $emit } from '../../../../utils/gogocodeTransfer'
export default {
  props: {
    dialogObj: {
      type: Object,
      default: () => {
        return null
      },
    },
  },
  data() {
    return {}
  },
  created() {},
  methods: {
    confirm() {
      $emit(this, 'confirm')
    },
    hide() {
      // this.$emit('hide');
      this.dialogObj.visible = false
    },
  },
  emits: ['confirm'],
}
</script>

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