electronicFile.html 4.9 KB

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