project_info.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Created by Mai on 2017/6/21.
  3. */
  4. var projectInfoObj = {
  5. projectInfo: null,
  6. getFullPathHtml: function (proj) {
  7. let fullPath = [], i, pm = '<span class="text-truncate"><a href="/pm">项目管理</a></span>', angleRight = '<span class="text-truncate"><i class="fa fa-angle-right fa-fw"></i></span>';
  8. if (proj) {
  9. let pathArr = proj.fullPath;
  10. let engName = pathArr[pathArr.length -2] || '',
  11. projectName = pathArr[pathArr.length -3] || '',
  12. folderName = pathArr[pathArr.length -4] || '';
  13. let newHtml = ` <span data-toggle="tooltip" data-placement="bottom" data-original-title="${folderName}"><i class="fa fa-folder-open-o"></i>...</span>
  14. <span class="text-muted px-1">\</span>
  15. <span data-toggle="tooltip" data-placement="bottom" data-original-title="${projectName}"><i class="fa fa-cubes"></i>...</span>
  16. <span class="text-muted px-1">\</span>
  17. <span data-toggle="tooltip" data-placement="bottom" data-original-title="${engName}"><i class="fa fa-cube"></i>...</span>
  18. <span class="text-muted px-1">\</span>
  19. <span><i class="fa fa-sticky-note-o"></i></span>
  20. <span class="text-truncate" data-toggle="tooltip" data-placement="bottom" data-original-title="${proj.name}">&nbsp;${proj.name}</span>`;
  21. fullPath.push(newHtml);
  22. }
  23. return fullPath.join('');
  24. },
  25. showProjectInfo: function (proj) {
  26. var that = this;
  27. CommonAjax.post('/pm/api/getProject', {"user_id": userID, "proj_id": scUrlUtil.GetQueryString('project')}, function (data) {
  28. if (data) {
  29. that.projectInfo = data;
  30. if(!data.engineeringInfo.billsGuidance_lib || data.engineeringInfo.billsGuidance_lib.length === 0){
  31. $('#stdBillsGuidanceTab').addClass('disabled');
  32. }
  33. else {
  34. $('#stdBillsGuidanceTab').text(data.engineeringInfo.billsGuidance_lib[0].type === 1 ? '清单指引' : '清单精灵');
  35. }
  36. //init decimal
  37. setDecimal(decimalObj, data.property.decimal);
  38. billsQuanDecimal.datas = data.property.billsQuantityDecimal || [billsDecimalView.angleDecimal];
  39. basicInfoView.orgDatas = data.property.basicInformation ? basicInfoView.toViewDatas(data.property.basicInformation) : [];
  40. projFeatureView.orgDatas = data.property.projectFeature ? projFeatureView.toViewDatas(data.property.projectFeature) : [];
  41. $('#fullpath').html(that.getFullPathHtml(that.projectInfo));
  42. $("[data-toggle='tooltip']").tooltip();
  43. }
  44. });
  45. }
  46. };