763fdc605d4006df708c850a01a073f251ad4195.svn-base 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>设备损失统计表</title>
  5. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <script type="text/javascript" src="/nwyj/page/cockpit/context.js"></script>
  8. <!--框架必需start-->
  9. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  10. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
  11. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/main.js"></script>
  12. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
  13. <link href="/nwyj/scripts/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  14. <link rel="stylesheet" type="text/css" id="skin" prePath="/nwyj/scripts/qui/" scrollerY="false"/>
  15. <link rel="stylesheet" type="text/css" id="customSkin"/>
  16. <!--框架必需end-->
  17. <!--grid组件start-->
  18. <script src="/nwyj/scripts/qui/libs/js/table/quiGrid.js" type="text/javascript"></script>
  19. <!--grid组件end-->
  20. <script type="text/javascript" src="/nwyj/page/cockpit/webgis/util.js"></script>
  21. <link rel="stylesheet" type="text/css" href="/nwyj/page/cockpit/webgis/js/gisgrid.css">
  22. </head>
  23. <body>
  24. <div id="head" class="_head"><h2 class="_center"></h2></div>
  25. <div id="gridContent"></div>
  26. <script type="text/javascript">
  27. var grid=null;
  28. var params=eval("("+resolveUrl().params+")");
  29. console.log("aaa=="+JSON.stringify(params));
  30. function getColumns(param){
  31. var columns=[];
  32. for(var index in param){
  33. var column= { display:param[index].name ,columns: [
  34. { display: '已恢复',name:"PLON_DAOTA_"+param[index].column, align: 'center', width: 50/param.length+"%"} ,
  35. { display: '未恢复', name:"UNRECOVER_"+param[index].column, align: 'center', width: 50/param.length+"%"}]
  36. }
  37. /* var column= { display:param[index].name , name:"PLON_DAOTA_"+param[index].column, align: 'center', width: 50/param.length+"%"}
  38. columns.push(column);
  39. column= { display:param[index].name , name:"UNRECOVER_"+param[index].column, align: 'center', width: 50/param.length+"%"} */
  40. columns.push(column);
  41. }
  42. return columns
  43. }
  44. var options={
  45. columns:getColumns(params.level),
  46. data:[],
  47. pageSize:20,
  48. /* rownumbers:true, */
  49. checkbox:true,
  50. percentWidthMode:true,
  51. height: 'auto',
  52. width:"100%",
  53. rowAttrRender: function(rowdata, rowindex, rowid){
  54. return rowdata["__index"] % 2 == 0 ? "style='background-color:#212749;'" : "style='background-color:#2C3A54;'" ;
  55. }
  56. };
  57. function getData(grid){
  58. $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getChartInfo",{
  59. comId:params.comId,childId:params.childId,typeId:params.typeId,date:params.date
  60. },function(result){
  61. var data={"pager.pageNo":1,"pager.totalRows":1,rows:changeDataType(result)};
  62. grid.setOptions({ data :data });
  63. grid.loadData();
  64. },"json");
  65. }
  66. function changeDataType(param){
  67. var data=[];
  68. for(var index in param){
  69. var jsonItem={};
  70. for(var i in params.level){
  71. jsonItem["PLON_DAOTA_"+params.level[i].column]=parseInt(param[index]["PLON_DAOTA_"+params.level[i].column])+parseInt(param[index]["PLON_BIANXING_"+params.level[i].column])-parseInt(param[index]["UNRECOVER_"+params.level[i].column]);
  72. jsonItem["UNRECOVER_"+params.level[i].column]=parseInt(param[index]["UNRECOVER_"+params.level[i].column]);
  73. }
  74. data.push(jsonItem);
  75. }
  76. console.log("========"+JSON.stringify({data:data}));
  77. return data;
  78. }
  79. $(function(){
  80. $("#head").find("h2").text(params["deptName"]+"汇总明细");
  81. grid=$("#gridContent").quiGrid(options);
  82. /* alert(JSON.stringify({columns:getColumns(params.level)}));
  83. alert("===1");
  84. alert("=="+JSON.stringify({
  85. comId:params.comId,childId:params.childId,typeId:params.typeId,date:params.date
  86. })); */
  87. getData(grid);
  88. });
  89. </script>
  90. </body>
  91. </html>