yangys
2024-03-04 81415d9c3353a9edb5220564a397e15a82939b6d
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()
        },