<template>
  <Dialog :is-dialog-exist="openDeleteDialog" :title="dialogTitle" :dialog-style="dialogStyle" @close-dialog="handleClose">
    <el-container>
      <el-main>
        <el-form ref="formData" :model="formData" label-width="auto">
          <span>是否删除所选列表内容，删除后不可恢复</span>
        </el-form>
      </el-main>
      <el-footer>
        <el-button type="primary">确定</el-button>
        <el-button type="info" plain @click="handleClose">取消</el-button>
      </el-footer>
    </el-container>
  </Dialog>
</template>

<script>
import Dialog from '@/components/Dialog/index'
/**
 * 站长等级的编辑dialog
 */
export default {
  components: { Dialog },
  props: {
    // 弹窗控制参数
    openDeleteDialog: {
      type: Boolean,
      default: false
    },
    // 选中的数据
    selectItem: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      dialogTitle: '删除提示',
      // dialog样式
      dialogStyle: {
        '--dialog-width': '440px',
        '--dialog-height': '243px',
        '--title-height': '51px'
      },
      // 提交参数
      formData: {

      },
      // 校验规则
      rules: {}
    }
  },
  watch: {
    showDialog(val) {
      if (val) {
        this.initDataView()
      }
    }
  },
  methods: {
    // 关闭弹窗
    handleClose() {
      this.$emit('handle-close')
    },
    // 提交弹窗
    handleSuccess() {
      this.$emit('handle-success')
    },
    // 初始化弹窗参数
    initDataView() {
      console.log('初始化弹窗参数')
    },
    // 提交表单
    submitForm() {
      this.$refs.formData.validate(vaild => {
        if (vaild && this.customValidate()) {
          console.log('提交表单')
        }
      })
    },
    customValidate() {
    }
  }
}
</script>

<style lang="scss" scoped>
  .el-container {
    width: 100%;
    height: 100%;
    .el-main {
      height: 90%;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .el-footer {
      height: 10%;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
</style>
