index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <div class="author-nav">
  2. <ul id="tree-tt">
  3. </ul>
  4. </div>
  5. <div class="author-nav-sidebar">隐藏菜单</div>
  6. <div class="bif-con">
  7. <div id="weaMonitorTabs" class="easyui-tabs" data-options="fit:true">
  8. <div title="熏蒸作业" style="padding-bottom:30px;" class="div-wrap-table">
  9. <!--#include file="/pages/intelligentControl/jobManage/fumigationJob.html"-->
  10. </div>
  11. <div title="通风作业" style="padding-bottom:30px;" class="div-wrap-table">
  12. <!--#include file="/pages/intelligentControl/jobManage/ventilationJob.html"-->
  13. </div>
  14. </div>
  15. </div>
  16. <style>
  17. .bif-nav-item {
  18. width: 97px;
  19. text-align: center;
  20. }
  21. .author-nav-sidebar {
  22. box-sizing: border-box;
  23. padding-top: 227px;
  24. float: left;
  25. height: 554px;
  26. line-height: 25px;
  27. width: 25px;
  28. cursor: pointer;
  29. text-align: center;
  30. /*writing-mode: vertical-rl;*/
  31. /*writing-mode:tb-rl;*/
  32. /* -webkit-transform:rotate(90deg);
  33. -moz-transform:rotate(90deg);
  34. -o-transform: rotate(90deg);*/
  35. /*white-space:nowrap;*/
  36. /*text-indent: 7px;*/
  37. margin-top: 10px;
  38. color: #fff;
  39. background-color: #ccc;
  40. }
  41. </style>
  42. <script>
  43. /*获取到链接首页的url*/
  44. $(function(){
  45. $.ajax({
  46. type: "post",
  47. dataType: 'json',
  48. url: config.baseUrl + "/sys/jump",
  49. success: function(e) {
  50. $('.nav-prov').attr('href','/'+e.defaultHome);
  51. },
  52. error: function(e) {
  53. console.log(e);
  54. }
  55. });
  56. });
  57. $(function() {
  58. base.getTree();
  59. base.listAllTypeRemote();
  60. $(document).on('click','[data-fun]',function( e ) {
  61. // console.log(e);
  62. //获取当前激活状态的函数名称
  63. var activeFunc = $('.bif-nav .active').data('fun'),
  64. //获取当前点击目标的函数名
  65. fun = $(this).data('fun');
  66. //比较其是否为同一目标,防止重复点击
  67. if (activeFunc === fun) {
  68. return false;
  69. }
  70. $(this).addClass('active').siblings().removeClass('active');
  71. if(typeof funs[fun] == 'function') {
  72. funs[fun]($(this),e);
  73. //删除多余的dom结构
  74. $('.panel,.window-shadow, .window-mask').remove();
  75. } else {
  76. console.info('not found function '+fun);
  77. }
  78. });
  79. // var showCount = 0,
  80. // hideCount = 0;
  81. //隐藏
  82. $('.author-nav-sidebar').on('click',function(e){
  83. e.preventDefault();
  84. var wid = $('.bif-con').css('width');
  85. // var li = $('.tabs-selected').index();
  86. if( wid !== '1172px' ) {
  87. $(this).text('显示菜单');
  88. $('.author-nav').hide();
  89. $('.bif-con').css('width','1172px');
  90. // if( showCount == 0 ) {
  91. // showCount++;
  92. $.parser.parse('.bif-con');
  93. //再次加载当前页面
  94. $('[data-fun].active').removeClass('active').trigger('click');
  95. } else {
  96. $(this).text('隐藏菜单');
  97. $('.author-nav').show();
  98. $('.bif-con').css('width','970px');
  99. // if( hideCount == 0 ) {
  100. // hideCount++;
  101. $.parser.parse('.bif-con');
  102. //再次加载当前页面
  103. $('[data-fun].active').removeClass('active').trigger('click');
  104. // }
  105. }
  106. })
  107. });
  108. </script>
  109. <script type="text/javascript" src="/src/intelligentControl/jobManage.js"></script>
  110. <script type="text/javascript">
  111. $(function() {
  112. intelligentControl.init();
  113. });
  114. </script>