report_system.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>{{report_name}}</title>
  6. <!-- 引入 echarts.js -->
  7. <script src="/jc_data/static/lib/echarts.min.js" type="text/javascript"></script>
  8. <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  9. <style>
  10. td, th {
  11. border-right: 1px solid gray;
  12. border-bottom: 1px solid gray;
  13. width: 100px;
  14. height: 30px;
  15. box-sizing: border-box;
  16. }
  17. th {
  18. background-color: lightblue;
  19. }
  20. table {
  21. border-collapse: separate;
  22. table-layout: fixed;
  23. width: 100%; /* 固定寬度 */
  24. }
  25. thead tr th {
  26. position: sticky;/* 锁定表头 */
  27. top: 0; /* 表头在最上面 */
  28. }
  29. th:first-child {
  30. z-index: 2;
  31. background-color: lightblue;
  32. }
  33. .table > tbody > tr > td {
  34. vertical-align: middle;
  35. }
  36. .row_and_column {
  37. z-index: 3;
  38. background-color: lightblue;
  39. }
  40. .clearfix {
  41. zoom: 1
  42. }
  43. /*zooom 属性:IE 浏览器的专用属性。这一句是专门针对老版本的IE浏览器所写的,为了兼容*/
  44. .clearfix:after { /* :after伪对象选择符---在这个对象被浏览器渲染后添加一定的内容*/
  45. content: "."; /*content属性:添加的内容即为这个属性的值。这个属性是专门与伪对象搭配使用的*/
  46. display: block; /*将添加进去的内容转换为块状元素*/
  47. visibility: hidden; /*visibility:可视化属性,控制元素是否可见,但无论是否隐藏都保留物理空间。{与display:none的比较}*/
  48. height: 0; /*将添加进去的内容高度设置为0,消除其占位*/
  49. clear: both; /*将添加进去的内容作为清除浮动的对象,实现外围容器中有内容存在,因此可以自动判定高度,解决塌陷*/
  50. }
  51. .label-link {
  52. color: blue;
  53. cursor: pointer;
  54. text-decoration: underline;
  55. margin-left: 5px;
  56. }
  57. .label-link-select {
  58. color: red;
  59. cursor: pointer;
  60. text-decoration: underline;
  61. margin-left: 5px;
  62. }
  63. .error {
  64. background-color: #f90;
  65. display: block;
  66. width: 300px;
  67. min-height: 200px;
  68. z-index: 999;
  69. position: absolute;
  70. top: 50%;
  71. left: 50%;
  72. margin: -150px 0 0 -150px;
  73. padding: 20px;
  74. word-wrap: break-word;
  75. }
  76. .error_title {
  77. margin-top: -200px;
  78. background-color: lightcoral;
  79. }
  80. .table-hover > tbody > tr:hover {
  81. background-color: #a9a468;
  82. }
  83. </style>
  84. </head>
  85. <body>
  86. {% import 'all_report.html' as _report %}
  87. {% import 'error.html' as _error %}
  88. {% if error %}
  89. {% set is_error = true %}
  90. <div style="font-size: 40px;text-align: center;margin-top: 40px;">{{error}}</div>
  91. {% else %}
  92. {% set is_error = false %}
  93. {% endif %}
  94. <div {% if is_error %} style="display: none;"{% endif %}>
  95. <div class="clearfix">
  96. <div style="float: left;margin-left: 20px;">
  97. <div>
  98. {% for item in data_label.labels %}
  99. {% if item.id==data_label.ids1 %}
  100. <text class="label-link-select" onclick="click_label(1,{{item.id}})">{{item.name}}</text>
  101. {% else %}
  102. <text class="label-link" onclick="click_label(1,{{item.id}})">{{item.name}}</text>
  103. {% endif %}
  104. {% endfor %}
  105. </div>
  106. <div>
  107. {% if data_label.show2 %}
  108. {% for item in data_label.labels2 %}
  109. {% if item.id==data_label.ids2 %}
  110. <text class="label-link-select" onclick="click_label(2,{{item.id}})">{{item.name}}</text>
  111. {% else %}
  112. <text class="label-link" onclick="click_label(2,{{item.id}})">{{item.name}}</text>
  113. {% endif %}
  114. {% endfor %}
  115. {% endif %}
  116. </div>
  117. <div>
  118. {% if data_label.show3 %}
  119. {% for item in data_label.labels3 %}
  120. {% if item.id==data_label.ids3 %}
  121. <text class="label-link-select" onclick="click_label(3,{{item.id}})">{{item.name}}</text>
  122. {% else %}
  123. <text class="label-link" onclick="click_label(3,{{item.id}})">{{item.name}}</text>
  124. {% endif %}
  125. {% endfor %}
  126. {% endif %}
  127. </div>
  128. </div>
  129. <!-- <div style="float: right;width: 100px;">查询</div>-->
  130. <div style="float: right;width:350px;">
  131. <div style="float: left;">日期:</div>
  132. <div style="float: right;">
  133. <input type="date" id="date-start" value="{{data_label.date_start}}"/>~<input type="date" id="date-end"
  134. value="{{data_label.date_end}}"/>
  135. </div>
  136. </div>
  137. </div>
  138. {% if data_label.has_error %}
  139. {{_error.show(data_label.error_title,data_label.error)}}
  140. {% else %}
  141. <div>
  142. {% if data_label.show_data %}
  143. {{_report.get_report(all_reports)}}
  144. {% endif %}
  145. </div>
  146. {% endif %}
  147. </div>
  148. <script type="text/javascript">
  149. function click_label(level, data_id) {
  150. let start = document.getElementById('date-start').value;
  151. let end = document.getElementById('date-end').value;
  152. let url = "";
  153. if (level === 1) {
  154. url = "/report/report_system/{{report_id}}/" + data_id + "?s=" + start + "&e=" + end;
  155. }
  156. if (level === 2) {
  157. url = "/report/report_system/{{report_id}}/{{data_label.ids1}}/" + data_id + "?s=" + start + "&e=" + end;
  158. }
  159. if (level === 3) {
  160. url = "/report/report_system/{{report_id}}/{{data_label.ids1}}/{{data_label.ids2}}/" + data_id + "?s=" + start + "&e=" + end;
  161. }
  162. window.location.href = url;
  163. }
  164. function openwin() {
  165. OpenWindow = window.open("", "newwin", "top='100px',left='200px',height='600px', width='1800px',toolbar=no ,scrollbars=no,menubar=no");
  166. //写成一行
  167. OpenWindow.document.write("<TITLE>例子</TITLE>")
  168. OpenWindow.document.write("<BODY BGCOLOR=#ffffff>")
  169. OpenWindow.document.write("<h1>Hello!</h1>")
  170. OpenWindow.document.write("New window opened!")
  171. OpenWindow.document.write("</BODY>")
  172. OpenWindow.document.write("</HTML>")
  173. OpenWindow.document.close()
  174. }
  175. function get_cookie(Name) {
  176. var search = Name + "="
  177. var returnvalue = "";
  178. if (document.cookie.length > 0) {
  179. offset = document.cookie.indexOf(search)
  180. if (offset != -1) {
  181. offset += search.length
  182. end = document.cookie.indexOf(";", offset);
  183. if (end == -1)
  184. end = document.cookie.length;
  185. returnvalue = unescape(document.cookie.substring(offset, end))
  186. }
  187. }
  188. return returnvalue;
  189. }
  190. function loadpopup() {
  191. if (get_cookie('popped') == '') {
  192. openwin()
  193. document.cookie = "popped=yes"
  194. }
  195. }
  196. // {% if data_label.has_error %}
  197. // openwin()
  198. // {%endif%}
  199. </script>
  200. </body>
  201. </html>