project_info.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. ${projectReadOnly ? '' +
  22. '<span data-toggle="tooltip" data-placement="bottom" data-original-title="当前的工程状态为“只读”,如果要进行编辑,请在项目管理-分享界面,使用“拷贝工程”功能。">(只读)</span>'
  23. : ''}`;
  24. fullPath.push(newHtml);
  25. }
  26. return fullPath.join('');
  27. },
  28. showProjectInfo: function (proj) {
  29. var that = this;
  30. CommonAjax.post('/pm/api/getProject', {"user_id": userID, "proj_id": scUrlUtil.GetQueryString('project')}, function (data) {
  31. if (data) {
  32. that.projectInfo = data;
  33. if(!data.engineeringInfo.billsGuidance_lib || data.engineeringInfo.billsGuidance_lib.length === 0){
  34. $('#stdBillsGuidanceTab').addClass('disabled');
  35. }
  36. /* else {
  37. $('#stdBillsGuidanceTab').text(data.engineeringInfo.billsGuidance_lib[0].type === 1 ? '清单指引' : '清单精灵');
  38. }*/
  39. //init decimal
  40. setDecimal(decimalObj, data.property.decimal);
  41. billsQuanDecimal.datas = data.property.billsQuantityDecimal || [billsDecimalView.angleDecimal];
  42. basicInfoView.orgDatas = data.property.basicInformation ? basicInfoView.toViewDatas(data.property.basicInformation) : [];
  43. projFeatureView.orgDatas = data.property.projectFeature ? projFeatureView.toViewDatas(data.property.projectFeature) : [];
  44. $('#fullpath').html(that.getFullPathHtml(that.projectInfo));
  45. $("[data-toggle='tooltip']").tooltip();
  46. }
  47. });
  48. }
  49. };