xushiting 2 gadi atpakaļ
vecāks
revīzija
70ba3fb802

+ 4 - 4
src/views/draw-file/board/editCAD/Controls/UIControl.js

@@ -286,8 +286,8 @@ export default class UIControl{
 
     initTopTable(value){
         let center = {
-            x:700,
-            y:200
+            x:770,
+            y:224
         }
         center = coordinate.getXYFromScreen(center)
         let table = tableService.createTable(center)
@@ -297,8 +297,8 @@ export default class UIControl{
 
     initDownTable(value){
         let center = {
-            x:700,
-            y:520
+            x:770,
+            y:568
         }
         center = coordinate.getXYFromScreen(center)
         let table = tableService.createTable(center)

+ 6 - 2
src/views/draw-file/board/editCAD/Geometry/Table.js

@@ -131,14 +131,18 @@ export default class Table extends Geometry {
         let height=0;
 
         //删除多余的
-        for(let i=maxRow+1;i<this.cells.length;++i){
-            for(let j=maxCol+1;j<this.cells[i].length;++j){
+        for(let i=maxRow;i<this.cells.length;++i){
+            for(let j=maxCol;j<this.cells[i].length;++j){
                 const cell = floorplanService.getCell(this.cells[i][j]);
                 if(cell){
                     floorplanService.deleteCell(this.cells[i][j]);
                 }
             }
         }
+        this.cells.splice(maxRow, this.cells.length-maxRow); 
+        for(let i=0;i<maxRow;++i){
+            this.cells[i].splice(maxCol, this.cells[0].length-maxCol); 
+        }
 
         this.rowLen = this.cells.length;
         this.colLen = this.cells[0].length;