<template>
  <div class="dialogWarp">
    <el-dialog  v-model="show" @close="close" :title="title"
                close-on-press-escape
                show-close
                destroy-on-close
                :close-on-click-modal="false"
    >
      <template v-slot:title>
        <span class="dialogTitle">{{title}}</span>
      </template>
      <div class="del-wrap">
        <ul class="del-con">{{content}}</ul>
      </div>
<!--      <template #footer>-->
        <div class="del-btn">
          <div  v-if="know">
            <el-button size="mini" type="primary" @click="submitSure" style="color: #ffffff" >我知道了</el-button>
          </div>
          <div v-else>
            <el-button size="mini" type="primary" @click="submitSure" style="color: #ffffff" >确定</el-button>
            <el-button size="mini" style="color: #5075FC" @click="submitReset">取消</el-button>
          </div>

        </div>
<!--      </template>-->
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'byComfirmDlg',
  data() {
    return {
      show: false,
    }
  },
  props: {
    content: String,
    innerVisible:{
      type: Boolean
    },
    title:{
      type: String,
      default: ''
    },
    know: {
      type: Boolean,
      default: false
    },
  },
  watch: {
    'innerVisible': {
      handler:function(newVal) {
        this.show = newVal
      },
      immediate:true
    }
  },
  mounted () {

  },
  computed: {

  },
  methods: {
    async submitSure () {
      this.$emit('submitSureClick')// 此方法名字歧义  不建议使用 但是旧代码再用 还不能删除
      this.$emit('submitClick')
    },
    submitReset () {
      this.$emit('DialogFalse')// 此方法名字歧义  不建议使用 但是旧代码再用 还不能删除
      this.$emit('cancelClick')
    },
    close() {
      this.$emit('DialogCloseFalse')
      this.$emit('DialogClose')
    }
  }
}
</script>

<style lang="less">
.dialogWarp {
  width: 100%;
  height: 100%;
  .dialogTitle:before {
    content:"";
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #5075FC;
    margin-right: 8px;
  }
  .del-con {
    text-align: center;
  }
  .del-btn {
    //position: absolute;
    //left: 165px;
    //bottom: 20px;
    text-align: center;
    margin-top: 20px;
  }
  .el-dialog {
    width: 345px;
    height: 195px;
    margin-top: 10%;
  }
  .el-dialog__body {
    //width: 100%;
    border: none;
  }
}








</style>
