Sfoglia il codice sorgente

bus 定额人材机显示速度

zhangweicheng 6 anni fa
parent
commit
1cdc457208

+ 3 - 4
public/web/sheet/sheet_common.js

@@ -109,7 +109,7 @@ var sheetCommonObj = {
             area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
         }
     },
-    showData: function(sheet, setting, data,distTypeTree) {
+    showData: function(sheet, setting, data,distTypeTree,callback) {//这个callback是为了在showdata后还做了引起重画表格的操作,在callback里调用能提高效率
         var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
         sheet.suspendPaint();
         sheet.suspendEvent();
@@ -159,6 +159,7 @@ var sheetCommonObj = {
             }
         }
         this.lockCells(sheet,setting);
+        if(callback) callback();
         sheet.resumeEvent();
         sheet.resumePaint();
         //me.shieldAllCells(sheet);
@@ -569,9 +570,9 @@ var sheetCommonObj = {
                     ctx.fill();//画实心圆
                     ctx.closePath();
                     ctx.restore();
+                    w = w - imageWidth - imageMagin;
                     //这里的左对齐的,当显示的字长度超过空白地方时,要改成右对齐
                     if(style.hAlign == 0){
-                        w = w - imageWidth - imageMagin;
                         if(value){
                             let textWidth = ctx.measureText(value).width;
                             let spaceWidth = w;
@@ -579,8 +580,6 @@ var sheetCommonObj = {
                                 style.hAlign = 2;
                             }
                         }
-                    }else if(style.hAlign == 2){//如果是右对齐的,往左边挪,给按钮留出空间
-                        x = x - imageWidth - imageMagin;
                     }
 
                 }

+ 12 - 10
web/building_saas/main/js/views/glj_view.js

@@ -575,6 +575,7 @@ var gljOprObj = {
         }
     },
     showRationGLJSheetData: function (init) {
+        let me = this;
         let selected = this.sheet.getSelections();
         this.combineWithProjectGlj(this.sheetData);
         this.sheet.setRowCount(0);
@@ -582,16 +583,17 @@ var gljOprObj = {
         this.sumQuantity();//计算总消耗量
         this.addMixRatioToShow();//显示组成物信息
         this.initRationTree(init,this.getUnitPriceCodeMap());
-        sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
-        if(this.mainTreeSelectedChange == true){
-            this.sheet.setSelection(0,1,1,1);//默认选中第一行,第二列(名称列)
-            this.mainTreeSelectedChange = false;
-        }else if(selected){//定位光标到之前的位置
-            this.sheet.setSelection(selected[0].row,selected[0].col,selected[0].rowCount,selected[0].colCount);
-        }
-        //初始选择
-        this.preGljSelection = null;
-        this.sheetInitSelection({row: this.sheet.getActiveRowIndex(), col: this.sheet.getActiveColumnIndex()});
+        sheetCommonObj.showData(this.sheet, this.setting, this.sheetData,null,function () {
+            if(me.mainTreeSelectedChange == true){
+                me.sheet.setSelection(0,1,1,1);//默认选中第一行,第二列(名称列)
+                me.mainTreeSelectedChange = false;
+            }else if(selected){//定位光标到之前的位置
+                me.sheet.setSelection(selected[0].row,selected[0].col,selected[0].rowCount,selected[0].colCount);
+            }
+            //初始选择
+            me.preGljSelection = null;
+            me.sheetInitSelection({row: me.sheet.getActiveRowIndex(), col: me.sheet.getActiveColumnIndex()});
+        });
 
     },
     getSelectedRationGlj:function () {

+ 2 - 2
web/building_saas/main/js/views/project_view.js

@@ -1946,10 +1946,10 @@ var projectObj = {
                     ctx.fill();//画实心圆
                     ctx.closePath();
                     ctx.restore();
-                    x = x - imageWidth - imageMagin;
+                    w = w - imageWidth - imageMagin;
                 }
             }
-            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
         };
         CommonTotalFeeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             return {

+ 1 - 1
web/building_saas/main/js/views/quantity_edit_view.js

@@ -80,7 +80,7 @@ let quantityEditObj = {
                     ctx.fill();//画实心圆
                     ctx.closePath();
                     ctx.restore();
-                    x = x - imageWidth - imageMagin;
+                    w = w - imageWidth - imageMagin;
                 }
             }
             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);