File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.Region/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 <span class =" @ClearClassString" @onclick =" OnClearValue" ><i class =" @ClearIcon" ></i ></span >
1717 }
1818 <div class =" dropdown-menu" >
19- @foreach( var item in GetProvinces ())
19+ @foreach ( var item in GetProvinces ())
2020 {
21- <div class =" bb-region-city-item" >@item </div >
22- <ul >
23- @foreach ( var city in GetCities (item ))
24- {
25- <li class =" " >@city </li >
26- }
27- </ul >
21+ <div class =" bb-region-city-item" >
22+ <div class =" bb-region-city-title" >@item </div >
23+ <ul >
24+ @foreach ( var city in GetCities (item ))
25+ {
26+ <li class =" " >@city </li >
27+ }
28+ </ul >
29+ </div >
2830 }
2931 </div >
3032</div >
Original file line number Diff line number Diff line change @@ -26,7 +26,65 @@ private async Task OnClearValue()
2626 }
2727 }
2828
29- private HashSet < string > GetProvinces ( ) => RegionService . GetProvinces ( ) ;
29+ private static HashSet < string > GetProvinces ( )
30+ {
31+ return
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+ private HashSet < string > GetCities ( string proviceName )
67+ {
68+ if ( proviceName == "直辖市" )
69+ {
70+ return
71+ [
72+ "北京市" ,
73+ "天津市" ,
74+ "上海市" ,
75+ "重庆市"
76+ ] ;
77+ }
3078
31- private HashSet < string > GetCities ( string proviceName ) => RegionService . GetCities ( proviceName ) ;
79+ if ( proviceName == "特别行政区" )
80+ {
81+ return
82+ [
83+ "香港特别行政区" ,
84+ "澳门特别行政区"
85+ ] ;
86+ }
87+
88+ return RegionService . GetCities ( proviceName ) ;
89+ }
3290}
Original file line number Diff line number Diff line change 3434 color : # 000 ;
3535 }
3636
37- .bb-region-city-item {
37+ .bb-region-city-item : not (: last-child ) {
38+ margin-bottom : 3px ;
39+ padding-bottom : 3px ;
40+ border-bottom : 1px solid var (--bs-border-color );
41+ }
42+
43+ .bb-region-city-title {
3844 padding : 3px 12px ;
39- color : # ddd ;
45+ color : # 000 ;
46+ font-weight : bold;
4047}
You can’t perform that action at this time.
0 commit comments