Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit 19facca

Browse files
committed
feat: 新增国家编码接口、删除统计接口的“辟谣与防护”字段
1 parent c1226ef commit 19facca

File tree

15 files changed

+1163
-957
lines changed

15 files changed

+1163
-957
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747

4848
pip install django_covid19
4949

50+
# 初始化数据
51+
52+
初始化国家和地区编码数据;
53+
54+
./manage.py loaddata initial_data
55+
5056
# 在线大屏
5157

5258
根据已部署的疫情在线接口,并结合使用开源数据大屏项目中的示例代码,本项目提

demo/index.html

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -30,65 +30,14 @@ <h3 class="header-title">新冠肺炎(2019-nCov)疫情</h3>
3030
<div id="container">
3131
<div id="flexCon">
3232
<div class="flex-row">
33-
<div class="flex-cell flex-cell-l">
33+
<div class="flex-cell flex-cell-l" style="flex: 1">
3434
<div class="chart-wrapper">
3535
<h3 class="chart-title">现存确诊数排行前 10 位的国家</h3>
3636
<div class="chart-div" id="rankChart">
3737
<div class="chart-loader"><div class="loader"></div></div>
3838
</div>
3939
</div>
4040
</div>
41-
<div class="flex-cell flex-cell-c" style="padding-right:0;">
42-
<div class="chart-wrapper">
43-
<h3 class="chart-title">国内外统计数据</h3>
44-
<div class="chart-div chart-done">
45-
<table class="data-t">
46-
<tr>
47-
<th><img src="img/icon-01.png" /></th>
48-
<td>
49-
<p>较昨日 <span id="internationalCurrentConfirmedIncr">0</span></p>
50-
<p><span id="internationalCurrentConfirmedCount">0</span></p>
51-
<p>国外现存确诊</p>
52-
</td>
53-
<th><img src="img/icon-02.png" /></th>
54-
<td>
55-
<p>较昨日 <span id="domesticCurrentConfirmedIncr">0</span></p>
56-
<p><span id="domesticCurrentConfirmedCount">0</span></p>
57-
<p>中国现存确诊</p>
58-
</td>
59-
</tr>
60-
<tr>
61-
<th><img src="img/icon-03.png" /></th>
62-
<td>
63-
<p>较昨日 <span id="internationalConfirmedIncr">0</span></p>
64-
<p><span id="internationalConfirmedCount">0</span></p>
65-
<p>国外累计确诊</p>
66-
</td>
67-
<th><img src="img/icon-04.png" /></th>
68-
<td>
69-
<p>较昨日 <span id="domesticConfirmedIncr">0</span></p>
70-
<p><span id="domesticConfirmedCount">0</span></p>
71-
<p>中国累计确诊</p>
72-
</td>
73-
</tr>
74-
<tr>
75-
<th><img src="img/icon-05.png" /></th>
76-
<td>
77-
<p>较昨日 <span id="internationalDeadIncr">0</span></p>
78-
<p><span id="internationalDeadCount">0</span></p>
79-
<p>国外死亡人数</p>
80-
</td>
81-
<th><img src="img/icon-06.png" /></th>
82-
<td>
83-
<p>较昨日 <span id="domesticDeadIncr">0</span></p>
84-
<p><span id="domesticDeadCount">0</span></p>
85-
<p>中国死亡人数</p>
86-
</td>
87-
</tr>
88-
</table>
89-
</div>
90-
</div>
91-
</div>
9241
<div class="flex-cell flex-cell-r" style="padding-left:0;">
9342
<div class="chart-wrapper">
9443
<h3 class="chart-title">国内各省、自治区、直辖市疫情</h3>
@@ -98,24 +47,6 @@ <h3 class="chart-title">国内各省、自治区、直辖市疫情</h3>
9847
</div>
9948
</div>
10049
</div>
101-
<div class="flex-row">
102-
<div class="flex-cell flex-cell-lc" style="padding-bottom:0;">
103-
<div class="chart-wrapper">
104-
<h3 class="chart-title">美国疫情趋势图</h3>
105-
<div class="chart-div" id="trendChart">
106-
<div class="chart-loader"><div class="loader"></div></div>
107-
</div>
108-
</div>
109-
</div>
110-
<div class="flex-cell flex-cell-r" style="padding-bottom:0;">
111-
<div class="chart-wrapper">
112-
<h3 class="chart-title">各国累计确诊占比</h3>
113-
<div class="chart-div" id="countrysChart">
114-
<div class="chart-loader"><div class="loader"></div></div>
115-
</div>
116-
</div>
117-
</div>
118-
</div>
11950
</div>
12051
</div>
12152

django_covid19/admin.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,18 @@ class CountryAdmin(BaseAdmin):
9292
search_fields = (
9393
'continents', 'countryFullName', 'countryCode', 'countryName'
9494
)
95+
96+
97+
@admin.register(models.CountryCode)
98+
class CountryCodeAdmin(BaseAdmin):
99+
100+
list_display = (
101+
'numericCode', 'countryCode', 'shortCountryCode', 'countryName',
102+
'englishCountryName', 'englishCountryFullName', 'comment'
103+
)
104+
search_fields = (
105+
'numericCode', 'countryCode', 'shortCountryCode', 'countryName',
106+
'englishCountryName', 'englishCountryFullName', 'comment'
107+
)
108+
109+

django_covid19/data/CountryRegionCodes.csv renamed to django_covid19/data/CountryCodes.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
serialNumber,countryName,englishCountryName,englishFullName,shortCountryCode,countryCode,numericCode,comment
1+
serialNumber,countryName,englishCountryName,englishCountryFullName,shortCountryCode,countryCode,numericCode,comment
22
1,阿富汗,Afghanistan,the Islamic Republic of Afghanistan,AF,AFG,4,
33
2,奥兰群岛,Aland Islands,,AX,ALA,248,ISO 3166-1:2006新增
44
3,阿尔巴尼亚,Albania,the Republic of Albania,AL,ALB,8,

0 commit comments

Comments
 (0)