Browse Source

Merge branch 'dev-天地图' into dev

dev-用户反馈
jiangyy 3 years ago
parent
commit
492d9cc177
  1. 113
      src/views/modules/base/community/buildDetail.vue
  2. 229
      src/views/modules/base/community/buildForm.vue
  3. 107
      src/views/modules/base/community/communityDetail.vue
  4. 293
      src/views/modules/base/community/communityForm.vue
  5. 2
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  6. 2
      src/views/modules/shequzhili/csgltc/csglForm.vue
  7. 2
      src/views/modules/shequzhili/ggfwtc/ggfwForm.vue

113
src/views/modules/base/community/buildDetail.vue

@ -59,7 +59,7 @@
<span class="info-title-2">地图位置</span> <span class="info-title-2">地图位置</span>
<div class="div_map"> <div class="div_map">
<div id="app_detail"></div> <div id="app_detail_build"></div>
</div> </div>
</div> </div>
@ -80,6 +80,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map var map
var search var search
var markers var markers
@ -131,7 +132,7 @@ export default {
}, },
diaDestroy () { diaDestroy () {
if (map) { if (map) {
map.destroy() // map.destroy()
} }
}, },
async initForm (row, agencyObj) { async initForm (row, agencyObj) {
@ -140,21 +141,8 @@ export default {
this.agencyObj = agencyObj this.agencyObj = agencyObj
this.initLoading = true this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
},
// init
initMap () {
let { latitude, longitude } = this.$store.state.user; let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude) console.log('lat' + latitude + ',lon' + longitude)
if (this.dataForm.latitude && this.dataForm.longitude) { if (this.dataForm.latitude && this.dataForm.longitude) {
latitude = this.dataForm.latitude latitude = this.dataForm.latitude
longitude = this.dataForm.longitude longitude = this.dataForm.longitude
@ -163,84 +151,43 @@ export default {
latitude = 39.9088810666821; latitude = 39.9088810666821;
longitude = 116.39743841556731; longitude = 116.39743841556731;
} }
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 }) this.$nextTick(() => {
// if (!map) {
markers = new TMap.MultiMarker({ this.initMap(latitude, longitude)
map: map, } else {
geometries: [] map.setCenter(latitude, longitude);
}) map.setMarker(latitude, longitude);
infoWindowList = Array(10) }
//
map.on('panend', () => {
this.handleMoveCenter()
}) })
this.handleMoveCenter()
}, },
setMarker (lat, lng) {
markers.setGeometries([]) // init
markers.add([ initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_detail_build"),
{ latitude, longitude },
{ {
id: '4', zoom: 16.2, //
styleId: 'marker', pitch: 43.5, //
position: new TMap.LatLng(lat, lng), rotation: 45, //
properties: {
title: 'marker4'
}
} }
]) );
},
handleSearchMap () { // //
infoWindowList.forEach((infoWindow) => { // map.on("dragend", (e) => {
infoWindow.close() // this.handleMoveCenter(e);
}) // });
infoWindowList.length = 0
markers.setGeometries([]) map.setCenter(latitude, longitude);
// map.setMarker(latitude, longitude);
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng },
address
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.dataForm.coordinatePosition = address
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.setMarker(lat, lng)
}, },
resetData () { resetData () {
this.buildType = '1' this.buildType = '1'

229
src/views/modules/base/community/buildForm.vue

@ -32,12 +32,12 @@
maxlength="50" maxlength="50"
placeholder="请输入楼栋编码" placeholder="请输入楼栋编码"
v-model="dataForm.coding"> v-model="dataForm.coding">
</el-input> </el-input>
<el-button style="margin-left: 10px" <el-button style="margin-left: 10px"
type="primary" type="primary"
size="small" size="small"
@click="handleCode">生成</el-button> @click="handleCode">生成</el-button>
</el-form-item> </el-form-item>
<el-form-item label="楼栋类型" <el-form-item label="楼栋类型"
prop="type" prop="type"
@ -119,39 +119,29 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="位置坐标" <el-form-item label="地图位置"
prop="longitude" prop="longitude"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<div style="width: 500px">
<div style="width:500px"> <el-select v-model="searchValue"
<el-input class="item_width_4" filterable
maxlength="50" style="width: 500px"
placeholder="请输入关键字" remote
v-model="keyWords"> :reserve-keyword="true"
</el-input> placeholder="请输入关键词"
<el-button style="margin-left: 10px" :remote-method="remoteMethod"
type="primary" :loading="loading">
size="small" <el-option v-for="(item,index) in searchOptions"
@click="handleSearchMap">查询</el-button> @click.native="handleClickKey(index)"
<div id="app" :key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div id="app_build"
class="div_map"></div> class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude">
</el-input>
</div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="楼栋地址" <el-form-item label="楼栋地址"
prop="coordinatePosition" prop="coordinatePosition"
@ -160,7 +150,6 @@
<!-- <span>{{ dataForm.coordinatePosition }}</span> --> <!-- <span>{{ dataForm.coordinatePosition }}</span> -->
<el-input class="item_width_1" <el-input class="item_width_1"
placeholder="请选择楼栋地址" placeholder="请选择楼栋地址"
disabled
v-model="dataForm.coordinatePosition" /> v-model="dataForm.coordinatePosition" />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -182,6 +171,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map var map
var search var search
var markers var markers
@ -191,6 +181,11 @@ export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false, btnDisable: false,
buildingId: '', //ID buildingId: '', //ID
buildType: "1", buildType: "1",
@ -204,7 +199,7 @@ export default {
totalUnitNum: 1,// totalUnitNum: 1,//
totalFloorNum: 0,// totalFloorNum: 0,//
totalHouseNum: 0,// totalHouseNum: 0,//
realPerson: 0, realPerson: 0,
buildingLeaderName: '',// buildingLeaderName: '',//
buildingLeaderMobile: '',// buildingLeaderMobile: '',//
type: '',// type: '',//
@ -223,12 +218,13 @@ export default {
}, },
components: {}, components: {},
mounted () { mounted () {
this.initMap()
}, },
methods: { methods: {
async initForm (type, row, agencyObj) { async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
let { latitude, longitude } = this.$store.state.user;
this.agencyObj = agencyObj this.agencyObj = agencyObj
this.dataForm.agencyId = agencyObj.agencyId this.dataForm.agencyId = agencyObj.agencyId
this.dataForm.gridId = agencyObj.gridId this.dataForm.gridId = agencyObj.gridId
@ -241,13 +237,16 @@ export default {
// this.buildType = this.dataForm.buildingTypeKey // this.buildType = this.dataForm.buildingTypeKey
this.buildType = this.dataForm.type this.buildType = this.dataForm.type
map.setCenter(new TMap.LatLng(this.dataForm.latitude, this.dataForm.longitude))
this.setMarker(this.dataForm.latitude, this.dataForm.longitude)
} else { } else {
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude)) this.dataForm.latitude = latitude
this.dataForm.longitude = longitude
}
if (!map) {
this.initMap(this.dataForm.latitude, this.dataForm.longitude);
} else {
map.setCenter(this.dataForm.latitude, this.dataForm.longitude);
map.setMarker(this.dataForm.latitude, this.dataForm.longitude);
} }
}, },
async handleComfirm () { async handleComfirm () {
@ -266,7 +265,7 @@ export default {
}) })
}, },
async handleCode() { async handleCode () {
const { data, code, msg } = await requestPost( const { data, code, msg } = await requestPost(
"/gov/org/houseInformation/getBuildingCoding/" + this.dataForm.neighborHoodId); "/gov/org/houseInformation/getBuildingCoding/" + this.dataForm.neighborHoodId);
console.log('data----', data) console.log('data----', data)
@ -275,8 +274,8 @@ export default {
if (msg == "success" && code == 0) { if (msg == "success" && code == 0) {
this.dataForm.coding = data.coding this.dataForm.coding = data.coding
this.dataForm.sysCoding = data.sysCoding this.dataForm.sysCoding = data.sysCoding
} }
}, },
async addBuild () { async addBuild () {
if (this.dataForm.buildingLeaderMobile) { if (this.dataForm.buildingLeaderMobile) {
@ -324,89 +323,91 @@ export default {
}, },
// init // init
initMap () { initMap (latitude, longitude) {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 }) map = new daiMap(
// document.getElementById("app_build"),
markers = new TMap.MultiMarker({ { latitude, longitude },
map: map, {
geometries: [] zoom: 16.2, //
}) pitch: 43.5, //
infoWindowList = Array(10) rotation: 45, //
}
);
// //
map.on('panend', () => { map.on("dragend", (e) => {
this.handleMoveCenter() this.handleMoveCenter(e);
}) });
this.handleMoveCenter()
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}, },
setMarker (lat, lng) {
markers.setGeometries([]) async handleMoveCenter () {
markers.add([ //
{ const { lat, lng } = map.getCenter();
id: '4', this.dataForm.latitude = lat;
styleId: 'marker', this.dataForm.longitude = lng;
position: new TMap.LatLng(lat, lng), map.setMarker(lat, lng);
properties: {
title: 'marker4' let { msg, data } = await map.getAddress(lat, lng);
} if (msg == "success") {
} this.dataForm.coordinatePosition = data.address
]) this.searchValue = data.address
this.searchOptions = []
}
}, },
handleSearchMap () { async remoteMethod (query) {
infoWindowList.forEach((infoWindow) => {
infoWindow.close() if (query !== '') {
}) this.loading = true;
infoWindowList.length = 0
markers.setGeometries([]) const { msg, data } = await map.searchNearby(query);
// this.loading = false;
search this.resultList = []
.searchNearby({
keyword: this.keyWords, if (msg == "success" && data.resultList && data.resultList.length > 0) {
radius: 1000,
autoExtend: true, if (data.resultList && data.resultList.length > 0) {
center: map.getCenter(), this.resultList = data.resultList
}) this.searchOptions = this.resultList.map(item => {
.then((result) => { return { value: `${item.hotPointID}`, label: `${item.address + item.name}` };
let { data } = result
if (Array.isArray(data) && data.length > 0) { });
const {
location: { lat, lng },
address
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.dataForm.coordinatePosition = address
} else {
this.$message.error('未检索到相关位置坐标')
} }
}) } else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else {
this.searchOptions = [];
}
}, },
handleMoveCenter () { handleClickKey (index) {
// let selPosition = this.resultList[index]
const center = map.getCenter() let lonlat = selPosition.lonlat.split(" ")
const lat = center.getLat() map.setCenter(lonlat[1], lonlat[0]);
const lng = center.getLng() map.setMarker(lonlat[1], lonlat[0]);
this.dataForm.latitude = lat this.dataForm.latitude = lonlat[1];
this.dataForm.longitude = lng this.dataForm.longitude = lonlat[0];
this.setMarker(lat, lng) this.dataForm.coordinatePosition = selPosition.address + selPosition.name
}, },
resetData () { resetData () {
this.keyWords = '' this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.buildingId = '' //ID this.buildingId = '' //ID
this.buildType = '1' this.buildType = '1'
this.dataForm = { this.dataForm = {

107
src/views/modules/base/community/communityDetail.vue

@ -52,7 +52,7 @@
<span class="info-title-2">地图位置</span> <span class="info-title-2">地图位置</span>
<div class="div_map"> <div class="div_map">
<div id="app_detail"></div> <div id="app_detail_community"></div>
</div> </div>
</div> </div>
@ -73,6 +73,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map var map
var search var search
var markers var markers
@ -117,7 +118,7 @@ export default {
}, },
diaDestroy () { diaDestroy () {
if (map) { if (map) {
map.destroy() // map.destroy()
} }
}, },
@ -132,19 +133,8 @@ export default {
this.dataForm.propertyShow = propertyShowList.join(',') this.dataForm.propertyShow = propertyShowList.join(',')
this.initLoading = true this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user; let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude) console.log('lat' + latitude + ',lon' + longitude)
if (this.dataForm.latitude && this.dataForm.longitude) { if (this.dataForm.latitude && this.dataForm.longitude) {
latitude = this.dataForm.latitude latitude = this.dataForm.latitude
longitude = this.dataForm.longitude longitude = this.dataForm.longitude
@ -153,81 +143,40 @@ export default {
latitude = 39.9088810666821; latitude = 39.9088810666821;
longitude = 116.39743841556731; longitude = 116.39743841556731;
} }
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 }) this.$nextTick(() => {
// if (!map) {
markers = new TMap.MultiMarker({ this.initMap(latitude, longitude)
map: map, } else {
geometries: [] map.setCenter(latitude, longitude);
}) map.setMarker(latitude, longitude);
infoWindowList = Array(10) }
//
map.on('panend', () => {
this.handleMoveCenter()
}) })
this.handleMoveCenter()
}, },
setMarker (lat, lng) { // init
markers.setGeometries([]) initMap (latitude, longitude) {
markers.add([
map = new daiMap(
document.getElementById("app_detail_community"),
{ latitude, longitude },
{ {
id: '4', zoom: 16.2, //
styleId: 'marker', pitch: 43.5, //
position: new TMap.LatLng(lat, lng), rotation: 45, //
properties: {
title: 'marker4'
}
} }
]) );
},
handleSearchMap () { // //
infoWindowList.forEach((infoWindow) => { // map.on("dragend", (e) => {
infoWindow.close() // this.handleMoveCenter(e);
}) // });
infoWindowList.length = 0
markers.setGeometries([]) map.setCenter(latitude, longitude);
// map.setMarker(latitude, longitude);
search
.searchRectangle({
keyword: this.keyWords,
bounds: map.getBounds()
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.dataForm.latitude = lat
this.dataForm.longitude = lng
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.setMarker(lat, lng)
}, },

293
src/views/modules/base/community/communityForm.vue

@ -42,22 +42,22 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="小区编码" <el-form-item label="小区编码"
prop="coding" prop="coding"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">
<el-input class="item_width_2" <el-input class="item_width_2"
maxlength="50" maxlength="50"
placeholder="请输入楼栋编码" placeholder="请输入楼栋编码"
v-model="dataForm.coding"> v-model="dataForm.coding">
</el-input> </el-input>
<el-button style="margin-left: 10px" <el-button style="margin-left: 10px"
type="primary" type="primary"
size="small" size="small"
@click="handleCode">生成</el-button> @click="handleCode">生成</el-button>
</el-form-item> </el-form-item>
<div v-if="dataForm.qrcodeUrl" <div v-if="dataForm.qrcodeUrl"
style="display: flex;flex-direction: column;"> style="display: flex;flex-direction: column;">
<img style="margin-left: 70px;width: 200px;" <img style="margin-left: 70px;width: 200px;"
:src="dataForm.qrcodeUrl"> :src="dataForm.qrcodeUrl">
@ -87,15 +87,41 @@
@click="handleAddProperty">添加物业</el-button> @click="handleAddProperty">添加物业</el-button>
</el-form-item> </el-form-item>
<el-form-item label="实有楼栋" <el-form-item label="实有楼栋"
style="display: block" style="display: block"
prop="realBuilding" prop="realBuilding"
label-width="150px"> label-width="150px">
<el-input-number class="item_width_4" <el-input-number class="item_width_4"
v-model="dataForm.realBuilding" v-model="dataForm.realBuilding"
:min="0" :min="0"
:max="9999" :max="9999"
label="总户数"></el-input-number> label="总户数"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="地图位置"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width: 500px">
<el-select v-model="searchValue"
filterable
style="width: 500px"
remote
:reserve-keyword="true"
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option v-for="(item,index) in searchOptions"
@click.native="handleClickKey(index)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div id="app_community"
class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="详细地址" <el-form-item label="详细地址"
prop="address" prop="address"
label-width="150px" label-width="150px"
@ -108,39 +134,6 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<el-input class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="keyWords">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
class="div_map"></div>
<div style="margin-top: 10px">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
v-model="dataForm.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
v-model="dataForm.latitude">
</el-input>
</div>
</div>
</el-form-item>
<el-form-item label="备注" <el-form-item label="备注"
prop="remark" prop="remark"
label-width="150px" label-width="150px"
@ -190,6 +183,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request' import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map var map
var search var search
var markers var markers
@ -199,6 +193,11 @@ export default {
data () { data () {
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
gridList: [], gridList: [],
propertyList: [], propertyList: [],
@ -232,121 +231,125 @@ export default {
}, },
components: {}, components: {},
mounted () { mounted () {
this.initMap()
}, },
methods: { methods: {
// init async initForm (type, row, agencyObj) {
initMap () { this.$refs.ref_form.resetFields();
// this.agencyObj = agencyObj
var center = new window.TMap.LatLng(36.0722275, 120.38945519) let { latitude, longitude } = this.$store.state.user;
// map TMap.Map() this.formType = type
map = new window.TMap.Map(document.getElementById('app'), { if (row) {
center: center, // this.dataForm = JSON.parse(JSON.stringify(row))
zoom: 17.2, // this.dataForm.neighborHoodId = this.dataForm.id
pitch: 43.5, // this.neighborHoodId = this.dataForm.neighborHoodId
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
// } else {
map.on('panend', () => { this.dataForm.latitude = latitude
this.handleMoveCenter() this.dataForm.longitude = longitude
}) }
this.handleMoveCenter() if (!map) {
this.initMap(this.dataForm.latitude, this.dataForm.longitude);
} else {
map.setCenter(this.dataForm.latitude, this.dataForm.longitude);
map.setMarker(this.dataForm.latitude, this.dataForm.longitude);
}
await this.loadAgency()
await this.loadGrid()
await this.loadProperty()
}, },
// init
initMap (latitude, longitude) {
setMarker (lat, lng) { map = new daiMap(
markers.setGeometries([]) document.getElementById("app_community"),
markers.add([ { latitude, longitude },
{ {
id: '4', zoom: 16.2, //
styleId: 'marker', pitch: 43.5, //
position: new TMap.LatLng(lat, lng), rotation: 45, //
properties: {
title: 'marker4'
}
} }
]) );
},
//
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchNearby({
keyword: this.keyWords,
radius: 1000,
autoExtend: true,
center: map.getCenter(),
})
.then((result) => {
let { data } = result
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng }
} = data[0]
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
this.dataForm.latitude = lat
this.dataForm.longitude = lng
} else {
this.$message.error('未检索到相关位置坐标')
}
})
}, },
handleMoveCenter () {
async handleMoveCenter () {
// //
const center = map.getCenter() const { lat, lng } = map.getCenter();
const lat = center.getLat() this.dataForm.latitude = lat;
const lng = center.getLng() this.dataForm.longitude = lng;
this.dataForm.latitude = lat map.setMarker(lat, lng);
this.dataForm.longitude = lng
this.setMarker(lat, lng) let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.dataForm.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
}, },
async initForm (type, row, agencyObj) { async remoteMethod (query) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
this.formType = type if (query !== '') {
if (row) { this.loading = true;
this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm.neighborHoodId = this.dataForm.id const { msg, data } = await map.searchNearby(query);
this.neighborHoodId = this.dataForm.neighborHoodId this.loading = false;
map.setCenter(new TMap.LatLng(this.dataForm.latitude, this.dataForm.longitude)) this.resultList = []
this.setMarker(this.dataForm.latitude, this.dataForm.longitude)
if (msg == "success" && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList
this.searchOptions = this.resultList.map(item => {
return { value: `${item.hotPointID}`, label: `${item.address + item.name}` };
});
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
]
}
} else { } else {
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude)) this.searchOptions = [];
} }
},
handleClickKey (index) {
await this.loadAgency() let selPosition = this.resultList[index]
await this.loadGrid() let lonlat = selPosition.lonlat.split(" ")
await this.loadProperty() map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.dataForm.latitude = lonlat[1];
this.dataForm.longitude = lonlat[0];
this.dataForm.address = selPosition.address + selPosition.name
}, },
async handleCode() {
async handleCode () {
if (!this.dataForm.gridId) return this.$message.error('请选择网格') if (!this.dataForm.gridId) return this.$message.error('请选择网格')
const { data, code, msg } = await requestPost( const { data, code, msg } = await requestPost(
"/gov/org/houseInformation/getNeighborHoodCoding/" + this.dataForm.gridId); "/gov/org/houseInformation/getNeighborHoodCoding/" + this.dataForm.gridId);
if (msg == "success" && code == 0) { if (msg == "success" && code == 0) {
this.dataForm.coding = data.coding this.dataForm.coding = data.coding
this.dataForm.sysCoding = data.sysCoding this.dataForm.sysCoding = data.sysCoding
} }
}, },
// //
async loadAgency () { async loadAgency () {
@ -488,7 +491,9 @@ export default {
} }
}, },
resetData () { resetData () {
this.keyWords = '' this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.neighborHoodId = '' //ID this.neighborHoodId = '' //ID
this.dataForm = { this.dataForm = {
neighborHoodName: '', // 50 neighborHoodName: '', // 50

2
src/views/modules/communityService/sqzzz/cpts/edit.vue

@ -153,7 +153,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="所在位置 " <el-form-item label="详细地址 "
prop="address" prop="address"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">

2
src/views/modules/shequzhili/csgltc/csglForm.vue

@ -121,7 +121,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="所在位置 " <el-form-item label="详细地址 "
prop="address" prop="address"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">

2
src/views/modules/shequzhili/ggfwtc/ggfwForm.vue

@ -102,7 +102,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="所在位置 " <el-form-item label="详细地址 "
prop="address" prop="address"
label-width="150px" label-width="150px"
style="display: block"> style="display: block">

Loading…
Cancel
Save