commit 510e7463de5f6c6de7266d8ffe3d12a81728c671 Author: absence <2549767334@qq.com> Date: Wed May 6 23:23:46 2020 +0800 hhh diff --git a/alter.html b/alter.html new file mode 100644 index 0000000..bdc28a0 --- /dev/null +++ b/alter.html @@ -0,0 +1,67 @@ + + + + +修改 + + +
+
+

+

修改信息

+

+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/alter2.html b/alter2.html new file mode 100644 index 0000000..6277a34 --- /dev/null +++ b/alter2.html @@ -0,0 +1,51 @@ + + + + +修改 + + +
+
+

+

修改信息

+

+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/alter3.html b/alter3.html new file mode 100644 index 0000000..c8a509f --- /dev/null +++ b/alter3.html @@ -0,0 +1,50 @@ +

+

修改信息

+

+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/alter4.html b/alter4.html new file mode 100644 index 0000000..595a68b --- /dev/null +++ b/alter4.html @@ -0,0 +1,59 @@ + + + + +修改 + + +
+
+

+

修改信息

+

+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..a64bda7 --- /dev/null +++ b/app.py @@ -0,0 +1,347 @@ +from flask import Flask,render_template,request,redirect +from flask_sqlalchemy import SQLAlchemy +app = Flask(__name__) +db = SQLAlchemy(app) +#设置数据库连接 +app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:@127.0.0.1:3306/information_of_city' + +class city_count(db.Model): +#表模型 + city= db.Column(db.Integer) + area = db.Column(db.Integer,primary_key=True,autoincrement=True) + patient_count = db.Column(db.Integer) + suspected = db.Column(db.Integer) + no_cases = db.Column(db.Integer) + mild_cases = db.Column(db.Integer) + severe_cases = db.Column(db.Integer) + +class treatment_count(db.Model): +#表模型 + name= db.Column(db.String(255)) + patients = db.Column(db.Integer) + remaining_position = db.Column(db.Integer) + total_position = db.Column(db.Integer,primary_key=True,autoincrement=True) + total_worker = db.Column(db.Integer) + +class treatment_point(db.Model): +#表模型 + treatment_point_id= db.Column(db.Integer,primary_key=True,autoincrement=True) + name = db.Column(db.String(255)) + total_position = db.Column(db.Integer) + area_id = db.Column(db.Integer) + city_id = db.Column(db.Integer) + +class patient(db.Model): +#表模型 + patient_id= db.Column(db.Integer,primary_key=True,autoincrement=True) + name = db.Column(db.String(255)) + treatment_point_id = db.Column(db.Integer) + phone = db.Column(db.Integer) + area_id = db.Column(db.Integer) + city_id = db.Column(db.Integer) + +class medical_worker(db.Model): +#表模型 + worker_id= db.Column(db.Integer,primary_key=True,autoincrement=True) + name = db.Column(db.String(255)) + treatment_point_id = db.Column(db.Integer) + phone = db.Column(db.Integer) + +class report(db.Model): +#表模型 + patient_id = db.Column(db.Integer,primary_key=True,autoincrement=True) + update_time = db.Column(db.String(255)) + situation = db.Column(db.String(255)) + +@app.route("/index7/") +def selectAll7(): + RE = report.query.order_by(report.patient_id).all() + return render_template("index7.html",R_E = RE) + +@app.route('/insert2',methods=['GET','POST']) +def insert2(): +#进行添加操作 + patient_id = request.form['patient_id'] + update_time = request.form['update_time'] + situation = request.form['situation'] + Report = report(patient_id=patient_id,update_time=update_time,situation =situation) + db.session.add(Report) + db.session.commit() +#添加完成重定向至主页 + return redirect('/index7/') + +@app.route("/insert2_page") +def insert2_page(): +#跳转至添加信息页面 + return render_template("insert2.html") + +#删除数据 +@app.route("/delete2",methods=['GET']) +def delete2(): +#操作数据库得到目标数据,before_number表示删除之前的数量,after_name表示删除之后的数量 + patient_id = request.args.get("patient_id") + Report = report.query.filter_by(patient_id=patient_id).first() + db.session.delete(Report) + db.session.commit() + return redirect('/') + +#修改操作 +@app.route("/alter2",methods=['GET','POST']) +def alter2(): +# 可以通过请求方式来改变处理该请求的具体操作 +# 比如用户访问/alter页面 如果通过GET请求则返回修改页面 如果通过POST请求则使用修改操作 + if request.method == 'GET': + patient_id = request.args.get('patient_id') + update_time = request.args.get('update_time') + situation = request.args.get('situation') + Report = report(patient_id=patient_id, update_time=update_time, situation=situation) + return render_template("alter2.html",Report = Report) + else: +#接收参数,修改数据 + patient_id = request.form['patient_id'] + update_time = request.form['update_time'] + situation = request.form['situation'] + Report = report.query.filter_by(patient_id=patient_id).first() + Report.patient_id =patient_id + Report.update_time = update_time + Report.situation = situation + db.session.commit() + return redirect('/index7') + + +@app.route("/index6/") +def selectAll6(): + MW = medical_worker.query.order_by(medical_worker.worker_id).all() + + return render_template("index6.html",M_W = MW) + +@app.route('/insert3',methods=['GET','POST']) +def insert3(): +#进行添加操作 + worker_id = request.form['worker_id'] + name = request.form['name'] + treatment_point_id = request.form['treatment_point_id'] + phone = request.form['phone'] + Med = medical_worker(worker_id=worker_id,name=name,treatment_point_id =treatment_point_id,phone=phone) + db.session.add(Med) + db.session.commit() +#添加完成重定向至主页 + return redirect('/index6/') + +@app.route("/insert3_page") +def insert3_page(): +#跳转至添加信息页面 + return render_template("insert3.html") + +#删除数据 +@app.route("/delete3",methods=['GET']) +def delete3(): +#操作数据库得到目标数据,before_number表示删除之前的数量,after_name表示删除之后的数量 + worker_id = request.args.get("worker_id") + Med = medical_worker.query.filter_by(worker_id=worker_id).first() + db.session.delete(Med) + db.session.commit() + return redirect('/') + +#修改操作 +@app.route("/alter3",methods=['GET','POST']) +def alter3(): +# 可以通过请求方式来改变处理该请求的具体操作 +# 比如用户访问/alter页面 如果通过GET请求则返回修改页面 如果通过POST请求则使用修改操作 + if request.method == 'GET': + worker_id = request.args.get('worker_id') + name = request.args.get('name') + treatment_point_id = request.args.get('treatment_point_id') + phone = request.args.get('phone') + Med = medical_worker(worker_id=worker_id, name=name, treatment_point_id=treatment_point_id,phone=phone) + return render_template("alter3.html",Med = Med) + else: +#接收参数,修改数据 + worker_id = request.form['worker_id'] + name = request.form['name'] + treatment_point_id = request.form['treatment_point_id'] + phone = request.form['phone'] + Med = medical_worker.query.filter_by(worker_id=worker_id).first() + Med.worker_id =worker_id + Med.name = name + Med.treatment_point_id = treatment_point_id + Med.phone = phone + db.session.commit() + return redirect('/index6') + +@app.route("/index5/") +def selectAll5(): + PA = patient.query.order_by(patient.patient_id).all() + + return render_template("index5.html",P_A = PA) + +#添加数据 +@app.route('/insert',methods=['GET','POST']) +def insert(): +#进行添加操作 + patient_id = request.form['patient_id'] + name = request.form['name'] + treatment_point_id = request.form['treatment_point_id'] + phone = request.form['phone'] + area_id = request.form['area_id'] + city_id = request.form['city_id'] + Patient = patient(patient_id=patient_id,name=name,treatment_point_id=treatment_point_id,phone=phone,area_id=area_id,city_id=city_id) + db.session.add(Patient) + db.session.commit() +#添加完成重定向至主页 + return redirect('/index5') + +@app.route("/insert_page") +def insert_page(): +#跳转至添加信息页面 + return render_template("insert.html") + +#删除数据 +@app.route("/delete",methods=['GET']) +def delete(): +#操作数据库得到目标数据,before_number表示删除之前的数量,after_name表示删除之后的数量 + patient_id = request.args.get("patient_id") + Patient = patient.query.filter_by(patient_id=patient_id).first() + db.session.delete(Patient) + db.session.commit() + return redirect('/index5') + +#修改操作 +@app.route("/alter",methods=['GET','POST']) +def alter(): +# 可以通过请求方式来改变处理该请求的具体操作 +# 比如用户访问/alter页面 如果通过GET请求则返回修改页面 如果通过POST请求则使用修改操作 + if request.method == 'GET': + patient_id = request.args.get('patient_id') + name = request.args.get('name') + treatment_point_id = request.args.get('treatment_point_id') + phone = request.args.get('phone') + area_id = request.args.get('area_id ') + city_id = request.args.get('city_id') + Patient = patient(patient_id=patient_id, name=name, treatment_point_id=treatment_point_id, + phone=phone, area_id=area_id, city_id=city_id) + return render_template("alter.html",Patient = Patient) + else: +#接收参数,修改数据 + patient_id = request.form['patient_id'] + name = request.form['name'] + treatment_point_id = request.form['treatment_point_id'] + phone = request.form['phone'] + area_id = request.form['area_id '] + city_id = request.form['city_id'] + Patient = patient.query.filter_by(patient_id=patient_id).first() + Patient.patient_id =patient_id + Patient.name = name + Patient.treatment_point_id = treatment_point_id + Patient.phone = phone + Patient.area_id = area_id + Patient.city_id = city_id + db.session.commit() + return redirect('/index5/') + +@app.route("/index4/") +def selectAll4(): + TP = treatment_point.query.order_by(treatment_point.treatment_point_id).all() + + return render_template("index4.html",T_P = TP) + +@app.route("/index45/") +def selectAll45(): + TP = treatment_point.query.order_by(treatment_point.treatment_point_id).all() + + return render_template("index45.html",T_P = TP) + +#添加数据 +@app.route('/insert45',methods=['GET','POST']) +def insert4(): +#进行添加操作 + treatment_point_id = request.form['treatment_point_id'] + name = request.form['name'] + total_position = request.form['total_position'] + area_id = request.form['area_id'] + city_id = request.form['city_id'] + Tp = treatment_point(treatment_point_id=treatment_point_id,name=name,total_position =total_position,area_id =area_id ,city_id=city_id) + db.session.add(Tp) + db.session.commit() +#添加完成重定向至主页 + return redirect('/index45/') + +@app.route("/insert4_page") +def insert4_page(): +#跳转至添加信息页面 + return render_template("insert4.html") + +#删除数据 +@app.route("/delete4",methods=['GET']) +def delete4(): +#操作数据库得到目标数据,before_number表示删除之前的数量,after_name表示删除之后的数量 + treatment_point_id = request.args.get("treatment_point_id") + Tp = treatment_point.query.filter_by(treatment_point_id=treatment_point_id).first() + db.session.delete(Tp) + db.session.commit() + return redirect('/') + +#修改操作 +@app.route("/alter4",methods=['GET','POST']) +def alter4(): +# 可以通过请求方式来改变处理该请求的具体操作 +# 比如用户访问/alter页面 如果通过GET请求则返回修改页面 如果通过POST请求则使用修改操作 + if request.method == 'GET': + treatment_point_id = request.args.get('treatment_point_id') + name = request.args.get('name') + total_position = request.args.get('total_position') + area_id = request.args.get('area_id ') + city_id = request.args.get('city_id') + Tp = treatment_point(treatment_point_id=treatment_point_id, name=name, total_position=total_position, + area_id=area_id, city_id=city_id) + return render_template("alter4.html",Tp = Tp) + else: +#接收参数,修改数据 + treatment_point_id = request.form['treatment_point_id'] + name = request.form['name'] + total_position = request.form['total_position'] + area_id = request.form['area_id '] + city_id = request.form['city_id'] + Tp = treatment_point.query.filter_by(treatment_point_id=treatment_point_id).first() + Tp.treatment_point_id =treatment_point_id + Tp.name = name + Tp.total_position = total_position + Tp.area_id = area_id + Tp.city_id = city_id + db.session.commit() + return redirect('/index45') + +@app.route("/index3/") +def selectAll3(): + TP = treatment_count.query.order_by(treatment_count.total_position).all() + + return render_template("index3.html",T_P= TP) + +@app.route("/index2/") +def selectAll2(): + cityPost = city_count.query.order_by(city_count.area).all() + return render_template("index2.html",city_Post = cityPost) + +@app.route("/login") +def login_page(): + return render_template("登录.html") + +@app.route("/tourist") +def login_tourist(): + return render_template("游客导航界面.html") + +@app.route("/doctor")\ + +def login_doctor(): + return render_template("医务工作者导航界面.html") + +@app.route("/master") +def login_master(): + return render_template("决策者导航界面.html") + +@app.route('/') +def index(): + return login_page() + +if __name__ == "__main__": + app.run() \ No newline at end of file diff --git a/denglu.html b/denglu.html new file mode 100644 index 0000000..2fcf3b6 --- /dev/null +++ b/denglu.html @@ -0,0 +1,210 @@ + + + + + +login + + + + + +
+
+ +
+

登录

+
+ +
+ + + +
+
+ + + +
+
+ +
+ +
+ +
+ +
+
+ +
+

登录

+
+ +
+ + + +
+
+ + + +
+
+ +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..4ede43a --- /dev/null +++ b/index.html @@ -0,0 +1,112 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + + + +

疫情实时大数据报告

+
+
+
+ + +
+ + + + + + + + + + + + +{% for item in city_List %} + + + + + + + + + + +{% endfor %} +
各市病例统计
城市名新增确诊现有确诊疑似病例死亡人数治愈数死亡率治愈率
{{item.name}}{{item.today_confirm}}{{item.total_confirm}}{{item.total_suspect}}{{item.total_dead}}{{item.total_heal}}{{item.total_deadRate}}{{item.total_healRate}}
+
+ +
+ + + + + + + + + + + + + + +{% for item in province_List %} + + + + + + + + + + + +{% endfor %} + +
各省病例统计
省份新增确诊现有确诊疑似病例死亡人数治愈数死亡率治愈率
{{item.prov_name}}{{item.today_confirm}}{{item.total_confirm}}{{item.total_suspect}}{{item.total_dead}}{{item.total_heal}}{{item.total_deadRate}}{{item.total_healRate}}编辑 +删除
+ +
+ + + + + + \ No newline at end of file diff --git a/index2.html b/index2.html new file mode 100644 index 0000000..919b728 --- /dev/null +++ b/index2.html @@ -0,0 +1,41 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+
+ + +
+ + + + + + + + + + + +{% for item in city_Post %} + + + + + + + + + +{% endfor %} + +
武汉市各区病例统计
城市病人数量疑似病例无症状轻症重症
{{item.city}}{{item.area}}{{item.patient_count}}{{item.suspected}}{{item.no_cases}}{{item.mild_cases}}{{item.severe_cases}}
+ + \ No newline at end of file diff --git a/index3.html b/index3.html new file mode 100644 index 0000000..f24d67b --- /dev/null +++ b/index3.html @@ -0,0 +1,37 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+
+ + +
+ + + + + + + + + +{% for item in T_P %} + + + + + + + +{% endfor %} + +
医院病例统计
医院病人数剩余床位总床位工作人员
{{item.name}}{{item.patients}}{{item.remaining_position}}{{item.total_position}}{{item.total_worker}}
+ + \ No newline at end of file diff --git a/index4.html b/index4.html new file mode 100644 index 0000000..5edc5d6 --- /dev/null +++ b/index4.html @@ -0,0 +1,37 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+
+ + +
+ + + + + + + + + +{% for item in T_P %} + + + + + + + +{% endfor %} + +
医院病例统计
编号医院总床位地区编号城市编号
{{item.treatment_point_id}}{{item.name}}{{item.total_position}}{{item.area_id}}{{item.city_id}}
+ + \ No newline at end of file diff --git a/index45.html b/index45.html new file mode 100644 index 0000000..9096e12 --- /dev/null +++ b/index45.html @@ -0,0 +1,41 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+ 添加收治点 +
+
+ + +
+ + + + + + + + + +{% for item in T_P %} + + + + + + + + +{% endfor %} + +
医院病例统计
编号医院总床位地区编号城市编号
{{item.treatment_point_id}}{{item.name}}{{item.total_position}}{{item.area_id}}{{item.city_id}}编辑 +删除
+ + \ No newline at end of file diff --git a/index5.html b/index5.html new file mode 100644 index 0000000..029f36f --- /dev/null +++ b/index5.html @@ -0,0 +1,45 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+ 添加信息 +
+
+ +
+ + + + + + + + + + + +{% for item in P_A %} + + + + + + + + + + +{% endfor %} + +
病例统计
编号姓名治疗点电话地区编号城市编号操作
{{item.patient_id}}{{item.name}}{{item.treatment_point_id}}{{item.phone}}{{item.area_id}}{{item.city_id}}编辑 +删除
+
+ + \ No newline at end of file diff --git a/index6.html b/index6.html new file mode 100644 index 0000000..a8b4d23 --- /dev/null +++ b/index6.html @@ -0,0 +1,38 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+添加城市 +
+
+ +
+ + + + + + + + +{% for item in M_W %} + + + + + + + +{% endfor %} + +
医疗人员统计
编号姓名治疗点电话
{{item.worker_id}}{{item.name}}{{item.treatment_point_id}}{{item.phone}}编辑 +删除
+ + \ No newline at end of file diff --git a/index7.html b/index7.html new file mode 100644 index 0000000..9b1b0d1 --- /dev/null +++ b/index7.html @@ -0,0 +1,36 @@ + + + + + 新型冠状病毒肺炎疫情实时更新 + + + +

疫情实时大数据报告

+
+
+添加病例 +
+
+ +
+ + + + + + + +{% for item in R_E %} + + + + + + +{% endfor %} + +
病人病症统计
编号时间症状
{{item.patient_id}}{{item.update_time}}{{item.situation}}编辑 +删除
+ + \ No newline at end of file diff --git a/insert.html b/insert.html new file mode 100644 index 0000000..d594d23 --- /dev/null +++ b/insert.html @@ -0,0 +1,65 @@ + + + + + 增加 + + + +
+
+

+

添加信息

+

+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + diff --git a/insert2.html b/insert2.html new file mode 100644 index 0000000..0431a3e --- /dev/null +++ b/insert2.html @@ -0,0 +1,49 @@ + + + + +增加 + + + +
+
+

+

添加信息

+

+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/insert3.html b/insert3.html new file mode 100644 index 0000000..14de3c2 --- /dev/null +++ b/insert3.html @@ -0,0 +1,57 @@ + + + + +增加 + + + +
+
+

+

添加信息

+

+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/insert4.html b/insert4.html new file mode 100644 index 0000000..679d137 --- /dev/null +++ b/insert4.html @@ -0,0 +1,65 @@ + + + + +增加 + + + +
+
+

+

添加信息

+

+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/决策者导航界面.html b/决策者导航界面.html new file mode 100644 index 0000000..5f9c81a --- /dev/null +++ b/决策者导航界面.html @@ -0,0 +1,93 @@ + + +
+ + + 决策者导航界面 + + + +
+ +
+ +
+ + + 众志成城,同心抗疫 +
+ 全国疫情信息概览: + +
+ + +
+ 友情链接:丁香医生| + 百度疫情| + 首页 +
+ 回到顶部|联系我们 + +
+ + \ No newline at end of file diff --git a/医务工作者导航界面.html b/医务工作者导航界面.html new file mode 100644 index 0000000..2731695 --- /dev/null +++ b/医务工作者导航界面.html @@ -0,0 +1,95 @@ + + +
+ + + 医务工作者导航界面 + + + +
+ +
+ +
+ + + 众志成城,同心抗疫 +
+ 全国疫情信息概览: + +
+ + +
+ 友情链接:丁香医生| + 百度疫情| + 首页 +
+ 回到顶部|联系我们 + +
+ + \ No newline at end of file diff --git a/游客导航界面.html b/游客导航界面.html new file mode 100644 index 0000000..1c775e0 --- /dev/null +++ b/游客导航界面.html @@ -0,0 +1,93 @@ + + +
+ + + 游客导航界面 + + + +
+ +
+ +
+ + 众志成城,同心抗疫 +
+ 全国疫情信息概览: + +
+ + +
+ 友情链接:丁香医生| + 百度疫情| + 首页 +
+ 回到顶部|联系我们 + +
+ + \ No newline at end of file diff --git a/登录.html b/登录.html new file mode 100644 index 0000000..9d47e1d --- /dev/null +++ b/登录.html @@ -0,0 +1,112 @@ + + + + + + + + +
+ +
+ +
+
    +
  • + + 游客查询入口 +
    +
    +
    +
    + +
    +
  • +
  • + + 医务工作者查询入口 +
    +
    +
    +
    + +
    +
  • +
  • + + 决策者查询入口 +
    +
    +
    +
    + +
    +
  • +
+ + +