/** * Created by Mai on 2017/6/21. */ var projectInfoObj = { getSubShareInfo: function (proj) { const { allowCopy, allowCooperate } = proj.shareState; let str = '('; if (allowCopy) { str += '可拷贝 '; } if (allowCooperate) { if (allowCopy) { str += ' '; } str += '可编辑'; } str += ')'; return str === '()' ? '' : str; }, getFullPathHtml: function (proj) { let fullPath = [], i, pm = '项目管理', angleRight = ''; if (proj) { let pathArr = proj.fullPath; let projectName = pathArr[pathArr.length -2] || '', folderName = pathArr[pathArr.length -3] || ''; const subShareInfo = projectInfoObj.getSubShareInfo(proj); const receiveTip = `来自 ${proj.owner && proj.owner.real_name || ''} 的分享${subShareInfo}`; let newHtml = ` ... \ ... \  ${proj.name} ${projectReadOnly || projectCooperate ? receiveTip : ` 分享`}`; fullPath.push(newHtml); } return fullPath.join(''); }, showProjectInfo: function (data) { if (data) { //如果是工程量清单项目,则显示导入功能 if (data.property.valuationType === 'ration') { $('#importSpan').show(); } if(!data.engineeringInfo.billsGuidance_lib || data.engineeringInfo.billsGuidance_lib.length === 0){ $('#stdBillsGuidanceTab').addClass('disabled'); } else { //打开预算项目时,右侧“清单规则”显示为“项目表”,打开工程量清单项目时,右侧“清单规则”显示为“清单范本”。 $('#stdBillsGuidanceTab').text(data.property.valuationType === 'bill' ? '项目表' : '清单范本'); } //init decimal setDecimal(decimalObj, data.property.decimal); billsQuanDecimal.datas = data.property.billsQuantityDecimal || [billsDecimalView.angleDecimal]; basicInfoView.orgDatas = data.property.basicInformation ? basicInfoView.toViewDatas(data.property.basicInformation) : []; projFeatureView.orgDatas = data.property.projectFeature ? projFeatureView.toViewDatas(data.property.projectFeature) : []; $('#fullpath').html(this.getFullPathHtml(data)); // 分享给 $('#init-share').click(() => SHARE_TO.initModal(projectObj.project.ID())); SHARE_TO.handleEventListener(); $("[data-toggle='tooltip']").tooltip(); if (data.property.valuationType == 'bill'){ $("#tab_tender_price").css('display', 'none'); } else{ $("#about-calc").css('display', 'none'); }; } } };