| | |
| | | //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) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //} |
| | | this.showAction = false |
| | | this.$forceUpdate() |