sub_view.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**
  2. * Created by CSL on 2017-07-04.
  3. */
  4. //modified by zhong on 2017-08-30
  5. // Tab panes 下有多个Spread时,相互之间不能正确显示。改成一个Spread下多个Sheet。
  6. var subSpread = sheetCommonObj.createSpread($("#subSpread")[0], 7);
  7. subSpread.getSheet(4).name('JSCX');
  8. //特征及内容spread,解决不能正确显示spread
  9. $("#jobSpread").width($("#subSpread").width() *0.5* 0.4);
  10. $("#itemSpread").width($("#subSpread").width() *0.5 - $("#jobSpread").width()-20);
  11. contentOprObj.buildSheet($("#jobSpread")[0]);
  12. characterOprObj.buildSheet($("#itemSpread")[0]);
  13. // 工料机
  14. gljOprObj.initSheet(subSpread.getSheet(0));
  15. //sheetCommonObj.shieldAllCells(subSpread.getSheet(0), gljOprObj.setting);
  16. SheetDataHelper.protectdSheet(subSpread.getSheet(0));
  17. // assistOprObj.initSheet(subSpread.getSheet(1));
  18. // sheetCommonObj.shieldAllCells(subSpread.getSheet(1), assistOprObj.setting);
  19. //附注条件
  20. gljOprObj.initCoeSheet(subSpread.getSheet(2));
  21. SheetDataHelper.protectdSheet(subSpread.getSheet(2));
  22. //辅助定额
  23. gljOprObj.initAssSheet(subSpread.getSheet(1));
  24. SheetDataHelper.protectdSheet(subSpread.getSheet(1));
  25. //工程量明细
  26. gljOprObj.initDetailSheet(subSpread.getSheet(3));
  27. SheetDataHelper.protectdSheet(subSpread.getSheet(3));
  28. $("#linkGLJ").click(function(){
  29. /* $('#subSpread').css("display", "");
  30. $("#tzjnrCon").css("display", "none");*/
  31. $("#tzjnrCon").hide();//控制显示subSpread,隐藏特征及内容spread
  32. $("#subSpread").show();
  33. subSpread.setActiveSheetIndex(0);
  34. $.contextMenu( 'destroy', "#subSpread" );
  35. gljContextMenu.loadGLJSpreadContextMenu();
  36. // for test
  37. //subSpread.getActiveSheet().setValue(0, 0, "工料机");
  38. });
  39. $("#linkFZDE").click(function(){
  40. $("#tzjnrCon").hide();
  41. $("#subSpread").show();
  42. subSpread.setActiveSheetIndex(1);
  43. $.contextMenu( 'destroy', "#subSpread" );
  44. // for test
  45. // subSpread.getActiveSheet().setValue(0, 0, "辅助定额");
  46. });
  47. $("#linkFZTJ").click(function(){
  48. $("#tzjnrCon").hide();
  49. $("#subSpread").show();
  50. subSpread.setActiveSheetIndex(2);
  51. $.contextMenu( 'destroy', "#subSpread" );
  52. // for test
  53. //subSpread.getActiveSheet().setValue(0, 0, "附注条件");
  54. });
  55. $("#linkGCLMX").click(function(){
  56. $("#tzjnrCon").hide();
  57. $("#subSpread").show();
  58. subSpread.setActiveSheetIndex(3);
  59. $.contextMenu( 'destroy', "#subSpread" );
  60. gljContextMenu.loadQuantityDetailMenu();
  61. // for test
  62. //subSpread.getActiveSheet().setValue(0, 0, "工程量明细");
  63. });
  64. $("#linkJSCX").click(function(){ // 计算程序
  65. $("#tzjnrCon").hide();
  66. $("#subSpread").show();
  67. subSpread.setActiveSheetIndex(4);
  68. calcProgramObj.initSheet(subSpread.getSheet(4));
  69. let sel = projectObj.mainController.tree.selected;
  70. if (sel.sourceType === projectObj.project.Bills.getSourceType() || sel.sourceType === projectObj.project.Ration.getSourceType()) {
  71. calcProgramObj.showData(sel);
  72. } else {
  73. calcProgramObj.clearData();
  74. };
  75. });
  76. $("#linkFXSM").click(function(){
  77. $("#tzjnrCon").hide();
  78. $("#subSpread").show();
  79. subSpread.setActiveSheetIndex(5);
  80. // for test
  81. subSpread.getActiveSheet().setValue(0, 0, "分项说明");
  82. });
  83. $("#linkDESM").click(function(){
  84. $("#tzjnrCon").hide();
  85. $("#subSpread").show();
  86. subSpread.setActiveSheetIndex(6);
  87. // for test
  88. subSpread.getActiveSheet().setValue(0, 0, "定额说明");
  89. });
  90. //特征及内容
  91. $("#linkTZJNR").click(function () {
  92. $("#subSpread").hide();
  93. $("#tzjnrCon").show();
  94. });
  95. function SubActiveSheetNameIs(sheetName){
  96. let rst = subSpread.getActiveSheet().name() == sheetName;
  97. return rst;
  98. }