index.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <!--#include file="/inc/header.html"-->
  2. <script type="text/javascript">
  3. window.renderHeader = function(e) {
  4. var template = "{{#childenList}}<li class=\"bif-nav-item\" style=\" width: auto\" data-fun=\"{{moduleType}}\" data-href=\"/pages/electronicFile/{{moduleType}}.html\">{{moduleName}}</li>{{/childenList}}";
  5. var views = Mustache.render(template, e);
  6. $("#bif-nav-ul").html(views);
  7. $(".tree-breadcrumb #nav-item-a").html($("#bif-nav-ul li:first-child").html());
  8. $("#bif-nav-ul li:first-child").addClass("active");
  9. };
  10. $(function() {
  11. var modules = JSON.parse(window.sessionStorage.getItem("modules"));
  12. if(window.treemap) {
  13. renderHeader(window.treemap[19]); //基本信息ID 1
  14. } else if(modules) {
  15. renderHeader(modules.treemap[19]);
  16. }
  17. })
  18. </script>
  19. <div class="con-wrap">
  20. <div class="tree-breadcrumb">
  21. <span><a class="nav-prov">首页</a></span>&gt;
  22. <span class="nav-prov">山东分公司</span>
  23. <span><a class="nav-city" href="javascript:;"></a></span>
  24. <span><a class="nav-grain" href="javascript:;"></a></span>
  25. <span class="nav-house"></span>
  26. </div>
  27. <div id="con-map" style="margin-top: 0px;position: relative;">
  28. <div class="bif-nav">
  29. <ul id="bif-nav-ul">
  30. </ul>
  31. </div>
  32. <div class="author-nav">
  33. <ul id="tree-tt">
  34. </ul>
  35. </div>
  36. <div class="author-nav-sidebar">隐藏菜单</div>
  37. <div class="bif-con">
  38. </div>
  39. </div>
  40. </div>
  41. <!--#include file="/inc/footer.html"-->
  42. <style>
  43. .bif-nav-item {
  44. width: 97px;
  45. text-align: center;
  46. }
  47. .author-nav-sidebar {
  48. box-sizing: border-box;
  49. padding-top: 227px;
  50. float: left;
  51. height: 554px;
  52. line-height: 25px;
  53. width: 25px;
  54. cursor: pointer;
  55. text-align: center;
  56. margin-top: 10px;
  57. color: #fff;
  58. background-color: #ccc;
  59. }
  60. </style>
  61. <script>
  62. /*获取到链接首页的url*/
  63. $(function() {
  64. $.ajax({
  65. type: "post",
  66. dataType: 'json',
  67. url: config.baseUrl + "/sys/jump",
  68. success: function(e) {
  69. $('.nav-prov').attr('href', '/' + e.defaultHome);
  70. },
  71. error: function(e) {
  72. console.log(e);
  73. }
  74. });
  75. });
  76. $(function() {
  77. base.getTree();
  78. base.listAllTypeRemote();
  79. $(document).on('click', '[data-fun]', function(e) {
  80. //获取当前激活状态的函数名称
  81. var activeFunc = $('.bif-nav .active').data('fun'),
  82. fun = $(this).data('fun'); //获取当前点击目标的函数名
  83. console.log(activeFunc)
  84. console.log(fun)
  85. //比较其是否为同一目标,防止重复点击
  86. if(activeFunc === fun) {
  87. return false;
  88. }
  89. $(this).addClass('active').siblings().removeClass('active');
  90. console.log(elefile[fun])
  91. if(typeof elefile[fun] == 'function') {
  92. elefile[fun]($(this), e);
  93. //删除多余的dom结构
  94. $('.panel,.window-shadow, .window-mask').remove();
  95. } else {
  96. console.info('not found function ' + fun);
  97. }
  98. });
  99. //隐藏
  100. $('.author-nav-sidebar').on('click', function(e) {
  101. e.preventDefault();
  102. var wid = $('.bif-con').css('width');
  103. // var li = $('.tabs-selected').index();
  104. if(wid !== '1172px') {
  105. $(this).text('显示菜单');
  106. $('.author-nav').hide();
  107. $('.bif-con').css('width', '1172px');
  108. // if( showCount == 0 ) {
  109. // showCount++;
  110. $.parser.parse('.bif-con');
  111. //再次加载当前页面
  112. $('[data-fun].active').removeClass('active').trigger('click');
  113. } else {
  114. $(this).text('隐藏菜单');
  115. $('.author-nav').show();
  116. $('.bif-con').css('width', '970px');
  117. // if( hideCount == 0 ) {
  118. // hideCount++;
  119. $.parser.parse('.bif-con');
  120. //再次加载当前页面
  121. $('[data-fun].active').removeClass('active').trigger('click');
  122. // }
  123. }
  124. })
  125. });
  126. </script>
  127. </body>
  128. </html>