还没有解决排版问题

master
yangxudongll 5 years ago
parent 78f10caaca
commit 62bf87ecba

@ -27,15 +27,21 @@ def chinasummary():
db=GetFromDB()
nowtime=time.strftime('%Y-%m-%d',time.localtime(time.time()))
results=db.searchSummaryChina(nowtime)
print(results)
results=results[0]
#获取各省份疫情数据
provinces=db.searchProvinceConfirmed(nowtime)
#获取前5个确诊人数最多的省份
top5data=db.query_province_topn(nowtime,5)
#获取前8个无症状感染者最多的省份
asymp=db.query_province_asymp(nowtime)
data=jsonify(curConfirm=results[1],curConfirmRelative=results[2],
confirmed=results[9],confirmedRelative=results[10],
cured=results[13],curedRelative=results[14],died=results[15],
diedRelative=results[16],updateTime=nowtime,area=[x[0] for x in provinces],
proconfirmed=[x[1] for x in provinces])
proconfirmed=[x[1] for x in provinces],suspect=results[5],suspectRelative=results[6],
top5province=[x[0] for x in top5data],top5confirmed=[x[1] for x in top5data],
asymptomacNum=[x[1] for x in asymp],asymptomaticArea=[x[0] for x in asymp])
return data

@ -30,6 +30,14 @@ class GetFromDB():
results=self.cursor.fetchall()
return results
#查询无症状感染者最多的8个省份
def query_province_asymp(self,date):
nowdate=date+"%"
sql='select area,asymptomatic from ProvinceTable where pub_date like "%s" order by asymptomatic desc limit 8'%(nowdate)
self.cursor.execute(sql)
results=self.cursor.fetchall()
return results
#查询各省的确诊人数
def searchProvinceConfirmed(self,date):
thedate = date + "%"

@ -40,14 +40,7 @@
<div class="top">
<img src="{{url_for('static',filename='images/hImg.png')}}" alt="" width="100%" class="t_img">
<!-- <p>"聚"己之"能" "忧"患与共</p>
<span>合力战疫 "奠"定胜局</span>
<div class="logo_text">
<div class="content">
<img src="images/logo.png" alt="">
<div>深圳市聚能优电科技有限公司</div>
</div>
</div> -->
</div>
<div class="middle middle_con">
@ -58,15 +51,15 @@
</div>
<div class="scroll_mar">
<marquee behavior="scroll" direction="left">
如果您是湖北籍且目前身在湖北,疫情过后有意向来深圳发展,即日起可打开链接,在公司任何一个线上招聘网站或者公司官方公众号直接投递简历,公司人事小姐姐将重点筛选湖北籍简历,如接到面试通知,可等疫情过后参与面试,通过之后,入职日期将按照您投递简历之日起算。湖北的兄弟姐妹,我们在深圳等你!
第三组生产实习
</marquee>
</div>
<div class="scroll_detail"><a href="https://mp.weixin.qq.com/s/ZrbUqudyGbmACwQUp1oQZA">查看详情</a></div>
<div class="scroll_detail"><a href="https://voice.baidu.com/act/newpneumonia/newpneumonia/">数据来源</a></div>
</div>
<div class="tabs">
<span class="tabs_wrap">
<span class="sty">疫情概览</span>
<span class="sty">国内疫情</span>
<span>国外疫情</span>
<span>防护知识</span>
</span>
@ -89,7 +82,7 @@
<div class="text">确诊病例</div>
</div>
<div class="list4">
<p class="color2">较昨日+<span class="add_num2">110</span></p>
<p class="color2">较昨日<span class="add_num2">110</span></p>
<p class="num num2 color2">0</p>
<div class="text">现存确诊</div>
</div>
@ -103,19 +96,10 @@
<p class="num num4 color4">0</p>
<div class="text">治愈人数</div>
</div>
</div>
<!-- analyze -->
<div class="analyze">
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
<div class="list4">
<p class="color5">较昨日+<span class="add_num5">110</span></p>
<p class="num num5 color5">0</p>
<div class="text">疑似病例</div>
</div>
</div>
@ -123,25 +107,26 @@
<div class="map t_common">
<div class="map_tit tit_common">
<!-- <span class="tit_icon"></span> -->
<span class="tit_con">&nbsp;&nbsp;疫情概览</span>
<span class="tit_con">&nbsp;&nbsp;全国累计确诊</span>
</div>
<div class="map_con" id="map_echarts" style="width:100%;height:20rem;">
<div class="map_con" id="map_echarts" style="width:100%;height:300px;">
</div>
</div>
<div class="map t_common">
<div class="map_tit tit_common">
<span class="tit_con">当前确诊人数最多省份
</span>
<div class="map_con" id="maxprovince" style="width:100%;height:20rem;"></div>
<span class="tit_con">当前确诊人数最多的5个省份</span>
<div class="map_con" id="top5chart" style="width:100%;height:300px;"></div>
</div>
</div>
<!-- 全国疫情各省累计确诊图 -->
<div id="echarts1" style="width:100%;height:4rem;margin-bottom:0.4rem;"></div>
<!-- 全国疫情新增确诊图 -->
<div class="map t_common">
<div class="map_tit tit_common">
<span class="tit_con">全国无症状感染者分布</span>
<div class="map_con" id="asymptomaticLoc" style="width:100%;height:300px;"></div>
</div>
</div>
<div id="echarts2" style="width:100%;height:4rem;margin-bottom:0.4rem;"></div>
<!-- 全国疫情累计死亡/治愈趋势图 -->
<div id="echarts3" style="width:100%;height:4rem;"></div>
<!-- table -->
<!-- 全国表格 -->
@ -177,14 +162,6 @@
<span class="t_heal">治愈</span>
</div>
<ul class="content">
<!-- <li class="c_line">
<div class="line_first">
<span class="c_area" style="text-align:center;">全球</span>
<span class="c_confirm">20623</span>
<span class="c_dead">427</span>
<span class="c_heal">657</span>
</div>
</li> -->
</ul>
</div>
@ -193,8 +170,13 @@
</div>
<div class="tabs_list dongtai">
<div class="main">
<ul class="cbp_tmtimeline">
<!-- 这里是最新动态 -->
</ul>
</div>
</div>
<div class="tabs_list fhzs">
<div class="china table_t t_common">
<div class="tit_common">
@ -204,29 +186,21 @@
</div>
<!-- <div class="tit tit1 tit_common">患者特征与防护</div> -->
<div class="fhhz">
<span>患者特征汇总</span>
<img src="{{url_for('static',filename='images/fhhz.png')}}" alt="" width="100%">
</div>
<div class="fhbl">
<span>性别比例</span>
<img src="{{url_for('static',filename='images/fhbl.png')}}" alt="" width="100%">
</div>
<div class="fhnl">
<span>年龄分布</span>
<p>
<b>中位数48岁</b>范围9个月~96岁15岁以下年龄组病例不到0.6%。
</p>
</div>
<div class="china table_t t_common">
<div class="tit_common">
<!-- <span class="tit_icon"></span> -->
<span class="tit_con">&nbsp;&nbsp;节后返岗如是说</span>
</div>
</div>
<!-- <div class="tit tit tit_common">节后返岗如是说</div> -->
<div class="fhfg">
<img src="{{url_for('static',filename='images/fhfg.jpg')}}" alt="" width="100%">
</div>
</div>
@ -259,6 +233,8 @@ for (var i = 0; i < ospan.length; i++) {
num_op = this.index;
}
};
//绘制全国疫情地图
var dataList=[]
var myChart = echarts.init(document.getElementById('map_echarts'));
option = {
@ -339,6 +315,64 @@ for (var i = 0; i < ospan.length; i++) {
}
]
};
//绘制前5个确诊人数最多的省份
var top5chart=echarts.init(document.getElementById("top5chart"));
top5option={
title:{
text:'确诊人数最多5个省份',
subtext:'',
left:'center',
},
tooltip:{
trigger:'item',
formatter:'{a}<br/>{b}:{c}({d}%)',
},
legend:{
orient:'vertical',
left:'left',
data:[],
},
series:[
{
name:'访问来源',
type:'pie',
radius:'55%',
center:['50%','60%'],
data:[],
emphasis:{
itemStyle:{
shadowBlur:10,
shadowOffsetX:0,
shadowColor:'rgba(0,0,0,0.5)'
}
}
}
],
};
//绘制全国无症状感染者分布
var asymptomatic=echarts.init(document.getElementById("asymptomaticLoc"));
sympoption={
title:{
text:"无症状感染者分布",
left:'center',
},
xAxis:{
type:'category',
data:[]
},
yAxis:{
type:'value',
},
series:[{
data:[],
type:'bar',
showBackground:true,
backgroundStyle:{
color:'rgb(220,220,0.8)'
}
}]
};
$.ajax({
cache:false,
type:'POST',
@ -357,12 +391,30 @@ $.ajax({
$(".add_num3").html(results.diedRelative); //新增死亡人数
$(".num4").html(results.cured); //治愈人数
$(".add_num4").html(results.curedRelative); //新增治愈人数
$(".num5").html(results.suspect); //治愈人数
$(".add_num5").html(results.suspectRelative); //新增治愈人数
top5option.title.subtext=results.updateTime;
cityName=results.area;
proconfirmed=results.proconfirmed;
for(i=0;i<cityName.length;i++){
option.series[0].data.push({name:cityName[i],value:proconfirmed[i]});
}
top5province=results.top5province;
top5confirmed=results.top5confirmed;
for(i=0;i<top5province.length;i++){
top5option.series[0].data.push({name:top5province[i],value:top5confirmed[i]});
top5option.legend.data.push(top5province[i]);
}
asymptomaticNum=results.asymptomacNum;
asymptomaticArea=results.asymptomaticArea;
for(i=0;i<asymptomaticNum.length;i++){
sympoption.xAxis.data.push(asymptomaticArea[i]);
sympoption.series[0].data.push(asymptomaticNum[i]);
}
myChart.setOption(option);
top5chart.setOption(top5option);
asymptomatic.setOption(sympoption);
}

@ -3,9 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="fcea9d71-f4b2-41ab-b680-ecae8402b966" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/hello.py" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/hello.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GrapData.py" beforeDir="false" afterPath="$PROJECT_DIR$/GrapData.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/models.py" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/models.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -85,22 +83,22 @@
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state x="704" y="108" width="624" height="753" key="FileChooserDialogImpl/67.27.1853.1053@67.27.1853.1053" timestamp="1596679790740" />
<state width="1814" height="398" key="GridCell.Tab.0.bottom" timestamp="1597139627130">
<state width="1814" height="398" key="GridCell.Tab.0.bottom" timestamp="1597162055824">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.bottom/67.27.1853.1053@67.27.1853.1053" timestamp="1597139627130" />
<state width="1814" height="398" key="GridCell.Tab.0.center" timestamp="1597139627126">
<state width="1814" height="398" key="GridCell.Tab.0.bottom/67.27.1853.1053@67.27.1853.1053" timestamp="1597162055824" />
<state width="1814" height="398" key="GridCell.Tab.0.center" timestamp="1597162055822">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.center/67.27.1853.1053@67.27.1853.1053" timestamp="1597139627126" />
<state width="1814" height="398" key="GridCell.Tab.0.left" timestamp="1597139627125">
<state width="1814" height="398" key="GridCell.Tab.0.center/67.27.1853.1053@67.27.1853.1053" timestamp="1597162055822" />
<state width="1814" height="398" key="GridCell.Tab.0.left" timestamp="1597162055821">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.left/67.27.1853.1053@67.27.1853.1053" timestamp="1597139627125" />
<state width="1814" height="398" key="GridCell.Tab.0.right" timestamp="1597139627127">
<state width="1814" height="398" key="GridCell.Tab.0.left/67.27.1853.1053@67.27.1853.1053" timestamp="1597162055821" />
<state width="1814" height="398" key="GridCell.Tab.0.right" timestamp="1597162055823">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="398" key="GridCell.Tab.0.right/67.27.1853.1053@67.27.1853.1053" timestamp="1597139627127" />
<state width="1814" height="398" key="GridCell.Tab.0.right/67.27.1853.1053@67.27.1853.1053" timestamp="1597162055823" />
<state x="67" y="27" width="1521" height="1053" key="SettingsEditor" timestamp="1596677393346">
<screen x="67" y="27" width="1853" height="1053" />
</state>

Loading…
Cancel
Save