<template>
  <el-dialog :title="title" :visible.sync="dialogVisible" width="400px" id="createBSP">
    <div>请输入创建的业务空间名：</div>
    <el-input :placeholder="`请输入业务空间名称`" v-model="roomName"></el-input>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible=false">取 消</el-button>
      <el-button size="small" type="primary" @click="confirm" :disabled="confirmDisable">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      title: '提示',
      dialogVisible: false,
      roomName: '',
      confirmDisable: true
    };
  },
  methods: {
    // 显示弹窗
    showDialog(val) {
      this.roomName = val;
      this.dialogVisible = true;
      this.confirmDisable = false;
    },
    // 确认
    confirm() {
      if (this.roomName == '') {
        this.$message.warning("请填写空间名称");
        return
      }
      this.confirmDisable = true
      this.$emit('createRoom', this.roomName);
      this.dialogVisible = false;
    }
  },
};
</script>