Bläddra i källkod

双击进入单位工程
清单精灵选项bug

zhongzewei 7 år sedan
förälder
incheckning
a2a284ebb1
2 ändrade filer med 30 tillägg och 21 borttagningar
  1. 2 4
      web/building_saas/main/js/views/billsElf.js
  2. 28 17
      web/building_saas/pm/js/pm_newMain.js

+ 2 - 4
web/building_saas/main/js/views/billsElf.js

@@ -578,11 +578,9 @@ const BillsElf = (function() {
                 $editor.css("width", cellRect.width);
                 $editor.attr("gcUIElement", "gcEditingInput");
                 //编辑文本框距离浏览器的top
-                let top = $('.header').height() + $('#zaojiashu').find('.toolsbar').height() + $('#top_div').height() + $('#bottom_div_ul').height() + 1 + $('.resize-y').height();
-                let activeCellTop = $editor.parent().parent().css('top');
-                activeCellTop = parseFloat(activeCellTop.replace('px', ''));
+                let top = $('.header').height() + $('#zaojiashu').find('.toolsbar').height() + $('#top_div').height() + $('#bottom_div_ul').height() + $('#qdjlTools').height() + $('.resize-y').height();
                 let node = bills.selected.elf.tree.items[elfSheet.getActiveRowIndex()];
-                setOptionsDiv($editor, node, cellRect, cellStyle, top + activeCellTop);
+                setOptionsDiv($editor, node, cellRect, cellStyle, top + cellRect.y);
                 this.isEscKey = false;
             }
         }

+ 28 - 17
web/building_saas/pm/js/pm_newMain.js

@@ -833,6 +833,17 @@ const projTreeObj = {
             }
         }
     },
+    openTender: function (node, timeoutTime) {
+        setTimeout(function () {
+            let newTab = window.open('about:blank');
+            BeforeOpenProject(node.data.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
+                let mainUrl = `/main?project=${node.data.ID}`;
+                CommonAjax.get(mainUrl, [], function () {
+                    newTab.location.replace(mainUrl); //不能后退
+                });
+            });
+        }, timeoutTime);
+    },
     getTreeNodeCell: function (tree) {
         let me = projTreeObj;
         let indent = 20;
@@ -1009,23 +1020,23 @@ const projTreeObj = {
                 return hitinfo.x > centerX + halfBoxLength && hitinfo.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength;
             }
             if(hitinfo.sheet.name() === "projectSheet"){//只有项目管理界面才执行
-                //单项文件,进入造价书界面
-                 if(node.data.projType === projectType.tender && withingClickArea()){
-                    let timeoutTime = 200;
-                    if($('.slide-sidebar').hasClass('open')){
-                        timeoutTime = 500;
+                if(node.data.projType === projectType.tender){
+                    let thisClick = Date.now(),
+                        open = false;
+                    if (this.preNode === node && this.preClick && thisClick - this.preClick <= 300) {
+                        open = true;
+                        let timeoutTime = 200;
+                        if($('.slide-sidebar').hasClass('open')){
+                            timeoutTime = 500;
+                        }
+                        projTreeObj.openTender(node, timeoutTime);
                     }
-                    setTimeout(function () {
-                        let newTab = window.open('about:blank');
-                        BeforeOpenProject(node.data.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
-                            let mainUrl = `/main?project=${node.data.ID}`;
-                            CommonAjax.get(mainUrl, [], function () {
-                                newTab.location.replace(mainUrl); //不能后退
-                            });
-                        });
-                    }, timeoutTime);
+                    this.preClick = open ? null : thisClick;
+                    this.preNode = open ? null : node;
+                }
+                if (!node || node.children.length === 0) {
+                    return;
                 }
-                if (!node || node.children.length === 0) { return; }
             }
             //统一改成方框外1像素内都有效
             if (hitinfo.x >= centerX - halfBoxLength - 2 && hitinfo.x <= centerX + halfBoxLength + 2 &&
@@ -1042,7 +1053,7 @@ const projTreeObj = {
                 hitinfo.sheet.repaint();
             }
         };
-        TreeNodeCellType.prototype.processMouseMove = function (hitInfo) {
+        /*TreeNodeCellType.prototype.processMouseMove = function (hitInfo) {
             let sheet = hitInfo.sheet;
 
             let div = sheet.getParent().getHost();
@@ -1056,7 +1067,7 @@ const projTreeObj = {
                 canvas.style.cursor='default';
             }
             return false;
-        };
+        };*/
         TreeNodeCellType.prototype.processMouseEnter = function (hitinfo) {
             let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
             let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);