项目基本完成,但是只能在Google能正常显示

master
yangxudongll 4 years ago
parent ec550dbaab
commit 954cc69cef

File diff suppressed because it is too large Load Diff

@ -53,8 +53,9 @@ def GlobalInfomation():
confirmed = [x[0] for x in results]
confirmed.append(db.searchSummaryChina('2020-08-10')[0][1])
top10data=db.query_top10(nowtime)
print(top10data)
summaryData=db.querySummaryForeign(nowtime)[0]
newAddData=db.query_newadd()
data=jsonify(country=country, confirmed=confirmed,died=[x[1] for x in results],
crued=[x[2] for x in results],curConfirm=[x[4] for x in results],
confirmedRelative=[x[5] for x in results],updateTime=nowtime,
@ -63,7 +64,8 @@ def GlobalInfomation():
TotalDied=summaryData[6],TotalDiedRelative=summaryData[7],
TotalCruedRelative=summaryData[5],TotalcurConfirmRelative=summaryData[9],
top10confirmed=[x[0] for x in top10data],top10curconfirm=[x[1] for x in top10data],
top10country=[x[2] for x in top10data])
top10country=[x[2] for x in top10data],newAddconfirmed=[x[0] for x in newAddData],
newAddTime=[x[2][0:10] for x in newAddData])
return data
@app.route("/")
@ -78,9 +80,6 @@ def helloindex():
def foreign():
return render_template('foreign.html')
@app.route("/fanghu/")
def hello1():
return render_template('fanghu.html')
if __name__=='__main__':
app.run(host='192.168.1.30')

@ -80,3 +80,10 @@ class GetFromDB():
self.cursor.execute(sql)
return self.cursor.fetchall()
#查询现有新增和累计新增
def query_newadd(self):
sql='select confirmedRelative,curConfirmRelative,updateTime from OutsideChina'
self.cursor.execute(sql)
return self.cursor.fetchall()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

@ -1,39 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %} {% endblock %}新冠疫情 </title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
{% block head %}{% endblock%}
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">导航条</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">首页 <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">国内疫情</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">国外疫情</a>
</li>
</ul>
</div>
</nav>
{% block main %}{% endblock %}
</body>
</html>

@ -1,88 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock%}</title>
<meta charset="utf-8">
<!--如果是IE 就以标准渲染-->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 视窗——————响应式布局 -->
<meta name='viewport' content='width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0'>
<!--当前页面的三要素-->
<meta name="description" content="关键词、关键字">
<meta name="keywords" content="描述">
<link rel="icon" href="{{url_for('static',filename='images/favicon.ico')}}" type="image/x-icon" />
<!-- 引入CSS文件 -->
<link rel="stylesheet" type="text/css" href="{{url_for('static',filename='css/index.css')}}">
<!-- 公共样式 -->
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/common.css')}}">
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script src={{url_for('static',filename='js/update.js')}}></script>
<script
src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js">
</script>
<script src={{url_for('static',filename='js/china.js')}}></script>
<script type='text/javascript' src='{{ url_for("static",filename="js/echarts.js")}}'></script>
<script type='text/javascript' src='{{ url_for("static",filename="js/china.js")}}'></script>
<script type="text/javascript",src=" {{url_for('static',filename='js/jquery-3.2.1.js')}}"></script>
</head>
<body>
<div id='container' class='container'>
<div class="top">
<img src="{{url_for('static',filename='images/hImg.png')}}" alt="" width="100%" class="t_img">
</div>
<div class="middle middle_con">
<div class='wrap'>
<div class="scroll_wrap">
<div class="scroll_img">
<img src="{{url_for('static',filename='images/news.png')}}" alt="">
</div>
<div class="scroll_mar">
<marquee behavior="scroll" direction="left">
第三组生产实习
</marquee>
</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 >国外疫情</span>
<span>防护知识</span>
</span>
</div>
<div class="tabs_content">
{% block page%}
{% endblock %}
</div>
</div>
</div>
</div>
</div><!-- container结束 -->
{% block mainscript %}
{% endblock %}
</body>
</html>

@ -1,346 +0,0 @@
{% extends 'base1.html' %}
{% block title %}国内疫情{% endblock %}
{%block page%}
<!-- 国内疫情 -->
<div class="tabs_list gailan">
<!-- gl_tips -->
<p class="gl_tips">截止<span id="nowtime">2020-02-02 11:52</span>全国数据统计</p>
<!-- detail4 -->
<div class="detail4">
<div class="list4">
<p class="color1">较昨日+<span class="add_num1">110</span></p>
<p class="num num1 color1">0</p>
<div class="text">确诊病例</div>
</div>
<div class="list4">
<p class="color2">较昨日<span class="add_num2">110</span></p>
<p class="num num2 color2">0</p>
<div class="text">现存确诊</div>
</div>
<div class="list4">
<p class="color3">较昨日+<span class="add_num3">110</span></p>
<p class="num num3 color3">0</p>
<div class="text">死亡人数</div>
</div>
<div class="list4">
<p class="color4">较昨日+<span class="add_num4">110</span></p>
<p class="num num4 color4">0</p>
<div class="text">治愈人数</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>
<!-- map -->
<div class="map t_common">
<div class="map_tit tit_common">
<!-- <span class="tit_icon"></span> -->
<span class="tit_con">&nbsp;&nbsp;全国累计确诊</span>
</div>
<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">当前确诊人数最多的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>
<!-- table -->
<!-- 全国表格 -->
<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="china table_pro">
<div class="title">
<span class="t_area">地区</span>
<span class="t_confirm">确诊</span>
<span class="t_dead">死亡</span>
<span class="t_heal">治愈</span>
</div>
<ul class="content">
</ul>
</div>
<!-- 全球表格 -->
<div class="world table_t t_common">
<div class="tit_common">
<!-- <span class="tit_icon"></span> -->
<span class="tit_con">&nbsp;&nbsp;海外数据统计</span>
</div>
</div>
<div class="world table_pro">
<div class="title">
<span class="t_area">地区</span>
<span class="t_confirm">确诊</span>
<span class="t_dead">死亡</span>
<span class="t_heal">治愈</span>
</div>
<ul class="content">
</ul>
</div>
</div>
<!-- 国外疫情 -->
<div class="tabs_list dongtai">
<div class="main">
<ul class="cbp_tmtimeline">
<!-- 这里是最新动态 -->
</ul>
</div>
</div>
<!-- 防护知识 -->
<div class="tabs_list fhzs">
</div>
{% endblock%}
{% block mainscript %}
<script>
//在国内,国外疫情,防护知识间切换
console.log("+++++++++++++++++++++++++++++");
var ospan = document.querySelectorAll('.middle_con .wrap .tabs .tabs_wrap span');
console.log(ospan.length);
var num_op = 0;
var tabs_list = document.querySelectorAll('.middle_con .wrap .tabs_content .tabs_list');
console.log(tabs_list.length);
tabs_list[0].style.display = 'block';
for (var ii = 0; ii < ospan.length; ii++) {
console.log(ii);
ospan[ii].index = ii;
//一级标题:滑入事件
ospan[ii].onclick = function () {
//一级标题style变化
ospan[num_op].className = '';
this.className = 'sty';
//二级内容block变化
tabs_list[num_op].style.display = '';
tabs_list[this.index].style.display = 'block';
num_op = this.index;
console.log(ii);
if(ii==0)
window.location.href="/";
if(ii==1)
window.location.href="/foreign";
if(ii==2)
window.location.href="/fanghu";
}
};
//绘制全国疫情地图
var dataList=[]
var myChart = echarts.init(document.getElementById('map_echarts'));
option = {
tooltip: {
formatter:function(params,ticket, callback){
return params.seriesName+'<br />'+params.name+''+params.value
}//数据格式化
},
visualMap: {
min: 0,
max: 100000,
left: 10,
bottom: 40,
itemWidth: 5, //图元的宽
itemHeight: 5, //图元的高
itemGap: 5, //两个图元之间的间隔距离
textStyle: {
fontSize: 9, //图元字体大小
},
pieces: [{
gt: 10000,
label: "> 10000",
color: "#7f1100"
}, {
gte: 1000,
lte: 10000,
label: "1000 - 10000",
color: "#ff5428"
}, {
gte: 500,
lt: 1000,
label: "500 - 1000",
color: "#ff8c71"
}, {
gt: 100,
lt: 500,
label: "100 - 500",
color: "#ffd768"
}, {
gt: 0,
lt: 100,
label: "0 - 100",
color: "rgb(253,235,207)"
}],
show: true
},
geo: {
map: 'china',
roam: false,//不开启缩放和平移
zoom:1.23,//视角缩放比例
label: {
normal: {
show: true,
fontSize:'10',
color: 'rgba(0,0,0,0.7)'
}
},
itemStyle: {
normal:{
borderColor: 'rgba(0, 0, 0, 0.2)'
},
emphasis:{
areaColor: '#F3B329',//鼠标选择区域颜色
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
},
series : [
{
name: '确诊人数',
type: 'map',
geoIndex: 0,
data:dataList
}
]
};
//绘制前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',
async:false,
url:'/chinaSummary',
error:function(request){
alert('false');
},
success:function(results){
$("#nowtime").html(results.updateTime);
$(".num1").html(results.confirmed); //确诊病例
$(".add_num1").html(results.confirmedRelative); //新增确诊病例
$(".num2").html(results.curConfirm); //疑似病例
$(".add_num2").html(results.curConfirmRelative); //新增疑似病例
$(".num3").html(results.died); //死亡人数
$(".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);
}
});
</script>
{% endblock %}

@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>

@ -44,7 +44,7 @@
<div id='container' class='container'>
<div class="top">
<img src="{{url_for('static',filename='images/hImg.png')}}" alt="" width="100%" class="t_img">
<img src="{{url_for('static',filename='images/wuhan.jpeg')}}" alt="" width="100%" class="t_img">
</div>
@ -56,7 +56,7 @@
</div>
<div class="scroll_mar">
<marquee behavior="scroll" direction="left">
第三组生产实习
华科生产实习新冠疫情监测与分析 第三组
</marquee>
</div>
<div class="scroll_detail"><a href="https://voice.baidu.com/act/newpneumonia/newpneumonia/">数据来源</a></div>
@ -67,7 +67,6 @@
<span class="tabs_wrap">
<span >国内疫情</span>
<span class="sty">国外疫情</span>
<span>防护知识</span>
</span>
</div>
@ -123,8 +122,8 @@
<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>
<span class="tit_con">球累计新增确诊</span>
<div class="map_con" id="confirmedRelative" style="width:100%;height:400px;"></div>
</div>
</div>
<div id="echarts2" style="width:100%;height:4rem;margin-bottom:0.4rem;"></div>
@ -495,7 +494,63 @@ var top10option={
]
};
//绘制累计新增和
var totalAdd=echarts.init(document.getElementById('confirmedRelative'));
Addoption={
title:{
},
tooltip:{
trigger:'axis',
},
legend:{
data:[],
},
toolbox:{
show:true,
feture:{
dataZoom:{
yAxisIndex:'none',
},
dataView:{readOnly:false},
magicType:{type:['line','bar']},
restore:{},
saveAsImage:{}
},
},
xAxis:{
type:'category',
boundaryGap:false,
data:[],
axisLabel:{interval: 0}
},
yAxis:{
type:'value',
axisLabel:{
formatter:'{value}'
}
},
series:[
{
name:'累计新增',
type:'line',
data:[],
markPoint:{
data:[
{type:'max',name:'最大值'},
{type:'min',name:'最小值'}
]
},
markLine:{
data:[
{type:'average',name:'平均值'}
]
}
},
]
};
$.ajax({
@ -537,12 +592,19 @@ $.ajax({
top10option.series[1].data.push(top10curconfirm[i]);
}
newAddconfirmed=results.newAddconfirmed;
newAddTime=results.newAddTime;
for(i=0;i<newAddconfirmed.length;i++){
Addoption.xAxis.data.push(newAddTime[i]);
Addoption.series[0].data.push(newAddconfirmed[i]);
}
}
});
myChart.setOption(option);
top10chart.setOption(top10option);
totalAdd.setOption(Addoption);

@ -1,292 +0,0 @@
{% extends 'base.html'%}
{% block title %}首页{% endblock %}
{% block head %}
<script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js">
</script>
<script src="{{url_for('static',filename='js/china.js')}}">
</script>
<script src="{{url_for('static',filename='js/world.js')}}">
</script>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
{% endblock %}
{% block main%}
<div id="boss">
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" id="topdate" type="date" placeholder="2020-08-07" aria-label="Search">
<input class="form-control mr-sm-2" id="topnum" type="search" placeholder="省份个数" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
<div id="main" style="width: 600px;height:400px;">
</div>
</div>
<script type="text/javascript">
// 基于准备好的dom初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
option = {
title: {
text:'世界累计确诊图',
subtitle:'2020-08-10',
left: 'center',
top: 'top'
},
tooltip: {
trigger: 'item',
transitionDuration: 0.2,
formatter: function (params) {
var value = params.value;
return "确诊人数:"+value;
}
},
dataRange:{
x:'left',
y:'bottom',
splitList:[
{start:10000000,label:'>1000000',color:'#990000'},
{start:1000000,end:10000000,label:'1000000-1000000',color:'#FF6600'},
{start:100000,end:1000000,label:'100000-1000000',color:'#FF6699'},
{start:10000,end:100000,label:'10000-100000',color:'#FF99CC'},
{start:1000,end:10000,label:'1000-10000',color:'#FFCC00'},
{start:100,end:1000,label:'100-1000',color:'#FFFF00'},
{start:0,end:100,label:'0-100',color:'#FFFFCC'},
],
textStyle:{
color:'#3899FF'
},
selectMode:'false'
},
series: [
{
name: 'World Population (2010)',
type: 'map',
mapType: 'world',
roam: true,
itemStyle:{
emphasis:{label:{show:true}}
},
status:"true",
nameMap: {
"Afghanistan": "阿富汗",
"Angola": "安哥拉",
"Albania": "阿尔巴尼亚",
"Algeria": "阿尔及利亚",
"Argentina": "阿根廷",
"Armenia": "亚美尼亚",
"Australia": "澳大利亚",
"Austria": "奥地利",
"Azerbaijan": "阿塞拜疆",
"Bahamas": "巴哈马",
"Bangladesh": "孟加拉国",
"Belgium": "比利时",
"Benin": "贝宁",
"Burkina Faso": "布基纳法索",
"Burundi": "布隆迪",
"Bulgaria": "保加利亚",
"Bosnia and Herz.": "波斯尼亚和黑塞哥维那",
"Belarus": "白俄罗斯",
"Belize": "伯利兹",
"Bermuda": "百慕大群岛",
"Bolivia": "玻利维亚",
"Brazil": "巴西",
"Brunei": "文莱",
"Bhutan": "不丹",
"Botswana": "博茨瓦纳",
"Cambodia": "柬埔寨",
"Cameroon": "喀麦隆",
"Canada": "加拿大",
"Central African Rep.": "中非共和国",
"Chad": "乍得",
"Chile": "智利",
"China": "中国",
"Colombia": "哥伦比亚",
"Congo": "刚果",
"Costa Rica": "哥斯达黎加",
"Côte d'Ivoire": "科特迪瓦",
"Croatia": "克罗地亚",
"Cuba": "古巴",
"Cyprus": "塞浦路斯",
"Czech Rep.": "捷克共和国",
"Dem. Rep. Korea": "韩国",
"Dem. Rep. Congo": "刚果(金)",
"Denmark": "丹麦",
"Djibouti": "吉布提",
"Dominican Rep.": "多米尼加共和国",
"Ecuador": "厄瓜多尔",
"Egypt": "埃及",
"El Salvador": "萨尔瓦多",
"Eq. Guinea": "赤道几内亚",
"Eritrea": "厄立特里亚",
"Estonia": "爱沙尼亚",
"Ethiopia": "埃塞俄比亚",
"Falkland Is.": "福克兰群岛",
"Fiji": "斐济",
"Finland": "芬兰",
"France": "法国",
"French Guiana": "法属圭亚那",
"Fr. S. Antarctic Lands": "法属南部领地",
"Gabon": "加蓬",
"Gambia": "冈比亚",
"Germany": "德国",
"Georgia": "佐治亚州",
"Ghana": "加纳",
"Greece": "希腊",
"Greenland": "格陵兰岛",
"Guatemala": "危地马拉",
"Guinea": "几内亚",
"Guinea-Bissau": "几内亚比绍",
"Guyana": "圭亚那",
"Haiti": "海地",
"Heard I. and McDonald Is.": "赫德岛和麦克唐纳群岛",
"Honduras": "洪都拉斯",
"Hungary": "匈牙利",
"Iceland": "冰岛",
"India": "印度",
"Indonesia": "印度尼西亚",
"Iran": "伊朗",
"Iraq": "伊拉克",
"Ireland": "爱尔兰",
"Israel": "以色列",
"Italy": "意大利",
"Ivory Coast": "象牙海岸",
"Jamaica": "牙买加",
"Japan": "日本",
"Jordan": "乔丹",
"Kashmir": "克什米尔",
"Kazakhstan": "哈萨克斯坦",
"Kenya": "肯尼亚",
"Kosovo": "科索沃",
"Kuwait": "科威特",
"Kyrgyzstan": "吉尔吉斯斯坦",
"Laos": "老挝",
"Lao PDR": "老挝人民民主共和国",
"Latvia": "拉脱维亚",
"Lebanon": "黎巴嫩",
"Lesotho": "莱索托",
"Liberia": "利比里亚",
"Libya": "利比亚",
"Lithuania": "立陶宛",
"Luxembourg": "卢森堡",
"Madagascar": "马达加斯加",
"Macedonia": "马其顿",
"Malawi": "马拉维",
"Malaysia": "马来西亚",
"Mali": "马里",
"Mauritania": "毛里塔尼亚",
"Mexico": "墨西哥",
"Moldova": "摩尔多瓦",
"Mongolia": "蒙古国",
"Montenegro": "黑山",
"Morocco": "摩洛哥",
"Mozambique": "莫桑比克",
"Myanmar": "缅甸",
"Namibia": "纳米比亚",
"Netherlands": "荷兰",
"New Caledonia": "新喀里多尼亚",
"New Zealand": "新西兰",
"Nepal": "尼泊尔",
"Nicaragua": "尼加拉瓜",
"Niger": "尼日尔",
"Nigeria": "尼日利亚",
"Korea": "朝鲜",
"Northern Cyprus": "北塞浦路斯",
"Norway": "挪威",
"Oman": "阿曼",
"Pakistan": "巴基斯坦",
"Panama": "巴拿马",
"Papua New Guinea": "巴布亚新几内亚",
"Paraguay": "巴拉圭",
"Peru": "秘鲁",
"Republic of the Congo": "刚果共和国",
"Philippines": "菲律宾",
"Poland": "波兰",
"Portugal": "葡萄牙",
"Puerto Rico": "波多黎各",
"Qatar": "卡塔尔",
"Republic of Serbia": "塞尔维亚共和国",
"Romania": "罗马尼亚",
"Russia": "俄罗斯",
"Rwanda": "卢旺达",
"Samoa": "萨摩亚",
"Saudi Arabia": "沙特阿拉伯",
"Senegal": "塞内加尔",
"Serbia": "塞尔维亚",
"Sierra Leone": "塞拉利昂",
"Slovakia": "斯洛伐克",
"Slovenia": "斯洛文尼亚",
"Solomon Is.": "所罗门群岛",
"Somaliland": "索马里兰",
"Somalia": "索马里",
"South Africa": "南非",
"S. Geo. and S. Sandw. Is.": "南乔治亚和南桑德威奇群岛",
"S. Sudan": "南苏丹",
"Spain": "西班牙",
"Sri Lanka": "斯里兰卡",
"Sudan": "苏丹",
"Suriname": "苏里南",
"Swaziland": "斯威士兰",
"Sweden": "瑞典",
"Switzerland": "瑞士",
"Syria": "叙利亚",
"Tajikistan": "塔吉克斯坦",
"Tanzania": "坦桑尼亚",
"Thailand": "泰国",
"Timor-Leste": "东帝汶",
"Togo": "多哥",
"Trinidad and Tobago": "特立尼达和多巴哥",
"Tunisia": "突尼斯",
"Turkey": "土耳其",
"Turkmenistan": "土库曼斯坦",
"Uganda": "乌干达",
"Ukraine": "乌克兰",
"United Arab Emirates": "阿拉伯联合酋长国",
"United Kingdom": "大不列颠联合王国",
"United Republic of Tanzania": "坦桑尼亚联合共和国",
"United States": "美国",
"United States of America": "美利坚合众国",
"Uruguay": "乌拉圭",
"Uzbekistan": "乌兹别克斯坦",
"Vanuatu": "瓦努阿图",
"Venezuela": "委内瑞拉",
"Vietnam": "越南",
"West Bank": "西岸",
"W. Sahara": "西撒哈拉",
"Yemen": "也门",
"Zambia": "赞比亚",
"Zimbabwe": "津巴布韦"
},
data: [],
}
]
};
$.ajax({
cache:false,
data:[],
url:'/globalInfo',
type:'POST',
async:false,
error:function(request){
alert("fail");
},
success:function(results){
confirmed=results.confirmed;
country=results.country;
console.log(confirmed);
console.log(country);
for(i=0;i<confirmed.length;i++){
option.series[0].data.push({name:country[i],value:confirmed[i]});
}
}
});
myChart.setOption(option);
</script>
{%endblock%}

@ -1,104 +0,0 @@
{% extends 'base.html'%}
{% block title %}首页{% endblock %}
{% block head %}
<script
src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js">
</script>
<script
src="{{url_for('static',filename='js/china.js')}}">
</script>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
{% endblock %}
{% block main%}
<div id="boss">
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" id="topdate" type="date" placeholder="2020-08-07" aria-label="Search">
<input class="form-control mr-sm-2" id="topnum" type="search" placeholder="省份个数" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
<div id="main" style="width: 400px;height:400px;">
</div>
</div>
<script type="text/javascript">
// 基于准备好的dom初始化echarts实例
var dataList=[]
var myChart = echarts.init(document.getElementById('main'));
option = {
tooltip: {
formatter:function(params,ticket, callback){
return params.seriesName+'<br />'+params.name+''+params.value
}//数据格式化
},
visualMap: {
left: 'left',
top: 'bottom',
text: ['高','低'],//取值范围的文字
show:true//图注
},
geo: {
map: 'china',
roam: false,//不开启缩放和平移
zoom:1.23,//视角缩放比例
label: {
normal: {
show: true,
fontSize:'10',
color: 'rgba(0,0,0,0.7)'
}
},
itemStyle: {
normal:{
borderColor: 'rgba(0, 0, 0, 0.2)'
},
emphasis:{
areaColor: '#F3B329',//鼠标选择区域颜色
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
},
series : [
{
name: '确诊人数',
type: 'map',
geoIndex: 0,
data:dataList
}
]
};
$.ajax({
cache:false,
data:null,
url:'/chinaInfo',
type:'POST',
async:false,
error:function(request){
alert("fail");
},
success:function(results){
cityName=results.areas;
confirmed=results.confirmed;
console.log(cityName);
console.log(confirmed);
for(i=0;i<cityName.length;i++){
option.series[0].data.push({name:cityName[i],value:confirmed[i]});
}
}
});
myChart.setOption(option);
</script>
{%endblock%}

@ -42,7 +42,7 @@
<div id='container' class='container'>
<div class="top">
<img src="{{url_for('static',filename='images/hImg.png')}}" alt="" width="100%" class="t_img">
<img src="{{url_for('static',filename='images/wuhan.jpeg')}}" alt="" width="100%" class="t_img">
</div>
@ -54,7 +54,7 @@
</div>
<div class="scroll_mar">
<marquee behavior="scroll" direction="left">
第三组生产实习
华科生产实习新冠疫情监测与分析 第三组
</marquee>
</div>
<div class="scroll_detail"><a href="https://voice.baidu.com/act/newpneumonia/newpneumonia/">数据来源</a></div>
@ -65,7 +65,6 @@
<span class="tabs_wrap">
<span class="sty">国内疫情</span>
<span >国外疫情</span>
<span>防护知识</span>
</span>
</div>

@ -5,8 +5,7 @@
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/hello.py" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/hello.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/models.py" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/models.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/foreign.html" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/foreign.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataFrame.py" beforeDir="false" afterPath="$PROJECT_DIR$/DataFrame.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/../数据分析和可视化/新冠疫情/templates/index.html" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -86,22 +85,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="437" key="GridCell.Tab.0.bottom" timestamp="1597227635575">
<state width="1814" height="437" key="GridCell.Tab.0.bottom" timestamp="1597248106479">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="437" key="GridCell.Tab.0.bottom/67.27.1853.1053@67.27.1853.1053" timestamp="1597227635575" />
<state width="1814" height="437" key="GridCell.Tab.0.center" timestamp="1597227635572">
<state width="1814" height="437" key="GridCell.Tab.0.bottom/67.27.1853.1053@67.27.1853.1053" timestamp="1597248106479" />
<state width="1814" height="437" key="GridCell.Tab.0.center" timestamp="1597248106477">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="437" key="GridCell.Tab.0.center/67.27.1853.1053@67.27.1853.1053" timestamp="1597227635572" />
<state width="1814" height="437" key="GridCell.Tab.0.left" timestamp="1597227635571">
<state width="1814" height="437" key="GridCell.Tab.0.center/67.27.1853.1053@67.27.1853.1053" timestamp="1597248106477" />
<state width="1814" height="437" key="GridCell.Tab.0.left" timestamp="1597248106477">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="437" key="GridCell.Tab.0.left/67.27.1853.1053@67.27.1853.1053" timestamp="1597227635571" />
<state width="1814" height="437" key="GridCell.Tab.0.right" timestamp="1597227635573">
<state width="1814" height="437" key="GridCell.Tab.0.left/67.27.1853.1053@67.27.1853.1053" timestamp="1597248106477" />
<state width="1814" height="437" key="GridCell.Tab.0.right" timestamp="1597248106478">
<screen x="67" y="27" width="1853" height="1053" />
</state>
<state width="1814" height="437" key="GridCell.Tab.0.right/67.27.1853.1053@67.27.1853.1053" timestamp="1597227635573" />
<state width="1814" height="437" key="GridCell.Tab.0.right/67.27.1853.1053@67.27.1853.1053" timestamp="1597248106478" />
<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