first commit

master
Lebrabk 5 years ago
commit 4a8737234c

175
app.py

@ -0,0 +1,175 @@
from flask import Flask,render_template,request,redirect
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import func
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:265679@127.0.0.1:3306/pandemic'
db=SQLAlchemy(app)
class China(db.Model):
date=db.Column(db.Date,primary_key=True)
total_confirmed=db.Column(db.Integer,nullable=False)
new_confirmed=db.Column(db.Integer,nullable=False)
active_cases=db.Column(db.Integer,nullable=False)
imported_cases=db.Column(db.Integer,nullable=False)
# symptomless_cases=db.Column(db.Integer,nullable=False)
recovered=db.Column(db.Integer,nullable=False)
new_recovered=db.Column(db.Integer,nullable=False)
deaths=db.Column(db.Integer,nullable=False)
new_deaths=db.Column(db.Integer,nullable=False)
#创建世界的疫情数据表
class World(db.Model):
date=db.Column(db.String(255),primary_key=True)
country=db.Column(db.String(255),primary_key=True)
country_name=db.Column(db.String(255))
region=db.Column(db.String(255))
deaths=db.Column(db.Integer,nullable=False)
cumulative_deaths=db.Column(db.Integer,nullable=False)
confirmed=db.Column(db.Integer,nullable=False)
cumlative_confirmed=db.Column(db.Integer,nullable=False)
#创建中国省份的相关信息表
class provinces_info(db.Model):
province_name=db.Column(db.String(50),primary_key=True)
##创建市的信息表(省市的从属关系)
class cities_info(db.Model):
city_name=db.Column(db.String(50),primary_key=True)
province_name=db.Column(db.String(50),db.ForeignKey('provinces_info.province_name'))
#创建区的相关信息,包含区和市的从属关系
class districts_info(db.Model):
district_name=db.Column(db.String(50),primary_key=True)
city_name=db.Column(db.String(50),db.ForeignKey('cities_info.city_name'))
provinces_name=db.Column(db.String(50),db.ForeignKey('provinces_info.province_name'))
#创建武汉病区的相关信息
class community_info(db.Model):
id=db.Column(db.Integer,primary_key=True,autoincrement=True)
district_name=db.Column(db.String(50),db.ForeignKey('districts_info.district_name'))
address=db.Column(db.String(50))
#创建医院的相关信息
class hospitals_info(db.Model):
hospital_name=db.Column(db.String(50),primary_key=True)
district_name=db.Column(db.String(50),db.ForeignKey('districts_info.district_name'))
capacity=db.Column(db.Integer)
test=db.Column(db.Integer)
confirmed = db.Column(db.Integer)
rate=db.Column(db.Float)
class patients_info(db.Model):
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))
#创建省一级的疫情相关信息province_data
class province_data(db.Model):
date = db.Column(db.Date, primary_key=True)
# province_name = db.Column(db.String(50),db.ForeignKey('provinces_info.province_name'),primary_key=True)
province_name = db.Column(db.String(50), primary_key=True)
total_confirmed = db.Column(db.Integer, nullable=False)
new_confirmed=db.Column(db.Integer, nullable=False)
active_cases = db.Column(db.Integer, nullable=False)
imported_cases = db.Column(db.Integer, nullable=False)
# symptomless_cases = db.Column(db.Integer, nullable=False)
recovered = db.Column(db.Integer, nullable=False)
deaths = db.Column(db.Integer, nullable=False)
#创建市一级的疫情相关信息city_data
class city_data(db.Model):
date = db.Column(db.Date, primary_key=True)
# province_name = db.Column(db.String(50), db.ForeignKey('provinces_info.province_name'))
# city_name = db.Column(db.String(50), db.ForeignKey('cities_info.city_name'),primary_key=True)
province_name = db.Column(db.String(50),primary_key=True)
city_name = db.Column(db.String(50),primary_key=True)
total_confirmed = db.Column(db.Integer, nullable=False)
active_cases = db.Column(db.Integer, nullable=False)
recovered = db.Column(db.Integer, nullable=False)
deaths = db.Column(db.Integer, nullable=False)
class wuhan_data(db.Model):
date = db.Column(db.Date, primary_key=True)
district = db.Column(db.String(50),primary_key=True)
confirmed = db.Column(db.Integer, nullable=False)
# @app.route("/select")
# def selectAll():
# china = China.query.all()
# return render_template("china.html",china = china)
@app.route('/')
def cover():
return render_template('cover.html')
@app.route("/china/")
def china():
china = China.query.order_by(China.date.desc()).all()
return render_template("china.html",china = china)
@app.route("/province/")
def province():
date=request.args.get("date")
pro=province_data.query.filter_by(date=date).order_by(province_data.total_confirmed.desc()).all()
return render_template("province.html",pro = pro)
@app.route("/city/")
def city():
date = request.args.get("date")
pro_name=request.args.get("pro_name")
cit = city_data.query.filter_by(date=date,province_name=pro_name).order_by(city_data.total_confirmed.desc()).all()
return render_template("city.html",cit = cit)
@app.route("/world/")
def world():
world =db.session.query(World.date,
func.sum(World.cumlative_confirmed),
func.sum(World.confirmed),
func.sum(World.cumulative_deaths),
func.sum(World.deaths),).group_by('date').order_by(World.date.desc()).all()
return render_template("world.html",world=world)
@app.route("/region/")
def region():
date=request.args.get("date")
reg =db.session.query(World.date,
World.region,
func.sum(World.cumlative_confirmed),
func.sum(World.confirmed),
func.sum(World.cumulative_deaths),
func.sum(World.deaths)).filter_by(date=date).group_by('region').all()
return render_template("region.html",reg=reg)
@app.route("/country/")
def country():
date=request.args.get("date")
region=request.args.get("region")
coun =World.query.filter_by(date=date,region=region).order_by(World.cumlative_confirmed.desc()).all()
return render_template("country.html",coun=coun)
@app.route("/hospitals/")
def hospitals():
hosp=hospitals_info.query.order_by(hospitals_info.capacity).all()
return render_template("hospitals.html",hosp=hosp)
@app.route("/wuhan/")
def wuhan():
wu=wuhan_data.query.order_by(wuhan_data.date.desc()).all()
return render_template("wuhan.html",wuhan=wu)
@app.route("/patients/")
def patients():
pat=db.session.query(patients_info.district,
patients_info.condition,
func.count(patients_info.id)
).group_by('condition','district').order_by(patients_info.district.desc()).all()
return render_template("patients.html",pat=pat)
@app.route("/patient_detail/")
def patient_detail():
district=request.args.get('district')
condition=request.args.get('condition')
pa = db.session.query(patients_info.date,
patients_info.district,
patients_info.condition,
func.count(patients_info.id)
).filter_by(district=district,condition=condition)\
.group_by('date').order_by(patients_info.date.desc()).all()
return render_template("patient_detail.html",pat=pa)
@app.route("/hospital_detail/")
def hospital_detail():
district=request.args.get('district')
hosp = hospitals_info.query.filter_by(district_name=district).order_by(hospitals_info.district_name).all()
return render_template("hospital_detail.html", hosp=hosp)
if __name__ == '__main__':
app.run(debug=True)

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
a:link{
color: blue;
}
a:visited{
color: blue;
}
a:hover{
color: darkred;
}
</style>
<meta charset="UTF-8">
<title>国内疫情数据</title>
<link rel="stylesheet" href="/static/layui/css/layui.css">
</head>
<div class="layui-form">
<div align="center">
<img src="../static/cover.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:'new_confirmed', width:200}"><font size="3">新确诊人数</font></th>
<th lay-data="{field:'active_cases', width:200}"><font size="3">现有确诊</font></th>
<th lay-data="{field:'imported_cases', width:200}"><font size="3">境外输入</font></th>
<th lay-data="{field:'recovered', 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:200}"><font size="3">死亡人数</font></th>
<th lay-data="{field:'new_deaths', width:200}"><font size="3">新增死亡人数</font></th>
<th lay-data="{field:'new_deaths', width:200}"><font size="3">详细信息</font></th>
</tr>
</thead>
<tbody>
{% for item in china %}
<tr>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.date}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.total_confirmed}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.new_confirmed}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.active_cases}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.imported_cases}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.recovered}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.new_recovered}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.deaths}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.new_deaths}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3"><a href="/province?date={{ item.date}}">各省信息</a></font></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<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>

@ -0,0 +1,87 @@
<!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/cover.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:200}"><font size="3">死亡人数</font></th>
{# <th lay-data="{field:'deaths', width:200}"><font size="3">详细信息</font></th>#}
</tr>
</thead>
<tbody>
{% for item in cit %}
<tr>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.date}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.province_name}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.city_name}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.total_confirmed}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.active_cases}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.recovered}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.deaths}}</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>

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Global information</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/images.jpg" alt="照片"/>
<br>
<a href="/"><font size="4">return home page</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">date</font></th>
<th lay-data="{field:'total_confirmed', width:200}"><font size="3">region</font></th>
<th lay-data="{field:'total_confirmed', width:200}"><font size="3">country</font></th>
<th lay-data="{field:'new_confirmed', width:200}"><font size="3">cumlative_confirmed</font></th>
<th lay-data="{field:'active_cases', width:200}"><font size="3">new_confirmed</font></th>
<th lay-data="{field:'imported_cases', width:200}"><font size="3">cumulative_deaths</font></th>
<th lay-data="{field:'recovered', width:200}"><font size="3">new_deaths</font></th>
</tr>
</thead>
<tbody>
{% for item in coun %}
<tr>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.date}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.region}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.country_name}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.cumlative_confirmed}}</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.cumulative_deaths}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.deaths}}</font></td>
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3"><a href="/country?date={{item[0]}}&region={{item[1]}}">country's information</a></font></td>#}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<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>

@ -0,0 +1,35 @@
<!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 align="center">
<img src="../static/cover.jpg" width="640"height="230" alt="照片"/>
</div>
<body>
<div align="center">
<p><font size="5"> <a href="/china/">国内疫情</a></font></p>
<p><font size="5"> <a href="/world/">国外疫情</a></font></p>
<p><font size="5"> <a href="/wuhan/">武汉疫情</a></font></p>
<div align="center">
<img src="../static/wuhan.jpg" width="640"height="200"alt="照片"/>
</div>
<p><font size="4"> <a href="hospitals">武汉医院信息</a></font></p>
<p><font size="4"> <a href="patients">武汉病患信息</a></font></p>
</div>
</body>
</html>

@ -0,0 +1,85 @@
<!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">
<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:200}"><font size="3">详细信息</font></th>#}
</tr>
</thead>
<tbody>
{% for item in hosp %}
<tr>
<td align="center" style="width:360px; height: 21px;" valign="middle"><font size="3">{{item.hospital_name}}</font></td>
<td align="center" style="width:100px; height: 21px;" valign="middle"><font size="3">{{item.district_name}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.capacity}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.test}}</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>
</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>

@ -0,0 +1,86 @@
<!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:200}"><font size="3">详细信息</font></th>#}
</tr>
</thead>
<tbody>
{% for item in hosp %}
<tr>
<td align="center" style="width:360px; height: 21px;" valign="middle"><font size="3">{{item.hospital_name}}</font></td>
<td align="center" style="width:100px; height: 21px;" valign="middle"><font size="3">{{item.district_name}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.capacity}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.test}}</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>
</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>

@ -0,0 +1,89 @@
<!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>#}
</tr>
</thead>
<tbody>
{% for item in pat %}
<tr>
<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[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:180px; height: 21px;" valign="middle"><font size="3"><a href="/patient_detail?district={{item[0]}}&condition={{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>

@ -0,0 +1,94 @@
<!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>

@ -0,0 +1,91 @@
<!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/cover.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:'new_confirmed', width:200}"><font size="3">累计确诊</font></th>
<th lay-data="{field:'active_cases', width:200}"><font size="3">新增确诊</font></th>
<th lay-data="{field:'imported_cases', width:200}"><font size="3">现有确诊</font></th>
<th lay-data="{field:'recovered', 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:200}"><font size="3">死亡人数</font></th>
<th lay-data="{field:'deaths', width:200}"><font size="3">详细信息</font></th>
</tr>
</thead>
<tbody>
{% for item in pro %}
<tr>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.date}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.province_name}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.total_confirmed}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.new_confirmed}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.active_cases}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.imported_cases}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.recovered}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.deaths}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3"><a href="/city?date={{item.date}}&pro_name={{item.province_name}}">省内信息</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>

@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Global information</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/images.jpg" alt="照片"/>
<br>
<a href="/"><font size="4">return home page</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">date</font></th>
<th lay-data="{field:'total_confirmed', width:200}"><font size="3">region</font></th>
<th lay-data="{field:'new_confirmed', width:200}"><font size="3">cumlative_confirmed</font></th>
<th lay-data="{field:'active_cases', width:200}"><font size="3">confirmed</font></th>
<th lay-data="{field:'imported_cases', width:200}"><font size="3">cumulative_deaths</font></th>
<th lay-data="{field:'recovered', width:200}"><font size="3">deaths</font></th>
<th lay-data="{field:'new_deaths', width:200}"><font size="3">More information</font></th>
</tr>
</thead>
<tbody>
{% for item in reg %}
<tr>
<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[4]}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item[5]}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3"><a href="/country?date={{item[0]}}&region={{item[1]}}">country's information</a></font></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<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>

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Global information</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/images.jpg" alt="照片"/>
<br>
<a href="/"><font size="4">return home page</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">date</font></th>
<th lay-data="{field:'new_confirmed', width:200}"><font size="3">cumlative_confirmed</font></th>
<th lay-data="{field:'active_cases', width:200}"><font size="3">new_confirmed</font></th>
<th lay-data="{field:'imported_cases', width:200}"><font size="3">cumulative_deaths</font></th>
<th lay-data="{field:'recovered', width:200}"><font size="3">new_deaths</font></th>
<th lay-data="{field:'new_deaths', width:200}"><font size="3">More information</font></th>
</tr>
</thead>
<tbody>
{% for item in world %}
<tr>
<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[4]}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3"><a href="/region?date={{item[0]}}">region's information</a></font></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<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>

@ -0,0 +1,87 @@
<!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/cover.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:200}"><font size="3">死亡人数</font></th>#}
{# <th lay-data="{field:'deaths', width:200}"><font size="3">详细信息</font></th>#}
</tr>
</thead>
<tbody>
{% for item in wuhan %}
<tr>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.date}}</font></td>
<td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.district}}</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.total_confirmed}}</font></td>#}
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.active_cases}}</font></td>#}
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.recovered}}</font></td>#}
{# <td align="center" style="width:180px; height: 21px;" valign="middle"><font size="3">{{item.deaths}}</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>
Loading…
Cancel
Save