123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>设备数据</title>
- <script type="text/javascript" src="__static__/js/jquery-1.10.2.min.js"></script>
- <script type="text/javascript" src="__static__/js/echarts.common.min.js"></script>
- <link rel="stylesheet" href="__static__/css/bootstrap.min.css">
- <script type="text/javascript" src="__static__/js/bootstrap.min.js"></script>
- </head>
- <body>
- <div class="container-fluid">
- <div class="row">
- <div class="col-md-4">
- <div style="margin-top: 80px; margin-left: 40px;">
- <h1>设备详情</h1>
- <p class="">设备编号: {$device.device_id}</p>
- <p class="">设备名称: {$device.name}</p>
- <p class="">所属单位: {$company.name}</p>
- <p class="">单位地址: {$company.address}</p>
- <p class="">单位邮箱: {$company.phone}</p>
- <p class="">经纬度: {$device.jing},{$device.wei}</p>
- <p class="">详细地址: {$device.address}</p>
- <p class="">压力上下限: {$device.up} - {$device.down} </p>
- <p class="">添加时间: {$device.addtime}</p>
- </div>
-
- </div>
- <div class="col-md-8">
- <div class="row">
-
- <div id="table" style="width: 100%;height:400px;"></div>
- </div>
- <div class="row">
- <h1>设备历史数据</h1>
- <table class="table table-hover">
- <thead>
- <th>设备压力值</th>
- <th>状态</th>
- <th>时间</th>
- </thead>
- <tbody>
- {volist name="device_history" id="vo"}
- <tr>
- <td>{$vo['pressure']} Mpa.g</td>
- <td>{if $vo['status']==1} 正常
- {elseif $vo['status']==2 }超压
- {elseif $vo['status']==3 }低压
- {else/} 离线
- {/if}
- </td>
- <td>{$vo['addtime']}</td>
- </tr>
- {/volist}
- </tbody>
-
- </table>
- <p>{$pages}</p>
- </div>
- </div>
- </div>
-
- </div>
- <script>
- var myChart = echarts.init(document.getElementById('table'));
- var data={$data};
- var datax=data.x;
- var datay=data.y;
- console.log(data);
- myChart.setOption({
- title: {
- text: '设备压力数据'
- },
- tooltip: {},
- legend: {
- data:['水压值']
- },
- xAxis: {
- data: datax
- },
- yAxis: {},
- series: [{
- name: '销量',
- type: 'line',
- data: datay
- }]
- });
- </script>
- </body>
- </html>
|