瀏覽代碼

Merge branch '1.0.0_online' of http://192.168.1.12:3000/SmartCost/ConstructionCost into 1.0.0_online

TonyKang 7 年之前
父節點
當前提交
a666e5203f

+ 1 - 0
modules/ration_glj/facade/ration_glj_facade.js

@@ -628,6 +628,7 @@ async function replaceGLJ(data) {
     let result = await projectGljModel.addList(getGLJSearchInfo(data));
     let typeString = result.type+'';
     data.projectGLJID = result.id;
+
     let updateResult = await ration_glj.findOneAndUpdate({ID: data.ID, projectID: data.projectID}, data);//更新定额工料机
     //组装回传数据
     data.marketPrice = result.unit_price.market_price;

+ 14 - 14
web/building_saas/main/html/main.html

@@ -65,7 +65,7 @@
                     <a href="javascript:void(0)" class="btn btn-sm" title="粘贴"><i class="fa fa-clipboard" aria-hidden="true"></i></a>-->
                     <a class="btn btn-sm" href="javascript:void(0);" aria-expanded="false" data-toggle="modal" data-target="#poj-set" title="项目属性"><i class="fa fa-cog" data-placement="bottom"></i></a>
                     <span class="btn btn-sm">
-                        <a class="dropdown-toggle" href="#" data-toggle="dropdown" title="导入"><i class="fa  fa-cloud-upload" data-placement="bottom"></i></a>
+                        <a class="dropdown-toggle" id="uploadDropDown" href="#" data-toggle="dropdown" title="导入"><i class="fa  fa-cloud-upload" data-placement="bottom"></i></a>
                         <div class="dropdown-menu">
                             <a id="uploadLj" class="dropdown-item" href="#import" data-toggle="modal" data-target="#import">导入09表Excel清单</a>
                             <a id="uploadGld" class="dropdown-item" href="#import" data-toggle="modal" data-target="#import">导入广联达算量Excel清单</a>
@@ -78,7 +78,7 @@
                       <a href="javascript:void(0)" class="btn btn-sm" id="upMove" title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
                       <a href="javascript:void(0)" class="btn btn-sm" id="downMove" title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
                     <span class="btn btn-sm">
-                      <a href="" data-toggle="dropdown"><span  data-placement="bottom" title="显示至..."><i class="fa fa-list-ol"></i></span></a>
+                      <a href="" data-toggle="dropdown" title="显示至..."><span  data-placement="bottom"><i class="fa fa-list-ol"></i></span></a>
                       <div class="dropdown-menu dropdown-menu-left" style="min-width: 6.5rem">
                       <a class="dropdown-item" href="javascript:void(0);" id="displayDXFY">大项费用</a>
                       <a class="dropdown-item" href="javascript:void(0);"  id="displayFB1">一级分部</a>
@@ -190,6 +190,15 @@
                                           <div class="col-4" style="width: 33%; float: left; margin: 0; padding:0;">
                                               <div class="main-data-bottom" id="add-rule" style="display: none;">
                                                   <div class="container-fluid my-2">
+                                                      <p style="text-align: center">
+                                                          <% if (projectData.property.lockBills == true) { %>
+                                                          <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
+                                                          <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
+                                                          <% } else { %>
+                                                          <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
+                                                          <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
+                                                          <% } %>
+                                                      </p>
                                                       <div class="mb-1 row">
                                                           <label class="col-5 px-0 col-form-label text-right">添加位置:</label>
                                                           <div class="col-7">
@@ -253,15 +262,6 @@
                                                               </select>
                                                           </div>
                                                       </div>
-                                                      <p style="text-align: center">
-                                                          <% if (projectData.property.lockBills == true) { %>
-                                                          <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
-                                                          <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-all">应用到所有清单</button>
-                                                          <% } else { %>
-                                                          <button class="btn btn-primary btn-sm" type="button" id="use-to-current">应用到选中清单</button>
-                                                          <button class="btn btn-primary btn-sm" type="button" id="use-to-all">应用到所有清单</button>
-                                                          <% } %>
-                                                      </p>
                                                   </div>
                                               </div>
                                           </div>
@@ -843,8 +843,8 @@
                     </button>
                     <input type="hidden" id="actionType">
                 </div>
-                <div class="modal-body">
-                        <div style="width: 33%; float: left;">
+                <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
+                        <div style="width: 20%; float: left;">
                             <div  class="modal-auto-height" id="componentTreeDiv" style=" height: 415px; overflow: hidden;">
                                 <!--<div class="print-list">-->
                                 <div style="width: 100%; height: 100%; overflow: auto">
@@ -853,7 +853,7 @@
                                 <!--</div>-->
                             </div>
                         </div>
-                        <div style="width:67%; padding-left: 8px; float: left;">
+                        <div style="width:80%; padding-left: 3px; float: left;">
                             <div class="row">
                                 <div class="col-12" id="gljRadios">
                                     <div class="row">

+ 55 - 0
web/building_saas/main/js/models/ration_glj.js

@@ -641,6 +641,61 @@ var ration_glj = {
                 $.bootstrapLoading.end();
             });
         };
+
+        ration_glj.prototype.updateRationGLJByChangeCode = function (recode, updateField, newval) {
+            let me = this;
+            let priceMap = projectObj.project.projectGLJ.datas.unitPriceMap;
+            let priceObj = priceMap[newval];
+            if(priceObj){
+                if (recode.createType===undefined || recode.createType == 'normal') {// createTypel 默认是normal 只有是定额下带的工料机才需把类型改成替换,其它的保持不变
+                    recode.rcode = recode.code;
+                    recode.createType = 'replace';
+                }
+                recode.code = priceObj.code;
+                recode.name = priceObj.name;
+                recode.type = priceObj.type;
+                recode.unit = priceObj.unit;
+                recode.shortName = priceObj.short_name;
+                recode.specs = priceObj.specs;
+                recode.GLJID=priceObj.glj_id;
+                recode.original_code =  priceObj.original_code;
+                recode.basePrice = priceObj.base_price;
+                recode.marketPrice = priceObj.market_price;
+            }
+            $.bootstrapLoading.start();
+            CommonAjax.post("/rationGlj/replaceGLJ", recode, function (result) {
+                if (result) {
+                    //result.adjustState;
+                    var glj_list = me.datas;
+                    var data = result.data;
+                    var list_index = _.findIndex(glj_list, {'ID': data.ID});
+                    let rationNode = projectObj.project.mainTree.findNode(data.rationID);
+                    var nodes =  [rationNode];
+                    glj_list[list_index] = data;
+                    project.projectGLJ.loadData(function () {//加载完项目工料机再计算
+                        gljOprObj.refreshView();
+                        if (project.ration_glj.needShowToTree(data)) {//当替换的是主材或设备时,刷新对应的树节点
+                            var node = project.ration_glj.findGLJNodeByID(data.ID);
+                            if (node) {
+                                project.ration_glj.transferToNodeData(data);
+                                node.source = data;
+                                node.data = data;
+                            }
+                            node ? nodes.push(node) : "";
+                        }
+                        rationNode.data.adjustState = result.adjustState;
+                        projectObj.mainController.refreshTreeNode(nodes);
+                        project.calcProgram.calcAndSave(rationNode);
+                        $.bootstrapLoading.end();
+                    });
+                }
+            }, function () {
+                $.bootstrapLoading.end();
+            });
+
+
+        };
+
         ration_glj.prototype.replaceGLJ = function (selectCode, oldData, callback) {
             var allGLJ = gljOprObj.AllRecode;
             var glj = _.find(allGLJ, function (item) {

+ 3 - 3
web/building_saas/main/js/views/character_content_view.js

@@ -1061,9 +1061,9 @@ let pageCCOprObj = {
     refreshView: function(node, refreshData) {
         // 更新清单行特征列或内容列
         let updateCol = [
-            { name: 'itemCharacterText', col: 4 },
-            { name: 'jobContentText', col: 5 },
-            { name: 'name', col: 2 }
+            { name: 'itemCharacterText', col: colSettingObj.getColByField('itemCharacterText')},
+            { name: 'jobContentText', col: colSettingObj.getColByField('jobContentText')},
+            { name: 'name', col: colSettingObj.getColByField('name')}
         ];
         if (updateCol === '') {
             return;

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

@@ -18,7 +18,7 @@ let gljCol = {
             {headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
         ],
         view: {
-            lockColumns: [0, 5, 7, 9, 10, 11]
+            lockColumns: [ 5, 7, 9, 10, 11]
         },
         // 工料机类型是混凝土、砂浆、配合比、机械台班时,价格不可编辑。
         editedTyep:[GLJTypeConst.MAIN_MATERIAL,GLJTypeConst.EQUIPMENT]//主材设备

+ 92 - 33
web/building_saas/main/js/views/glj_view.js

@@ -82,12 +82,12 @@ var gljOprObj = {
         header: [
             {headerName: "选择", headerWidth: 40, dataCode: "select", hAlign: "center", vAlign: "center", cellType: "checkBox"},
             {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName: "名称", headerWidth: 120, dataCode: "name", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName: "规格型号", headerWidth: 80, dataCode: "specs", dataType: "String", hAlign: "center", vAlign: "center"},
+            {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName: "规格型号", headerWidth: 190, dataCode: "specs", dataType: "String", hAlign: "left", vAlign: "center"},
             {headerName: "单位", headerWidth: 40, dataCode: "unit", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName: "单价", headerWidth: 80, dataCode: "basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
-            {headerName: "类型", headerWidth: 80, dataCode: "gljType", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName: "是否新增", headerWidth: 80, dataCode: "isComplementary", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
+            {headerName: "单价", headerWidth: 55, dataCode: "basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
+            {headerName: "类型", headerWidth: 60, dataCode: "gljType", dataType: "String", hAlign: "center", vAlign: "center"},
+            {headerName: "新增", headerWidth: 40, dataCode: "isComplementary", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
         ],
         view: {
             lockColumns: [0, 1, 2, 3, 4, 5, 6]
@@ -114,6 +114,9 @@ var gljOprObj = {
         if(!projectReadOnly){
             gljContextMenu.loadGLJSpreadContextMenu();
         }
+        sheet.bind(GC.Spread.Sheets.Events.SelectionChanged,function (sender,args) {
+            args.sheet.repaint();
+        });
     },
     initDetailSheet: function (sheet) {
         var me = this;
@@ -504,36 +507,49 @@ var gljOprObj = {
         let selected = this.sheet.getSelections();
         this.combineWithProjectGlj(this.sheetData);
         this.sheet.setRowCount(0);
-        //console.log(+new Date())
-        //this.sheet.getRange(0,-1,this.sheet.getRowCount(),-1).visible(true); //这个方法导致加载缓慢
         this.sheetData = sortRationGLJ(this.sheetData);
         this.sumQuantity();//计算总消耗量
         this.addMixRatioToShow();//显示组成物信息
-        this.initRationTree(init);
+        this.initRationTree(init,this.getUnitPriceCodeMap());
         sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
         if(selected){//定位光标到之前的位置
             this.sheet.setSelection(selected[0].row,selected[0].col,selected[0].rowCount,selected[0].colCount);
         }
     },
-    initRationTree: function (init) {
-        this.sheet.getRange(-1, 0, -1, 1).cellType(this.getTreeNodeCellType(this.sheetData));
+    getUnitPriceCodeMap : function (sheetData) {//取单价文件中,编码前缀一样的映射表
+        let codeMap = {};
+        let priceMap = projectObj.project.projectGLJ.datas.unitPriceMap;
+        if(priceMap){
+            for(let connectKey in priceMap){
+                let code = priceMap[connectKey].code;
+                if(code){
+                   let preCode = code.split("-")[0];
+                   if(codeMap[preCode]) {
+                       codeMap[preCode].push({text:code,value:connectKey});
+                   }else {
+                       codeMap[preCode]=[{text:code,value:connectKey}];
+                   }
+                }
+            }
+        }
+        return codeMap;
+    },
+
+    initRationTree: function (init,codeMap) {
+        this.sheet.suspendPaint();
+        this.sheet.suspendEvent();
+        this.sheet.setRowCount(this.sheetData.length >30?this.sheetData.length:30);
         for (var i = 0; i < this.sheetData.length; i++) {
+            this.sheet.setCellType(i, 0,this.getTreeNodeCellType(this.sheetData,i,codeMap),GC.Spread.Sheets.SheetArea.viewport);
             if (this.sheetData[i].hasOwnProperty('subList')) {
-               /* var collapsed = false;
-                if (init) {
-                    this.sheetData[i].collapsed = true;
-                    collapsed = true;
-                } else {
-                    collapsed = this.sheetData[i].collapsed == undefined ? true : this.sheetData[i].collapsed;
-                }*/
                 var collapsed = this.sheetData[i].collapsed == undefined ? true : this.sheetData[i].collapsed;
                 if (collapsed == true) {
                     this.sheet.getRange(i + 1, -1, this.sheetData[i].subList.length, -1).visible(false);
                 }
-                //this.sheet.getRange(i+1, -1, this.sheetData[i].subList.length, -1).visible(!collapsed);// this.sheet.getRange(i+1, -1, this.sheetData[i].subList.length, -1).locked(true);
-                //这个方法导致加载缓慢
             }
         }
+        this.sheet.resumeEvent();
+        this.sheet.resumePaint();
     },
     filterGljByRation: function (ration, datas) {
         var gljList = [];
@@ -752,6 +768,12 @@ var gljOprObj = {
                     return;
                 }
             }
+            if(updateField == 'code'){
+                if (!gljUtil.isDef(args.editingText)||args.editingText==''||args.editingText.indexOf('|-|') === -1||this.isRationGLJExit(args.editingText)) {//说明是选中自已,或者是已存在的工料机
+                    me.sheet.getCell(args.row, args.col).value(recode[updateField]);
+                    return;
+                }
+            }
             newval = args.editingText == null ? "" : args.editingText;
         }
         if (newval === recode[updateField]) {//如果值完全相等,则不需要更新
@@ -759,10 +781,23 @@ var gljOprObj = {
         }
         if (updateField == 'marketPrice' || updateField == 'basePrice') {
             projectObj.project.projectGLJ.updatePriceFromRG(recode, updateField, newval);
+        }else if(updateField == 'code'){//替换单价文件中已经有的工料机
+            projectObj.project.ration_glj.updateRationGLJByChangeCode(recode, updateField, newval);
         } else {
             projectObj.project.ration_glj.updateRationGLJByEdit(recode, updateField, newval);
         }
     },
+    isRationGLJExit:function (connectKey) {
+        for(let rg of gljOprObj.sheetData){
+            if(rg.isMixRatio == true){
+                continue;
+            }
+            if(gljOprObj.getIndex(rg, gljKeyArray) == connectKey){//存在一样的工料机
+                return true;
+            }
+        }
+       return false;
+    },
     updateRationTypeGLJ: function (value, node, fieldName,editingText) {
         let newval;
         let updatePrice = false;
@@ -965,9 +1000,12 @@ var gljOprObj = {
         var project = projectObj.project;
         gljOprObj.GLJSelection = _.filter(gljOprObj.GLJSelection, function (n) {
             var rg = _.find(gljOprObj.sheetData, function (item) {
+                if(item.isMixRatio == true){
+                    return false;
+                }
                 var i_key = gljOprObj.getIndex(item, gljKeyArray);
                 return n == i_key
-            })
+            });
             return rg ? false : true;
         })
         if (gljOprObj.GLJSelection.length > 0 && selected && selected.sourceType == ModuleNames.ration) {
@@ -1121,7 +1159,7 @@ var gljOprObj = {
         }
         return node;
     },
-    getTreeNodeCellType: function (data) {
+    getTreeNodeCellType: function (data,index,codeMap) {
         var ns = GC.Spread.Sheets;
         var rectW = 10;
         var rectH = 10;
@@ -1183,7 +1221,7 @@ var gljOprObj = {
             return offset;
         }
 
-        TreeNodeCellType.prototype = new ns.CellTypes.Text();
+        TreeNodeCellType.prototype =  data[index]&&data[index].isMixRatio?new ns.CellTypes.Text(): sheetCommonObj.getDynamicCombo();//new ns.CellTypes.Text();
         TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
             if (value != null) {
                 var offset = margin + rectW + 6;
@@ -1203,17 +1241,21 @@ var gljOprObj = {
                 GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
             }
         };
-        // override getHitInfo to allow cell type get mouse messages
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
-            return {
-                x: x,
-                y: y,
-                row: context.row,
-                col: context.col,
-                cellStyle: cellStyle,
-                cellRect: cellRect,
-                sheetArea: context.sheetArea
-            };
+            if(x < cellRect.x+cellRect.width -15){
+                return {
+                    x: x,
+                    y: y,
+                    row: context.row,
+                    col: context.col,
+                    cellStyle: cellStyle,
+                    cellRect: cellRect,
+                    sheetArea: context.sheetArea
+                };
+            }else {
+                return GC.Spread.Sheets.CellTypes.ComboBox.prototype.getHitInfo.apply(this, arguments);
+            }
+
         };
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
             var recode = data[hitinfo.row];
@@ -1227,10 +1269,26 @@ var gljOprObj = {
                     hitinfo.sheet.getRange(hitinfo.row + 1, -1, recode.subList.length, -1).visible(!collapsed);
                     hitinfo.sheet.invalidateLayout();
                     hitinfo.sheet.repaint();
+                    return;
                 }
             }
+            GC.Spread.Sheets.CellTypes.ComboBox.prototype.processMouseDown.apply(this, arguments);
+           // GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
         };
-        return new TreeNodeCellType()
+        let cellType = new TreeNodeCellType();
+        let options = [];
+        if(!(data[index]&&data[index].isMixRatio)){
+            let code = data[index].code;
+            if(code) {
+                let preCode = code.split("-")[0];
+                if( codeMap[preCode]) options = codeMap[preCode];
+                if(options.length>0) _.remove(options,{'value':gljOprObj.getIndex(data[index], gljKeyArray)})//去掉本身
+
+            }
+            cellType.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
+            cellType.itemHeight(options.length).items(options);
+        }
+        return cellType;
     },
     marketPriceReadOnly: function (node) {
         let hasCom = false;
@@ -1260,6 +1318,7 @@ $(function () {
             gljOprObj.gljLibSpresd = sheetCommonObj.buildSheet($('#gljLibSheet')[0], gljOprObj.gljLibSheetSetting, gljOprObj.stdGLJ.length + gljOprObj.complementaryGLJs.length);
             gljOprObj.gljLibSpresd.bind(GC.Spread.Sheets.Events.ButtonClicked, gljOprObj.onButtonClick);
             gljOprObj.gljLibSheet = gljOprObj.gljLibSpresd.getSheet(0);
+            gljOprObj.gljLibSheet.setColumnWidth(0, 20, GC.Spread.Sheets.SheetArea.rowHeader);
             gljOprObj.gljLibSheet.options.isProtected = true;
             gljOprObj.gljLibSheet.name('glj_lib');
         }

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

@@ -8,7 +8,7 @@ let basicInfoView = {
     setting:{
         header: [
             {name: '属性', dataCode: 'dispName', width: 200, vAlign: 'center', hAlign: 'left'},
-            {name: '值', dataCode: 'value', width: 120, vAlign: 'center', hAlign: 'left'}
+            {name: '值', dataCode: 'value', width: 120, vAlign: 'center', hAlign: 'center'}
         ],
         options: {
             allowContextMenu: false,

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

@@ -2543,6 +2543,7 @@ function disableTools(){
     $('#downMove').remove();
     $('#ZLFB_btn').remove();
     $('#switchTznr').remove();
+    $('#uploadDropDown').remove();
     $('a[name="lockBills"]').remove();
     //关于计算
     $('#poj-settings-4').find('input').prop('disabled', 'disabled');

+ 6 - 0
web/building_saas/main/js/views/sub_view.js

@@ -185,6 +185,9 @@ function updateBillsOprRation() {
 // 应用到选中清单
 let isSaving = false;
 $("#use-to-current").click(function() {
+    if($(this).hasClass('disabled')){
+        return false;
+    }
     if(projectReadOnly){
         return false;
     }
@@ -221,6 +224,9 @@ function addRuleUseToBills(setting, nodes) {
 }
 // 应用到所有的清单
 $("#use-to-all").click(function() {
+    if($(this).hasClass('disabled')){
+        return false;
+    }
     if(projectReadOnly){
         return false;
     }

+ 22 - 0
web/building_saas/pm/js/pm_gc.js

@@ -343,6 +343,28 @@ const gcTreeObj = {
                 hitinfo.sheet.repaint();
             }
         };
+        TreeNodeCellType.prototype.processMouseEnter = function (hitinfo) {
+            let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
+            let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
+            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                zoom = hitinfo.sheet.zoom();
+            let node = tree.items[hitinfo.row];
+            let nodeIndent = node ? (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3 : 0;
+            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+            let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
+            if(textLength > cellWidth - nodeIndent){
+                TREE_SHEET_HELPER.showTipsDiv(text,{pos: {}},hitinfo);
+            }
+        };
+        TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
+            TREE_SHEET_HELPER.tipDiv = 'hide';
+            if (TREE_SHEET_HELPER._toolTipElement) {
+                $(TREE_SHEET_HELPER._toolTipElement).hide();
+                TREE_SHEET_HELPER._toolTipElement = null;
+            };
+            TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
+        }
         return new TreeNodeCellType();
     },
     getBaseCell: function () {

+ 25 - 0
web/building_saas/pm/js/pm_newMain.js

@@ -5,6 +5,7 @@
  * @date 2017/8/22
  * @version
  */
+//todo: 全部、分享、回收站树统一
 let Tree = null;//
 let movetoZTree = null;
 let copytoZTree = null;
@@ -623,6 +624,7 @@ const projTreeObj = {
         }
     },
     getTreeNodeCell: function (tree) {
+        let me = projTreeObj;
         let indent = 20;
         let levelIndent = -5;
         let halfBoxLength = 5;
@@ -853,6 +855,29 @@ const projTreeObj = {
             }
             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);
+            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                zoom = hitinfo.sheet.zoom();
+            let node = me.tree.items[hitinfo.row];
+            let nodeIndent = node ? (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3 : 0;
+            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+            let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
+            if(textLength > cellWidth - nodeIndent){
+                TREE_SHEET_HELPER.showTipsDiv(text,{pos: {}},hitinfo);
+            }
+        };
+        TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
+            let me = this;
+            TREE_SHEET_HELPER.tipDiv = 'hide';
+            if (TREE_SHEET_HELPER._toolTipElement) {
+                $(TREE_SHEET_HELPER._toolTipElement).hide();
+                TREE_SHEET_HELPER._toolTipElement = null;
+            };
+            TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
+        }
         return new TreeNodeCellType();
     },
     setCellValue: function (cell, node,sheet) {

+ 22 - 0
web/building_saas/pm/js/pm_share.js

@@ -349,6 +349,28 @@ const pmShare = (function () {
             }
             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);
+            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
+            let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
+                zoom = hitinfo.sheet.zoom();
+            let node = tree.items[hitinfo.row];
+            let nodeIndent = node ? (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3 : 0;
+            let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
+            let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
+            if(textLength > cellWidth - nodeIndent){
+                TREE_SHEET_HELPER.showTipsDiv(text,{pos: {}},hitinfo);
+            }
+        };
+        TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
+            TREE_SHEET_HELPER.tipDiv = 'hide';
+            if (TREE_SHEET_HELPER._toolTipElement) {
+                $(TREE_SHEET_HELPER._toolTipElement).hide();
+                TREE_SHEET_HELPER._toolTipElement = null;
+            };
+            TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
+        }
         return new TreeNodeCellType();
     }
     //