From 39ae7e015cf594bd32b05c5e6e039d20b8e28bea Mon Sep 17 00:00:00 2001 From: yangys <y_ys79@sina.com> Date: 星期五, 08 三月 2024 16:04:16 +0800 Subject: [PATCH] 修改地图的设备行列限制 --- src/container/Map/Map.vue | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/container/Map/Map.vue b/src/container/Map/Map.vue index 3d8a414..96b7561 100644 --- a/src/container/Map/Map.vue +++ b/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() -- Gitblit v1.9.3