yangys
2024-03-04 81415d9c3353a9edb5220564a397e15a82939b6d
增加注释
已修改1个文件
36 ■■■■■ 文件已修改
src/container/Map/Map.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/Map/Map.vue
@@ -426,22 +426,26 @@
            // setShowMenu(false)
        },
        sign(type) {
            const { x, x1, y, y1 } = this.range
            for (var i = x; i <= x1; i++) {
                for (var j = y; j <= y1; j++) {
                    let arr = [...(this.map[i])]
                    if (arr[j].colspan < 4 || arr[j].rowspan  <  4) {
                        return this.$message({
                            type: 'error',
                            message: '单元格较小,无法展示设备,请至少合并4行4列单元格'
                        })
                    }
                    arr[j].type = type
                    arr[j].id = undefined
                    this.$set(this.map, i, arr)
                }
            }
            //if(type == 2){//2:设备
                console.log('hh',this);
                const { x, x1, y, y1 } = this.range
                for (var i = x; i <= x1; i++) {
                    for (var j = y; j <= y1; j++) {
                        let arr = [...(this.map[i])]
                        if (arr[j].colspan < 4 || arr[j].rowspan  <  4) { //x1-x<3 || y1-y<3
                            return this.$message({
                                type: 'error',
                                message: '单元格较小,无法展示设备,请至少合并4行4列单元格'
                            })
                        }
                        arr[j].type = type
                        arr[j].id = undefined
                        this.$set(this.map, i, arr)
                    }
                }
            //}
            this.showAction = false
            this.$forceUpdate()
        },