开发区省市区改为下拉框
This commit is contained in:
+4
-4
@@ -125,7 +125,7 @@ public class DevelopmentZoneController {
|
||||
entity.setNameEn(StringUtils.isBlank(model.getNameEn()) ? "" : model.getNameEn());
|
||||
entity.setType(StringUtils.isBlank(model.getType()) ? "" : model.getType());
|
||||
entity.setUrl(StringUtils.isBlank(model.getUrl()) ? "" : model.getUrl());
|
||||
entity.setCityName(StringUtils.isBlank(model.getCityName()) ? "" : model.getCityName());
|
||||
entity.setCityName1(StringUtils.isBlank(model.getCityName1()) ? "" : model.getCityName1());
|
||||
entity.setDistrict(StringUtils.isBlank(model.getDistrict()) ? "" : model.getDistrict());
|
||||
//记录操作人员
|
||||
entity.setOperator(user.getRealName());
|
||||
@@ -198,8 +198,8 @@ public class DevelopmentZoneController {
|
||||
if (StringUtils.isNotBlank(model.getUrl())) {
|
||||
udata.put("url", model.getUrl());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getCityName())) {
|
||||
udata.put("cityName", model.getCityName());
|
||||
if (StringUtils.isNotBlank(model.getCityName1())) {
|
||||
udata.put("city", model.getCityName1());
|
||||
}
|
||||
if (StringUtils.isNotBlank(model.getDistrict())){
|
||||
udata.put("district", model.getDistrict());
|
||||
@@ -230,7 +230,7 @@ public class DevelopmentZoneController {
|
||||
|
||||
public JsonModel districtsAction(DevelopmentZoneModel model) {
|
||||
JsonModel jsonModel = new JsonModel();
|
||||
List<String> districts = developmentZoneService.findDistricts(model.getCityName());
|
||||
List<String> districts = developmentZoneService.findDistricts(model.getCityName1());
|
||||
jsonModel.setJsonModel(districts);
|
||||
return jsonModel;
|
||||
}
|
||||
|
||||
+10
@@ -33,6 +33,8 @@ public class DevelopmentZoneModel extends BaseModel {
|
||||
private DevelopmentZone developmentZone;
|
||||
private List<DevelopmentZone> developmentZoneList;
|
||||
|
||||
private String cityName1;
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
}
|
||||
@@ -184,4 +186,12 @@ public class DevelopmentZoneModel extends BaseModel {
|
||||
public void setDevelopmentZoneList(List<DevelopmentZone> developmentZoneList) {
|
||||
this.developmentZoneList = developmentZoneList;
|
||||
}
|
||||
|
||||
public String getCityName1() {
|
||||
return cityName1;
|
||||
}
|
||||
|
||||
public void setCityName1(String cityName1) {
|
||||
this.cityName1 = cityName1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
@@ -26,7 +25,11 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<@d_city defaultValue="" callback="changeCity" callbackField="display" name="cityDisplay" />
|
||||
<#if developmentZone??>
|
||||
<@d_city defaultValue="${developmentZone.cityName1!}" callback="changeCity" callbackField="display" name="cityDisplay" />
|
||||
<#else>
|
||||
<@d_city defaultValue="上海" callback="changeCity" callbackField="display" name="cityDisplay" />
|
||||
</#if>
|
||||
</td>
|
||||
<td>
|
||||
<label for="province">所在省份:</label>
|
||||
@@ -38,40 +41,27 @@
|
||||
</#if>
|
||||
</select>
|
||||
|
||||
<label for="cityName">城市:</label>
|
||||
<select id="cityName" name="cityName" onchange="updateDistrict()">
|
||||
<label for="cityName1">城市:</label>
|
||||
<select id="cityName1" name="cityName1" onchange="updateDistrict()">
|
||||
<!-- Options for cities will be populated by JavaScript -->
|
||||
</select>
|
||||
<label for="district">区域:</label>
|
||||
<select id="district" name="district">
|
||||
<!-- Options for districts will be populated by JavaScript -->
|
||||
</select>
|
||||
<label for="name">开发区名称:</label> <input id="name" name="name" type="text"
|
||||
placeholder="必填"
|
||||
value="<#if developmentZone??>${developmentZone.name!}</#if>"/>
|
||||
<label for="name">开发区名称:</label> <input id="name" name="name" type="text" placeholder="必填" value="<#if developmentZone??>${developmentZone.name!}</#if>"/>
|
||||
<label for="alias">别名:</label>
|
||||
<input id="alias" name="alias" type="text" placeholder="多个别名用,隔开"
|
||||
value="<#if developmentZone??><#list (developmentZone.alias)! as alia>${alia + ','}</#list><#else></#if>"/>
|
||||
<label for="nameEn">开发区名称拼音:</label> <input id="nameEn" name="nameEn" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.nameEn!}</#if>"/>
|
||||
<input id="alias" name="alias" type="text" placeholder="多个别名用,隔开" value="<#if developmentZone??><#list (developmentZone.alias)! as alia>${alia + ','}</#list><#else></#if>"/>
|
||||
<label for="nameEn">开发区名称拼音:</label> <input id="nameEn" name="nameEn" type="text" value="<#if developmentZone??>${developmentZone.nameEn!}</#if>"/>
|
||||
</br>
|
||||
<label for="level">级别:</label> <input id="level" name="level" type="text"
|
||||
placeholder="必填"
|
||||
value="<#if developmentZone??>${developmentZone.level!}</#if>"/>
|
||||
<label for="address">地址:</label> <input id="address" name="address" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.address!}</#if>"/><br>
|
||||
<label for="area">所在地区:</label> <input id="area" name="area" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.area!}</#if>"/>
|
||||
<label for="buildDate">建立年代:</label><input id="buildDate" name="buildDate" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.buildDate!}</#if>"/>
|
||||
<label for="type">类型:</label><input id="type" name="type" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.type!}</#if>"/>
|
||||
<label for="url">URL:</label><input id="url" name="url" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.url!}</#if>"/><br>
|
||||
<label for="industry">主导产业:</label><input id="industry" name="industry" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.industry!}</#if>"/>
|
||||
<label for="block">区块:</label><input id="block" name="block" type="text"
|
||||
value="<#if developmentZone??>${developmentZone.block!}</#if>"/><br/>
|
||||
<label for="level">级别:</label> <input id="level" name="level" type="text" placeholder="必填" value="<#if developmentZone??>${developmentZone.level!}</#if>"/>
|
||||
<label for="address">地址:</label> <input id="address" name="address" type="text" value="<#if developmentZone??>${developmentZone.address!}</#if>"/><br>
|
||||
<label for="area">所在地区:</label> <input id="area" name="area" type="text" value="<#if developmentZone??>${developmentZone.area!}</#if>"/>
|
||||
<label for="buildDate">建立年代:</label><input id="buildDate" name="buildDate" type="text" value="<#if developmentZone??>${developmentZone.buildDate!}</#if>"/>
|
||||
<label for="type">类型:</label><input id="type" name="type" type="text" value="<#if developmentZone??>${developmentZone.type!}</#if>"/>
|
||||
<label for="url">URL:</label><input id="url" name="url" type="text" value="<#if developmentZone??>${developmentZone.url!}</#if>"/><br>
|
||||
<label for="industry">主导产业:</label><input id="industry" name="industry" type="text" value="<#if developmentZone??>${developmentZone.industry!}</#if>"/>
|
||||
<label for="block">区块:</label><input id="block" name="block" type="text" value="<#if developmentZone??>${developmentZone.block!}</#if>"/><br/>
|
||||
<input id="saveOrUpdate" type="button" value="提交"/>
|
||||
</td>
|
||||
|
||||
@@ -95,7 +85,7 @@
|
||||
updateCityAndDistrict();
|
||||
});
|
||||
|
||||
$('#cityName').change(function () {
|
||||
$('#cityName1').change(function() {
|
||||
updateDistrict();
|
||||
});
|
||||
});
|
||||
@@ -121,7 +111,7 @@
|
||||
|
||||
function updateCityAndDistrict() {
|
||||
let province = $('#province').val();
|
||||
let citySelect = $('#cityName');
|
||||
let citySelect = $('#cityName1');
|
||||
let districtSelect = $('#district');
|
||||
|
||||
citySelect.empty();
|
||||
@@ -148,17 +138,17 @@
|
||||
}
|
||||
|
||||
function updateDistrict() {
|
||||
let cityName = $('#cityName').val();
|
||||
let cityName1 = $('#cityName1').val();
|
||||
let districtSelect = $('#district');
|
||||
|
||||
districtSelect.empty();
|
||||
districtSelect.append('<option value="">请选择区域</option>');
|
||||
|
||||
if (cityName) {
|
||||
if (cityName1) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '../developmentZone/districts',
|
||||
data: {cityName: cityName},
|
||||
data: { cityName1: cityName1 },
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
$.each(data, function(index, district) {
|
||||
@@ -174,15 +164,12 @@
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript"
|
||||
src="https://api.map.baidu.com/api?v=2.0&ak=3E63A744012f88c9a73a2f051aece58b"></script>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=3E63A744012f88c9a73a2f051aece58b"></script>
|
||||
<!--加载鼠标绘制工具-->
|
||||
<script type="text/javascript"
|
||||
src="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
|
||||
<link rel="stylesheet" href="https://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css" />
|
||||
<!--加载检索信息窗口-->
|
||||
<script type="text/javascript"
|
||||
src="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
|
||||
<script type="text/javascript" src="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
|
||||
<link rel="stylesheet" href="https://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.css" />
|
||||
|
||||
<script type="application/javascript">
|
||||
@@ -239,7 +226,6 @@
|
||||
});
|
||||
//添加鼠标绘制工具监听事件,用于获取绘制结果
|
||||
drawingManager.addEventListener('overlaycomplete', overlaycomplete);
|
||||
|
||||
function clearAll() {
|
||||
for(var i = 0; i < overlays.length; i++){
|
||||
map.removeOverlay(overlays[i]);
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
<td>${it.level!}</td>
|
||||
<td>${it.province!}</td>
|
||||
<td>${it.cityName!}</td>
|
||||
<td>${it.cityName1!}</td>
|
||||
<td>${it.district!}</td>
|
||||
<td>${it.block!}</td>
|
||||
<td>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>城市</td>
|
||||
<td>${developmentZone.cityName!}</td>
|
||||
<td>${developmentZone.cityName1!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>区域</td>
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DevelopmentZone implements MongoEntity {
|
||||
|
||||
private String block;
|
||||
private String operator;
|
||||
private String cityName;
|
||||
private String cityName1;
|
||||
private String district;
|
||||
|
||||
//增加别名字段
|
||||
@@ -186,15 +186,19 @@ public class DevelopmentZone implements MongoEntity {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
|
||||
@Column(name = "city")
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
public String getCityName1() {
|
||||
return cityName1;
|
||||
}
|
||||
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
public void setCityName1(String cityName1) {
|
||||
this.cityName1 = cityName1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Column(name = "district")
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
|
||||
Reference in New Issue
Block a user