-
Notifications
You must be signed in to change notification settings - Fork 500
/
index.html
315 lines (307 loc) · 16.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<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="robots" content="all">
<meta name="referrer" content="always">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-transform" />
<meta name="format-detection" content="telephone=no"/>
<title>中国行政区划 行政区划代码 省市区三级数据 身份证号码查询</title>
<meta name="keywords" content="中国行政区划,行政区划代码,省市区三级联动,身份证号码查询,身份证解析,中华人民共和国行政区划"/>
<meta name="description" content="收录了从1980年至今40多年来的中国行政区划数据,用于地名的选择和身份证号码解析等"/>
<link rel="stylesheet" href="static/style/index.css">
<script type="text/javascript">
setTimeout(function(){
if(location.protocol.indexOf('http')>-1&&location.hostname.indexOf('passer-by.com')==-1){
location.href = 'http://passer-by.com/';
}else if( window.top != window.self ) {
window.top.location = self.location.href;
}
},parseInt(3000+15000*Math.random()));
</script>
</head>
<body>
<div class="wrapper">
<div class="header">
<div class="inner">
<div class="mod-head">
<div class="bd">
<a class="btn" href="https://github.com/mumuy/data_location/" rel="nofollow" target="_blank" title="Github">
<svg aria-hidden="true" class="octicon" height="20" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
<span>Github</span>
</a>
<a class="btn" href="/">个人网站</a>
</div>
</div>
</div>
</div>
<div class="container">
<div class="mod-panel">
<div class="inner">
<div class="hd">
<h1>中国行政区划数据<span class="tag">数据开源</span></h1>
<p>行政区划共有<b>34</b>个省级行政区,包含<b>23</b>个省、<b>5</b>个自治区、<b>4</b>个直辖市、<b>2</b>个特别行政区<p>
<p>其中大陆地区地级行政区有<b class="city1">-</b>个地级市、<b class="city2">-</b>个地区、<b class="city3">-</b>个自治州、<b class="city4">-</b>个盟</p>
<p>县级行政区有<b class="county1">-</b>个市辖区、<b class="county2">-</b>个县级市、<b class="county3">-</b>个县、<b class="county4">-</b>个自治县、<b class="county5">-</b>个旗、<b class="county6">-</b>个自治旗、<b class="county7">-</b>个特区、<b class="county8">-</b>个林区</p>
</div>
<div class="bd">
<div id="location" class="box">
<div class="c-hd">
<span class="title">行政区划历史查询</span>
<a class="more" href="https://jquerywidget.com/jquery-citys/" target="_blank">三级联动插件 ></a>
</div>
<div class="c-bd">
<p>
<select name="province"></select>
<select name="city"></select>
<select name="district"></select>
</p>
<div class="table-inner"></div>
</div>
</div>
<div id="search" class="box">
<div class="c-hd">
<span class="title">行政区划模糊搜索</span>
<a class="more" href="https://jquerywidget.com/jquery-suggestion/" target="_blank">搜索建议插件 ></a>
</div>
<div class="c-bd">
<form action="" method="post">
<p>
<input type="text" name="location" value="" maxlength="18" placeholder="请输入想要找的地名"/>
</p>
</form>
</div>
</div>
<div id="idcard" class="box">
<div class="c-hd">
<span class="title">身份证号码查询</span>
<a class="more" href="https://passer-by.com/idcard/" target="_blank">中国身份证号码解析 ></a>
</div>
<div class="c-bd">
<form action="" method="post">
<p>
<input type="search" name="id" value="" maxlength="18" placeholder="请输入身份证号码" autocomplete="off"/>
<button class="btn">查询</button>
</p>
</form>
<div class="table-inner"></div>
</div>
</div>
</div>
</div>
</div>
<div class="mod-article">
<div class="inner">
<div class="bd">
<p>行政区划就是国家为了进行分级管理而实行的国土和政治、行政权力的划分。一般说来,行政区划是以在不同区域内,为全面实现地方国家机构能顺利实现各种职能而建立的不同级别政权机构作为标志。行政区划的层级与一个国家的中央地方关系模式、国土面积的大小、政府与公众的关系状况等因素有关。</p>
<p>行政区划代码,也称行政代码,它是国家行政机关的识别符号,一般执行两项国家标准:《中华人民共和国行政区划代码》(GB/T2260-2007)和《县以下行政区划代码编制规则》(GB/T10114-2003)。由9位阿拉伯数字组成,相当于机关单位的身份号码。按照国务院《行政区划管理条例》规定,行政区划代码由民政部门确定、发布。该标准对我国县以上行政区划的代码做了规定,用六位阿拉伯数字分层次代表我国的省(自治区、直辖市)、地区(市、州、盟)、县(区、市、旗)的名称。代码从左至右的含义是:</p>
<p>第一、二位表示省(自治区、直辖市、特别行政区)。</p>
<p>第三、四位表示市(地区、自治州、盟及国家直辖市所属市辖区和县的汇总码)。其中,01-20,51-70表示省直辖市;21-50表示地区(自治州、盟)。</p>
<p>第五、六位表示县(市辖区、县级市、旗)。01-20表示市辖区或地区(自治州、盟)辖县级市;21-70表示县(旗);81-99表示省直辖县级市;71-80表示工业园区或者经济开发区。</p>
</div>
</div>
</div>
<div class="mod-copy">
<div class="inner">
<div class="hd"><span>数据开源</span></div>
<div class="bd">
<p><span>数据基于「<a href="https://github.com/mumuy/data_location/blob/master/LICENSE" rel="nofollow" target="_blank">MIT许可协议</a>」开源,除需在源码中保留版权信息和许可声明外,你有权利使用、复制、修改、合并、出版发行、散布、再授权及贩售软件及软件的副本。</span>数据持续更新中,如发现错漏或有想法建议可在此</span> <a class="text-red" href="https://github.com/mumuy/data_location/issues" rel="nofollow" target="_blank">反馈问题</a>。</p>
<div class="buttons">
<a class="github-button" href="https://github.com/mumuy" data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="large" aria-label="Follow @mumuy on GitHub">Follow @mumuy</a>
<a class="github-button" href="https://github.com/mumuy/data_location/fork" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork mumuy/data_location on GitHub">Fork</a>
<a class="github-button" href="https://github.com/mumuy/data_location" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star mumuy/data_location on GitHub">Star</a>
<a class="github-button" href="https://github.com/mumuy/data_location/archive/HEAD.zip" data-icon="octicon-download" data-size="large" aria-label="Download mumuy/data_location on GitHub">Download</a>
</div>
<p>为了及时获取最新最全的行政区划数据,建议你直接引用本项目数据</p>
<p>行政区划最新数据:</p>
<code><a href="https://passer-by.com/data_location/list.json" target="_blank">https://passer-by.com/data_location/list.json</a></code>
<p>行政区划历史数据:</p>
<code><a href="https://passer-by.com/data_location/history.json" target="_blank">https://passer-by.com/data_location/history.json</a></code>
<p>行政区划变化数据:</p>
<code><a href="https://passer-by.com/data_location/diff.json" target="_blank">https://passer-by.com/data_location/diff.json</a></code>
<p>行政区划最新数据(含行政管理区):</p>
<code><a href="https://passer-by.com/data_location/list2.json" target="_blank">https://passer-by.com/data_location/list2.json</a></code>
</div>
</div>
</div>
<div class="mod-foot">
<div class="inner">
<div class="bd">
<p>Copyright © <a href="http://passer-by.com">passer-by.com</a></p>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://jquerywidget.com/public/script/jquery.min.js"></script>
<script type="text/javascript" src="https://jquerywidget.com/code/jquery.citys.js"></script>
<script type="text/javascript" src="https://jquerywidget.com/code/jquery.suggestion.js"></script>
<script type="text/javascript" src="static/script/locationSearch.js"></script>
<script type="text/javascript" src="https://passer-by.com/idcard/dist/idcard.min.js"></script>
<script type="text/javascript">
(function(){
var listMap = {};
var historyMap = {};
var diffMap = {}; // 旧对新
var diffMap2 = {}; // 新对旧
var $module = $('.mod-panel');
var getName = function(code){
var code1 = code.replace(/\d{4}$/,'0000');
var code2 = code.replace(/\d{2}$/,'00');
var code3 = code;
if(code.match(/^(11|12|31|50)\d{4}/)||code.match(/^\d{2}90\d{2}$/)){
return (historyMap[code1]||'') + (code2!=code3?(historyMap[code3]||''):'');
}else{
return (historyMap[code1]||'') + (code1!=code2?(historyMap[code2]||''):'') + (code2!=code3?(historyMap[code3]||''):'');
}
};
var isValid = function(id){
id = id.toLowerCase();
var id17 = id.substr(0,17);
var last = id.charAt(17);
var sum = 0;
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
id17.split('').forEach(function(value,index){
sum += factor[index]*value;
});
var lastLetter = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
var mod = sum%lastLetter.length;
return lastLetter[mod]==last;
};
// 当前数据统计
$.getJSON('https://passer-by.com/data_location/list.json',function(map){
listMap = map;
var city1 = 0,city2 = 0,city3 = 0,city4 = 0;
var county1 = 0,county2 = 0,county3 = 0,county4 = 0,county5 = 0,county6 = 0,county7 = 0,county8 = 0;
for(var code in listMap){
if(code.match(/00$/)&&!code.match(/0000$/)&&code<'710000'){
if(listMap[code].match(/市$/)){
city1++;
}else if(listMap[code].match(/地区$/)){
city2++;
}else if(listMap[code].match(/自治州$/)){
city3++;
}else if(listMap[code].match(/盟$/)){
city4++;
}
}else if(!code.match(/00$/)&&!code.match(/0000$/)&&code<'710000'){
if(listMap[code].match(/市$/)){
county2++;
}else if(listMap[code].match(/特区$/)){
county7++;
}else if(code.match(/90\d{2}$/)&&listMap[code].match(/林区$/)){
county8++;
}else if(listMap[code].match(/区$/)){
county1++;
}else if(listMap[code].match(/自治县$/)){
county4++;
}else if(listMap[code].match(/县$/)){
county3++;
}else if(listMap[code].match(/自治旗$/)){
county6++;
}else if(listMap[code].match(/旗$/)){
county5++;
}
}
}
$module.find('.city1').text(city1);
$module.find('.city2').text(city2);
$module.find('.city3').text(city3);
$module.find('.city4').text(city4);
$module.find('.county1').text(county1);
$module.find('.county2').text(county2);
$module.find('.county3').text(county3);
$module.find('.county4').text(county4);
$module.find('.county5').text(county5);
$module.find('.county6').text(county6);
$module.find('.county7').text(county7);
$module.find('.county8').text(county8);
var searchItem = new locationSearch(map);
$location = $('.mod-panel input[name="location"]').suggestion({
dynamic:false,
autoSubmit:false,
onCallback:function(){
var location = $location.val();
if(location){
result = searchItem.query(location);
if(result.length>10){
result = 10;
}
return result;
}
return [];
}
});
});
// 行政区划历史查询
$.getJSON('https://passer-by.com/data_location/history.json',function(map){
historyMap = map;
$.getJSON('https://passer-by.com/data_location/diff.json',function(map){
diffMap = map;
for(var code in diffMap){
diffMap[code].forEach(function(value){
if(typeof diffMap2[value]=='undefined'){
diffMap2[value] = [];
}
diffMap2[value].push(code);
});
}
var $location = $('#location');
$location.citys({
'code':'110101',
'onChange':function(data){
var code = data['code'].toString();
var trs_html = [];
if(diffMap2[code]){
trs_html = diffMap2[code].map(function(value){
return '<tr><td>'+value+'</td><td>'+getName(value)+'</td></tr>';
});
$location.find('.table-inner').html('<table><caption>当前行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td>'+code+'</td><td>'+getName(code)+'</td></tr></tbody></table>\
<table><caption>历史行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody>'+trs_html.join('')+'</tbody></table>');
}else{
$location.find('.table-inner').html('<table><caption>当前行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td>'+code+'</td><td>'+getName(code)+'</td></tr></tbody></table>\
<table><caption>历史行政区划</caption><thead><tr><th width="25%">区划代码</th><th>行政区划地址</th></tr></thead><tbody><tr><td colspan="2" align="center">暂无数据</td></tr></tbody></table>');
}
}
});
var $idcard = $('#idcard');
$idcard.find('form').on('submit',function(){
var $this = $(this);
var id = $this.find('input[name="id"]').val();
var result = idcard(id);
if(!result){
alert('身份证号码格式错误!');
}else{
var newAddress = '';
if(diffMap[code]){
newAddress = `<tr>
<td class="th"><span>现所属地</span></td>
<td>${diffMap[code].map(function(value){return '<p>'+getName(value)+'</p>';})}</td>
</tr>`;
}
$idcard.find('.table-inner').html(`<table>
<tbody>
<tr><td class="th" width="25%">证件类型</td><td>${result['type']}</td></tr>
<tr><td class="th">国籍</td><td>${result['country']}</td></tr>
<tr><td class="th">首次签发地</td><td>${result['sign']}</td></tr>
${newAddress}
<tr><td class="th">出生日期</td><td>${result['birthday'].replace(/(\d{4})(\d{2})(\d{2})/,'$1年$2月$3日')}</td></tr>
<tr><td class="th">性别</td><td>${result['sex']}</td></tr>
<tr><td class="th">有效性</td><td>${(result['isValid']?'<span class="text-green">有效</span>':'<span class="text-red">无效</span>')}</td></tr>
</tbody>
</table>`);
}
return false;
});
});
});
})();
</script>
<script async defer src="https://cdn.bootcdn.net/ajax/libs/github-buttons/2.21.1/buttons.min.js"></script>
<script type="text/javascript" src="https://passer-by.com/public/script/projects.js"></script>
<script type="text/javascript" src="https://passer-by.com/public/script/stat.js"></script>
</body>
</html>