index.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!--#include file="/inc/header.html"-->
  2. <script type="text/javascript">
  3. window.renderHeader=function(e)
  4. {
  5. var template="{{#childenList}}<li class=\"bif-nav-item\" data-fun=\"{{moduleUrl}}\" data-href=\"/pages/statistic/{{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").eq(1).html());
  9. $("#bif-nav-ul li").eq(1).addClass("active");
  10. };
  11. $(function(){
  12. var modules=JSON.parse(window.sessionStorage.getItem("modules"));
  13. if(window.treemap){
  14. renderHeader(window.treemap[4]);//基本信息ID 6
  15. }else if(modules){
  16. renderHeader(modules.treemap[4]);
  17. }
  18. })
  19. </script>
  20. <div class="con-wrap">
  21. <div class="tree-breadcrumb">
  22. <span class="nav-prov">首页</span>&gt;
  23. <span class="nav-prov">山东省</span>&gt;
  24. <span class="nav-city" id="nav-item-a"></span>
  25. </div>
  26. <div id="con-map" style="margin-top:0px;">
  27. <div class="bif-nav">
  28. <ul id="bif-nav-ul">
  29. </ul>
  30. </div>
  31. <div class="bif-container" >
  32. <div class="bif-con panel-noscroll" style="width:1200px">
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <!--#include file="/inc/footer.html"-->
  38. <style>
  39. .bif-nav-item{
  40. width: 97px;
  41. text-align: center;
  42. }
  43. .bif-con{
  44. margin-left:0px;
  45. }
  46. </style>
  47. <script>
  48. $(function() {
  49. base.listAllTypeRemote();
  50. // base.getTree();
  51. $(document).on('click','[data-fun]',function(e) {
  52. //获取当前激活状态的函数名称
  53. var activeFunc = $('.bif-nav .active').data('fun'),
  54. //获取当前点击目标的函数名
  55. fun = $(this).data('fun');
  56. //比较其是否为同一目标,防止重复点击
  57. if (activeFunc === fun) {
  58. return false;
  59. }
  60. $(this).addClass('active').siblings().removeClass('active');
  61. $(".tree-breadcrumb #nav-item-a").html($(this).text());
  62. if(typeof statfuns[fun] == 'function') {
  63. statfuns[fun]($(this),e);
  64. //删除多余的dom结构
  65. $('.panel,.window-shadow, .window-mask').remove();
  66. } else {
  67. console.info('not found function '+fun);
  68. }
  69. });
  70. // 默认第一项展示
  71. //init
  72. var first=$("#bif-nav-ul li").eq(1);
  73. var func=first.data("fun");
  74. if(typeof statfuns[func] == 'function') {
  75. statfuns[func](first);
  76. }
  77. // var href=first.data("href");
  78. // var func=first.data("fun");
  79. // $('.bif-con').load(href,function(e) {
  80. // $.parser.parse('.bif-con');
  81. // statfuns[fun]
  82. // window.statInfo.init();
  83. });
  84. var getGrainData = {};
  85. $.ajax({
  86. type: "get",
  87. dataType: 'json',
  88. async: false,
  89. url: config.baseUrl + config.organization.getAllGrainList,
  90. success: function(e) {
  91. getGrainData = e.data.data;
  92. // if( getGrainData.length == 1 ) return;
  93. // getGrainData.unshift({
  94. // id: "全部",
  95. // name: "全部",
  96. // type: "0"
  97. // })
  98. },
  99. error: function(e) {
  100. console.log(e);
  101. }
  102. });
  103. </script>
  104. <script src="/src/lib/highcharts.js"></script>
  105. </body>
  106. </html>