You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
3.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>各区病患信息</title>
<link rel="stylesheet" href="/static/layui/css/layui.css">
<style>
a:link{
color: blue;
}
a:visited{
color: blue;
}
a:hover{
color: red;
}
</style>
</head>
<div class="layui-form">
<div align="center">
<img src="../static/wuhan.jpg" alt="照片"/>
<br>
<a href="/"><font size="4">返回主页</font></a>
</div>
<body>
<div align="center">
<br>
<table id = 'tabledemo'lay-filter="test">
<table width="1080px" border="2" cellspacing="0" cellpadding="0">
<thead>
<tr>
{# <th lay-data="{field:'date', width:300}"><font size="3">时间</font></th>#}
<th lay-data="{field:'total_confirmed', width:200}"><font size="3">区名</font></th>
<th lay-data="{field:'total_confirmed', width:200}"><font size="3">病情</font></th>
<th lay-data="{field:'new_confirmed', width:200}"><font size="3">人数</font></th>
{# <th lay-data="{field:'imported_cases', width:200}"><font size="3">确诊人数</font></th>#}
{# <th lay-data="{field:'new_recovered', width:200}"><font size="3">确诊比例</font></th>#}
<th lay-data="{field:'deaths', width:150}"><font size="3">详细信息</font></th>
<th lay-data="{field:'deaths', width:150}"><font size="3">医院信息</font></th>
</tr>
</thead>
<tbody>
{% for item in pat %}
<tr>
{# id=db.Column(db.Integer,primary_key=True,autoincrement=True)#}
{# date=db.Column(db.Date)#}
{# condition=db.Column(db.String(30))#}
{# district=db.Column(db.String(30))#}
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item[0]}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item[1]}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item[2]}}</font></td>
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item[3]}}</font></td>#}
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.confirmed}}</font></td>#}
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.rate}}%</font></td>#}
<td align="center" style="width:150px; height: 21px;" valign="middle"><font size="3"><a href="/patient_detail?district={{item[0]}}&condition={{item[1]}}">详细信息</a></font></td>
<td align="center" style="width:150px; height: 21px;" valign="middle"><font size="3"><a href="/hospital_detail?district={{item[0]}}">医院信息</a></font></td>
</tr>
{% endfor %}
</tbody>
</table>
<script>
layui.use('table', function () {
var table = layui.table;
//转换静态表格
table.init('test', {
height: 1000,
width: 800//设置高度
,limit:100
});
table.on('tool(test)', function(obj){ //注tool 是工具条事件名test 是 table 原始容器的属性 lay-filter="对应的值"
var data = obj.data //获得当前行数据
,layEvent = obj.event; //获得 lay-event 对应的值
if(layEvent === 'detail'){
layer.msg('查看操作');
} else if(layEvent === 'del'){
layer.confirm('真的删除行么', function(index){
location.href='/delete?id='+data.id;
});
} else if(layEvent === 'edit'){
location.href='/alter?id=' + data.id + "&provincename=" +data.provincename + "&cityname=" + data.cityname + "&usernumber=" + data.usernumber;
}
});
});
//监听行工具事件
</script>
</body>
</html>