Blame view

src/components/room/deleteFloor.vue 1.42 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
81955f61   wuxw   优化房屋页面
2
    <el-dialog :title="$t('room.deleteFloor.title')" :visible.sync="visible" width="30%" :before-close="handleClose">
af1bcbd6   wuxw   房屋页面开发中
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
      <p>{{ $t('room.deleteFloor.confirmMessage') }}</p>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">{{ $t('room.deleteFloor.cancelText') }}</el-button>
        <el-button type="danger" @click="handleDelete">{{ $t('room.deleteFloor.confirmDelete') }}</el-button>
      </span>
    </el-dialog>
  </template>
  
  <script>
  import { deleteFloor } from '@/api/room/deleteFloorApi'
  
  export default {
    name: 'DeleteFloor',
    data() {
      return {
        visible: false,
        floorInfo: {
          floorId: '',
          communityId: this.getCommunityId()
        }
      }
    },
    methods: {
      open(floorInfo) {
        this.floorInfo = {
          ...floorInfo,
          communityId: this.getCommunityId()
        }
        this.visible = true
      },
      handleClose() {
        this.visible = false
      },
      async handleDelete() {
        try {
          const response = await deleteFloor(this.floorInfo)
81955f61   wuxw   优化房屋页面
39
40
  
          if (response.code == 0) {
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
41
            this.$message.success(this.$t('common.operationSuccess'))
af1bcbd6   wuxw   房屋页面开发中
42
            this.handleClose()
81955f61   wuxw   优化房屋页面
43
44
            this.$emit('handleRefreshTree', {})
  
af1bcbd6   wuxw   房屋页面开发中
45
46
47
48
49
50
51
          } else {
            this.$message.error(response.msg || this.$t('room.deleteFloor.deleteFailed'))
          }
        } catch (error) {
          this.$message.error(this.$t('room.deleteFloor.deleteError'))
        }
      },
af1bcbd6   wuxw   房屋页面开发中
52
53
54
    }
  }
  </script>