Forráskód Böngészése

所有展开收起,鼠标在方框以外1个像素也应识别到、bug

zhongzewei 7 éve
szülő
commit
d93f5c5266

+ 2 - 1
public/web/sheet/sheet_common.js

@@ -749,7 +749,8 @@ var sheetCommonObj = {
             };
         }
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
-            if (!_.isEmpty(this.rectInfo)&&hitinfo.x < this.rectInfo.x+this.rectInfo.rectW && hitinfo.x > this.rectInfo.x) {
+            ////方框外1像素内都有效
+            if (!_.isEmpty(this.rectInfo)&&Math.floor(hitinfo.x) <= this.rectInfo.x+this.rectInfo.rectW+2 && Math.floor(hitinfo.x) >= this.rectInfo.x-2) {
                 this.collapsed = !this.collapsed;
                 datas[row].collapsed = this.collapsed;
                 this.refreshChildrenVisible(hitinfo.sheet);

+ 3 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -469,7 +469,9 @@ var TREE_SHEET_HELPER = {
             if (!node || node.children.length === 0) { return; }
             let centerX = hitinfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
             let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
-            if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
+            //方框外1像素内都有效
+            if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
+                hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);
                 let sheetName = hitinfo.sheet.name();
                 if(sheetName === 'stdBillsLib_bills'){

+ 3 - 2
web/building_saas/main/js/views/block_lib.js

@@ -298,8 +298,9 @@ var blockLibObj = {
             function withingClickArea(){
                 return hitinfo.x > centerX + halfBoxLength && hitinfo.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength;
             }
-
-            if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
+            //方框外1像素内都有效
+            if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
+                hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);
                 TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
                     let iCount = node.posterityCount(), i, child;

+ 9 - 2
web/building_saas/main/js/views/project_property_basicInfo.js

@@ -398,9 +398,16 @@ let basicInfoView = {
         }
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
             var recode = data[hitinfo.row];
+            let offset = -1,
+                indent = 20,
+                halfBoxLength = 5;
+            let centerX = hitinfo.cellRect.x + offset + indent / 2;
+            let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2
             if(recode&&recode.hasOwnProperty('items')){
-                var hoffset= hitinfo.cellRect.x+3;
-                if (hitinfo.x > hoffset && hitinfo.x < hoffset + 10){
+                //方框外1像素内都有效
+                const boxLengh = 10;
+                if (hitinfo.x >= centerX - halfBoxLength - 1 && hitinfo.x <= centerX + halfBoxLength + 1 &&
+                    hitinfo.y >= centerY - halfBoxLength - 1 && hitinfo.y <= centerY + halfBoxLength + 1) {
                     var collapsed = recode.collapsed==undefined?true:recode.collapsed;
                     collapsed = !collapsed
                     recode.collapsed=collapsed;

+ 9 - 2
web/building_saas/main/js/views/project_property_projFeature.js

@@ -379,9 +379,16 @@ let projFeatureView = {
         }
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
             var recode = data[hitinfo.row];
+            let offset = -1,
+                indent = 20,
+                halfBoxLength = 5;
+            let centerX = hitinfo.cellRect.x + offset + indent / 2;
+            let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2
             if(recode&&recode.hasOwnProperty('items')){
-                var hoffset= hitinfo.cellRect.x+3;
-                if (hitinfo.x > hoffset && hitinfo.x < hoffset + 10){
+                //方框外1像素内都有效
+                const boxLengh = 10;
+                if (hitinfo.x >= centerX - halfBoxLength - 1 && hitinfo.x <= centerX + halfBoxLength + 1 &&
+                    hitinfo.y >= centerY - halfBoxLength - 1 && hitinfo.y <= centerY + halfBoxLength + 1) {
                     var collapsed = recode.collapsed==undefined?true:recode.collapsed;
                     collapsed = !collapsed
                     recode.collapsed=collapsed;

+ 4 - 1
web/building_saas/main/js/views/project_view.js

@@ -1371,6 +1371,7 @@ var projectObj = {
                         }
                         // var selected = project.mainTree.selected;
                         // return project.Ration.addRationChecking(selected);  // Vincent, 2018-01-02
+                        debugger;
                         return !project.Ration.canAdd(project.mainTree.selected);
                     },
                     callback: function (key, opt) {
@@ -1386,7 +1387,9 @@ var projectObj = {
                         getGLJData('insert');// ProjectController.addRation(project, controller, rationType.volumePrice);
                     },
                     visible: function(key, opt){//2018-11-08  新需求,这个按钮先隐藏,有需要再放开
-                        return false;
+                        let selected = project.mainTree.selected;
+                        return selected && selected.sourceType == ModuleNames.bills &&
+                            !_.isEmpty(selected.data.flagsIndex) && selected.data.flagsIndex.fixed.flag === fixedFlag.EQUIPMENT_ACQUISITION_FEE
                     }
                 },
                 "spr2": '--------',

+ 2 - 1
web/building_saas/pm/js/pm_gc.js

@@ -331,7 +331,8 @@ const gcTreeObj = {
             let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;;
             if (!node || node.children.length === 0) { return; }
 
-            if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
+            if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
+                hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);
                 TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
                     let iCount = node.posterityCount(), i, child;

+ 3 - 1
web/building_saas/pm/js/pm_newMain.js

@@ -949,7 +949,9 @@ const projTreeObj = {
                 }
                 if (!node || node.children.length === 0) { return; }
             }
-            if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
+            //统一改成方框外1像素内都有效
+            if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
+                hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);
                 TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
                     let iCount = node.posterityCount(), i, child;

+ 2 - 1
web/building_saas/pm/js/pm_share.js

@@ -372,7 +372,8 @@ const pmShare = (function () {
                 });
             }
             if (!node || node.children.length === 0) { return; }
-            if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
+            if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
+                hitinfo.y >= centerY - halfBoxLength - 2 && hitinfo.y <= centerY + halfBoxLength + 2) {
                 node.setExpanded(!node.expanded);
                 TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
                     let iCount = node.posterityCount(), i, child;