瀏覽代碼

update contextMenu

zhongzewei 7 年之前
父節點
當前提交
d3d5d49842
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      web/maintain/ration_repository/js/ration_glj.js

+ 5 - 5
web/maintain/ration_repository/js/ration_glj.js

@@ -293,11 +293,11 @@ var rationGLJOprObj = {
                     x = e.pageX - offset.left,
                     y = e.pageY - offset.top;
                 let target = sheet.hitTest(x, y);
-                if(sheet.parent.getActiveSheetIndex() === 0){
-                    let delDis = true;
-                    let cacheSection = me.cache["_GLJ_" + me.currentRationItem.ID];
-                    if(target.hitTestType === 3 && typeof target.row !== 'undefined' && typeof target.col !== 'undefined'){//在表格内
-                        sheet.setActiveCell(target.row, target.col);
+                if(sheet.parent.getActiveSheetIndex() === 0 && target.hitTestType === 3 && typeof target.row !== 'undefined' && typeof target.col !== 'undefined'){
+                    let delDis = true, cacheSection;
+                    sheet.setActiveCell(target.row, target.col);
+                    if(me.currentRationItem){
+                        let cacheSection = me.cache["_GLJ_" + me.currentRationItem.ID];
                         if(target.row < cacheSection.length){
                             delDis = false;
                         }