|
|
@ -65,7 +65,7 @@ |
|
|
|
:precision="2" |
|
|
|
:step="0.01" |
|
|
|
:min="0" |
|
|
|
:max="9999" |
|
|
|
:max="9600000" |
|
|
|
label="占地面积"></el-input-number>平方公里 |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="容纳人数" |
|
|
@ -82,51 +82,18 @@ |
|
|
|
prop="address" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
maxlength="50" |
|
|
|
show-word-limit |
|
|
|
placeholder="请输入地址名称" |
|
|
|
<div class="item_width_1"> |
|
|
|
<el-input |
|
|
|
style="width:420px" |
|
|
|
:placeholder="'请输入所在地址'" |
|
|
|
v-model="formData.address"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="位置坐标" |
|
|
|
prop="longitude" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<div style="width:500px"> |
|
|
|
|
|
|
|
<div class="div_map"> |
|
|
|
<div id="app"> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="div_searchmap"> |
|
|
|
<el-input class="item_width_4" |
|
|
|
maxlength="50" |
|
|
|
size="mini" |
|
|
|
placeholder="请输入关键字" |
|
|
|
v-model="keyWords"> |
|
|
|
</el-input> |
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
type="primary" |
|
|
|
size="mini" |
|
|
|
@click="handleSearchMap">查询</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<span>经度</span> |
|
|
|
<el-input class="item_width_3" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入经度" |
|
|
|
v-model="formData.longitude"> |
|
|
|
</el-input> |
|
|
|
<span style="margin-left: 20px">纬度</span> |
|
|
|
<el-input class="item_width_3" |
|
|
|
maxlength="50" |
|
|
|
placeholder="请输入纬度" |
|
|
|
v-model="formData.latitude"> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
</el-input> |
|
|
|
<el-button |
|
|
|
style="margin-left: 10px" |
|
|
|
type="default" |
|
|
|
size="small" |
|
|
|
@click="handleSearchMap">查询</el-button> |
|
|
|
<div id="app" class="div_map"></div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
@ -201,7 +168,7 @@ export default { |
|
|
|
this.formData.icCityManagementId = icCityManagementId |
|
|
|
await this.loadFormData() |
|
|
|
} else { |
|
|
|
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|
|
|
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|
|
|
this.setMarker(36.0722275, 120.38945519) |
|
|
|
} |
|
|
|
|
|
|
@ -242,8 +209,9 @@ export default { |
|
|
|
data : this.cityManagement |
|
|
|
} |
|
|
|
this.formData = { ...data } |
|
|
|
const lat = this.formData.latitude === null || this.formData.latitude === '' ? '' : this.formData.latitude; |
|
|
|
const lon = this.formData.longitude === null || this.formData.longitude === '' ? '' : this.formData.longitude; |
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
const lat = this.formData.latitude === null || this.formData.latitude === '' ? latitude : this.formData.latitude; |
|
|
|
const lon = this.formData.longitude === null || this.formData.longitude === '' ? longitude : this.formData.longitude; |
|
|
|
map.setCenter(new TMap.LatLng(lat,lon)) |
|
|
|
this.setMarker(lat,lon) |
|
|
|
} else { |
|
|
@ -302,7 +270,15 @@ export default { |
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap () { |
|
|
|
// 定义地图中心点坐标 |
|
|
|
var center = new window.TMap.LatLng(36.52799, 120.7553) |
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
console.log('lat'+latitude+',lon'+longitude) |
|
|
|
if (!latitude || latitude == "" || latitude == "0") { |
|
|
|
latitude = 39.9088810666821; |
|
|
|
longitude = 116.39743841556731; |
|
|
|
} |
|
|
|
// 定义地图中心点坐标 |
|
|
|
var center = new window.TMap.LatLng(latitude, longitude); |
|
|
|
// var center = new window.TMap.LatLng(36.52799, 120.7553) |
|
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
|
map = new window.TMap.Map(document.getElementById('app'), { |
|
|
|
center: center, // 设置地图中心点坐标 |
|
|
@ -352,7 +328,7 @@ export default { |
|
|
|
// 在地图显示范围内以给定的关键字搜索地点 |
|
|
|
search |
|
|
|
.searchRectangle({ |
|
|
|
keyword: this.keyWords, |
|
|
|
keyword: this.formData.address, |
|
|
|
bounds: map.getBounds() |
|
|
|
}) |
|
|
|
.then((result) => { |
|
|
|