yangys
2024-03-08 39ae7e015cf594bd32b05c5e6e039d20b8e28bea
修改地图的设备行列限制
已修改1个文件
21 ■■■■■ 文件已修改
src/container/Map/Map.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/Map/Map.vue
@@ -429,20 +429,36 @@
            //if(type == 2){//2:设备
                //console.log('hh',this);
                const { x, x1, y, y1 } = this.range
                //console.log(x1-x,y1-y);
                //10*10单元格才可以放设备
                var line = x1-x + 1;//行数
                var col = y1-y + 1;//列数
                console.log('行数=',line)
                console.log('列数=',col)
                if(type == 2 && (line < 8 || col<9)){
                    this.$message({
                                type: 'error',
                                message: '单元格较小,无法展示设备,请至少合并8行9列单元格.当前为'+line+'行'+col+'列'
                            });
                    return;
                }
                console.log('contnuye le');
                
                for (var i = x; i <= x1; i++) {
                    for (var j = y; j <= y1; j++) {
                        
                        let arr = [...(this.map[i])]
                        /*
                        if (type == 2 && (arr[j].colspan < 4 || arr[j].rowspan  <  4)) { //x1-x<3 || y1-y<3
                            
                            return this.$message({
                                type: 'error',
                                message: '单元格较小,无法展示设备,请至少合并4行4列单元格'
                                message: '单元格较小,无法展示设备,请至少合并4行4列单元格。'
                            })
                            
                        }
                        */
                        arr[j].type = type
                        arr[j].id = undefined
                        this.$set(this.map, i, arr)
@@ -450,6 +466,7 @@
                    }
                    
                }
            //}
            this.showAction = false
            this.$forceUpdate()