123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>{{report_name}}</title>
- <!-- 引入 echarts.js -->
- <script src="/jc_data/static/lib/echarts.min.js" type="text/javascript"></script>
- <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
- <style>
- td, th {
- border-right: 1px solid gray;
- border-bottom: 1px solid gray;
- width: 100px;
- height: 30px;
- box-sizing: border-box;
- }
- th {
- background-color: lightblue;
- }
- table {
- border-collapse: separate;
- table-layout: fixed;
- width: 100%; /* 固定寬度 */
- }
- thead tr th {
- position: sticky;/* 锁定表头 */
- top: 0; /* 表头在最上面 */
- }
- th:first-child {
- z-index: 2;
- background-color: lightblue;
- }
- .table > tbody > tr > td {
- vertical-align: middle;
- }
- .row_and_column {
- z-index: 3;
- background-color: lightblue;
- }
- .clearfix {
- zoom: 1
- }
- /*zooom 属性:IE 浏览器的专用属性。这一句是专门针对老版本的IE浏览器所写的,为了兼容*/
- .clearfix:after { /* :after伪对象选择符---在这个对象被浏览器渲染后添加一定的内容*/
- content: "."; /*content属性:添加的内容即为这个属性的值。这个属性是专门与伪对象搭配使用的*/
- display: block; /*将添加进去的内容转换为块状元素*/
- visibility: hidden; /*visibility:可视化属性,控制元素是否可见,但无论是否隐藏都保留物理空间。{与display:none的比较}*/
- height: 0; /*将添加进去的内容高度设置为0,消除其占位*/
- clear: both; /*将添加进去的内容作为清除浮动的对象,实现外围容器中有内容存在,因此可以自动判定高度,解决塌陷*/
- }
- .label-link {
- color: blue;
- cursor: pointer;
- text-decoration: underline;
- margin-left: 5px;
- }
- .label-link-select {
- color: red;
- cursor: pointer;
- text-decoration: underline;
- margin-left: 5px;
- }
- .error {
- background-color: #f90;
- display: block;
- width: 300px;
- min-height: 200px;
- z-index: 999;
- position: absolute;
- top: 50%;
- left: 50%;
- margin: -150px 0 0 -150px;
- padding: 20px;
- word-wrap: break-word;
- }
- .error_title {
- margin-top: -200px;
- background-color: lightcoral;
- }
- .table-hover > tbody > tr:hover {
- background-color: #a9a468;
- }
- </style>
- </head>
- <body>
- {% import 'all_report.html' as _report %}
- {% import 'error.html' as _error %}
- {% if error %}
- {% set is_error = true %}
- <div style="font-size: 40px;text-align: center;margin-top: 40px;">{{error}}</div>
- {% else %}
- {% set is_error = false %}
- {% endif %}
- <div {% if is_error %} style="display: none;"{% endif %}>
- <div class="clearfix">
- <div style="float: left;margin-left: 20px;">
- <div>
- {% for item in data_label.labels %}
- {% if item.id==data_label.ids1 %}
- <text class="label-link-select" onclick="click_label(1,{{item.id}})">{{item.name}}</text>
- {% else %}
- <text class="label-link" onclick="click_label(1,{{item.id}})">{{item.name}}</text>
- {% endif %}
- {% endfor %}
- </div>
- <div>
- {% if data_label.show2 %}
- {% for item in data_label.labels2 %}
- {% if item.id==data_label.ids2 %}
- <text class="label-link-select" onclick="click_label(2,{{item.id}})">{{item.name}}</text>
- {% else %}
- <text class="label-link" onclick="click_label(2,{{item.id}})">{{item.name}}</text>
- {% endif %}
- {% endfor %}
- {% endif %}
- </div>
- <div>
- {% if data_label.show3 %}
- {% for item in data_label.labels3 %}
- {% if item.id==data_label.ids3 %}
- <text class="label-link-select" onclick="click_label(3,{{item.id}})">{{item.name}}</text>
- {% else %}
- <text class="label-link" onclick="click_label(3,{{item.id}})">{{item.name}}</text>
- {% endif %}
- {% endfor %}
- {% endif %}
- </div>
- </div>
- <!-- <div style="float: right;width: 100px;">查询</div>-->
- <div style="float: right;width:350px;">
- <div style="float: left;">日期:</div>
- <div style="float: right;">
- <input type="date" id="date-start" value="{{data_label.date_start}}"/>~<input type="date" id="date-end"
- value="{{data_label.date_end}}"/>
- </div>
- </div>
- </div>
- {% if data_label.has_error %}
- {{_error.show(data_label.error_title,data_label.error)}}
- {% else %}
- <div>
- {% if data_label.show_data %}
- {{_report.get_report(all_reports)}}
- {% endif %}
- </div>
- {% endif %}
- </div>
- <script type="text/javascript">
- function click_label(level, data_id) {
- let start = document.getElementById('date-start').value;
- let end = document.getElementById('date-end').value;
- let url = "";
- if (level === 1) {
- url = "/report/report_system/{{report_id}}/" + data_id + "?s=" + start + "&e=" + end;
- }
- if (level === 2) {
- url = "/report/report_system/{{report_id}}/{{data_label.ids1}}/" + data_id + "?s=" + start + "&e=" + end;
- }
- if (level === 3) {
- url = "/report/report_system/{{report_id}}/{{data_label.ids1}}/{{data_label.ids2}}/" + data_id + "?s=" + start + "&e=" + end;
- }
- window.location.href = url;
- }
- function openwin() {
- OpenWindow = window.open("", "newwin", "top='100px',left='200px',height='600px', width='1800px',toolbar=no ,scrollbars=no,menubar=no");
- //写成一行
- OpenWindow.document.write("<TITLE>例子</TITLE>")
- OpenWindow.document.write("<BODY BGCOLOR=#ffffff>")
- OpenWindow.document.write("<h1>Hello!</h1>")
- OpenWindow.document.write("New window opened!")
- OpenWindow.document.write("</BODY>")
- OpenWindow.document.write("</HTML>")
- OpenWindow.document.close()
- }
- function get_cookie(Name) {
- var search = Name + "="
- var returnvalue = "";
- if (document.cookie.length > 0) {
- offset = document.cookie.indexOf(search)
- if (offset != -1) {
- offset += search.length
- end = document.cookie.indexOf(";", offset);
- if (end == -1)
- end = document.cookie.length;
- returnvalue = unescape(document.cookie.substring(offset, end))
- }
- }
- return returnvalue;
- }
- function loadpopup() {
- if (get_cookie('popped') == '') {
- openwin()
- document.cookie = "popped=yes"
- }
- }
- // {% if data_label.has_error %}
- // openwin()
- // {%endif%}
- </script>
- </body>
- </html>
|