Browse Source

Merge branch 'dev-天地图' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-天地图

V1.0
dai 4 years ago
parent
commit
bd8510d826
  1. 119
      src/views/modules/base/community/buildDetail.vue
  2. 231
      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. 1
      src/views/modules/communityParty/regionalParty/activitysDetail.vue
  6. 57
      src/views/modules/communityParty/regionalParty/activitysForm.vue
  7. 1
      src/views/modules/communityParty/regionalParty/unitsDetail.vue
  8. 57
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  9. 522
      src/views/modules/communityService/sqzzz/cpts/edit.vue
  10. 265
      src/views/modules/partymember/icpartyorg-add-or-update.vue
  11. 5
      src/views/modules/shequzhili/csgltc/csgl.vue
  12. 137
      src/views/modules/shequzhili/csgltc/csglDetail.vue
  13. 246
      src/views/modules/shequzhili/csgltc/csglForm.vue
  14. 219
      src/views/modules/shequzhili/event/cpts/add.vue
  15. 133
      src/views/modules/shequzhili/ggfwtc/ggfwDetail.vue
  16. 246
      src/views/modules/shequzhili/ggfwtc/ggfwForm.vue

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

@ -54,12 +54,12 @@
<span>{{ dataForm.coordinatePosition?dataForm.coordinatePosition:'--' }}</span>
</div>
<div v-if="dataForm.coordinatePosition"
<div v-show="dataForm.coordinatePosition"
class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
<div id="app_detail_build"></div>
</div>
</div>
@ -80,6 +80,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map
var search
var markers
@ -131,7 +132,7 @@ export default {
},
diaDestroy () {
if (map) {
map.destroy()
// map.destroy()
}
},
async initForm (row, agencyObj) {
@ -140,21 +141,8 @@ export default {
this.agencyObj = agencyObj
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
},
// init
initMap () {
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.dataForm.latitude && this.dataForm.longitude) {
latitude = this.dataForm.latitude
longitude = this.dataForm.longitude
@ -163,84 +151,43 @@ export default {
latitude = 39.9088810666821;
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 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
if (this.dataForm.coordinatePosition) {
this.$nextTick(() => {
if (!map) {
this.initMap(latitude, longitude)
} else {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
})
}
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
// init
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_detail_build"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
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('未检索到相关位置坐标')
}
})
},
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
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 () {
this.buildType = '1'

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

@ -32,12 +32,12 @@
maxlength="50"
placeholder="请输入楼栋编码"
v-model="dataForm.coding">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@click="handleCode">生成</el-button>
type="primary"
size="small"
@click="handleCode">生成</el-button>
</el-form-item>
<el-form-item label="楼栋类型"
prop="type"
@ -119,39 +119,29 @@
</el-input>
</el-form-item>
<el-form-item label="位置坐标"
<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"
<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_build"
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="楼栋地址"
prop="coordinatePosition"
@ -160,7 +150,6 @@
<!-- <span>{{ dataForm.coordinatePosition }}</span> -->
<el-input class="item_width_1"
placeholder="请选择楼栋地址"
disabled
v-model="dataForm.coordinatePosition" />
</el-form-item>
</el-form>
@ -182,6 +171,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map
var search
var markers
@ -191,6 +181,11 @@ export default {
data () {
return {
formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false,
buildingId: '', //ID
buildType: "1",
@ -204,7 +199,7 @@ export default {
totalUnitNum: 1,//
totalFloorNum: 0,//
totalHouseNum: 0,//
realPerson: 0,
realPerson: 0,
buildingLeaderName: '',//
buildingLeaderMobile: '',//
type: '',//
@ -223,12 +218,13 @@ export default {
},
components: {},
mounted () {
this.initMap()
},
methods: {
async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields();
let { latitude, longitude } = this.$store.state.user;
this.agencyObj = agencyObj
this.dataForm.agencyId = agencyObj.agencyId
this.dataForm.gridId = agencyObj.gridId
@ -241,13 +237,18 @@ export default {
// this.buildType = this.dataForm.buildingTypeKey
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 {
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.dataForm.latitude = latitude
this.dataForm.longitude = longitude
}
this.$nextTick(() => {
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 () {
@ -266,7 +267,7 @@ export default {
})
},
async handleCode() {
async handleCode () {
const { data, code, msg } = await requestPost(
"/gov/org/houseInformation/getBuildingCoding/" + this.dataForm.neighborHoodId);
console.log('data----', data)
@ -275,8 +276,8 @@ export default {
if (msg == "success" && code == 0) {
this.dataForm.coding = data.coding
this.dataForm.sysCoding = data.sysCoding
}
}
},
async addBuild () {
if (this.dataForm.buildingLeaderMobile) {
@ -324,89 +325,91 @@ export default {
},
// init
initMap () {
//
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 //
})
initMap (latitude, longitude) {
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
map = new daiMap(
document.getElementById("app_build"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
async handleMoveCenter () {
//
const { lat, lng } = map.getCenter();
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.dataForm.coordinatePosition = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
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 },
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('未检索到相关位置坐标')
async remoteMethod (query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
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 {
this.searchOptions = [];
}
},
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)
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.dataForm.latitude = lonlat[1];
this.dataForm.longitude = lonlat[0];
this.dataForm.coordinatePosition = selPosition.address + selPosition.name
},
resetData () {
this.keyWords = ''
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.buildingId = '' //ID
this.buildType = '1'
this.dataForm = {

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

@ -52,7 +52,7 @@
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
<div id="app_detail_community"></div>
</div>
</div>
@ -73,6 +73,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map
var search
var markers
@ -117,7 +118,7 @@ export default {
},
diaDestroy () {
if (map) {
map.destroy()
// map.destroy()
}
},
@ -132,19 +133,8 @@ export default {
this.dataForm.propertyShow = propertyShowList.join(',')
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.dataForm.latitude && this.dataForm.longitude) {
latitude = this.dataForm.latitude
longitude = this.dataForm.longitude
@ -153,81 +143,40 @@ export default {
latitude = 39.9088810666821;
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 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
this.$nextTick(() => {
if (!map) {
this.initMap(latitude, longitude)
} else {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
// init
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_detail_community"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
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('未检索到相关位置坐标')
}
})
},
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
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-form-item>
<el-form-item label="小区编码"
prop="coding"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
maxlength="50"
placeholder="请输入楼栋编码"
v-model="dataForm.coding">
</el-input>
<el-button style="margin-left: 10px"
prop="coding"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
maxlength="50"
placeholder="请输入楼栋编码"
v-model="dataForm.coding">
</el-input>
<el-button style="margin-left: 10px"
type="primary"
size="small"
@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;">
<img style="margin-left: 70px;width: 200px;"
:src="dataForm.qrcodeUrl">
@ -87,15 +87,41 @@
@click="handleAddProperty">添加物业</el-button>
</el-form-item>
<el-form-item label="实有楼栋"
style="display: block"
prop="realBuilding"
label-width="150px">
<el-input-number class="item_width_4"
v-model="dataForm.realBuilding"
:min="0"
:max="9999"
label="总户数"></el-input-number>
</el-form-item>
style="display: block"
prop="realBuilding"
label-width="150px">
<el-input-number class="item_width_4"
v-model="dataForm.realBuilding"
:min="0"
:max="9999"
label="总户数"></el-input-number>
</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="详细地址"
prop="address"
label-width="150px"
@ -108,39 +134,6 @@
</el-input>
</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="备注"
prop="remark"
label-width="150px"
@ -190,6 +183,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map
var search
var markers
@ -199,6 +193,11 @@ export default {
data () {
return {
formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
gridList: [],
propertyList: [],
@ -232,121 +231,125 @@ export default {
},
components: {},
mounted () {
this.initMap()
},
methods: {
// init
initMap () {
//
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 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
let { latitude, longitude } = this.$store.state.user;
this.formType = type
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm.neighborHoodId = this.dataForm.id
this.neighborHoodId = this.dataForm.neighborHoodId
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
} else {
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);
}
await this.loadAgency()
await this.loadGrid()
await this.loadProperty()
},
// init
initMap (latitude, longitude) {
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
map = new daiMap(
document.getElementById("app_community"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
//
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 = center.getLat()
const lng = center.getLng()
this.dataForm.latitude = lat
this.dataForm.longitude = lng
this.setMarker(lat, lng)
const { lat, lng } = map.getCenter();
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
map.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) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
async remoteMethod (query) {
this.formType = type
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm.neighborHoodId = this.dataForm.id
this.neighborHoodId = this.dataForm.neighborHoodId
map.setCenter(new TMap.LatLng(this.dataForm.latitude, this.dataForm.longitude))
this.setMarker(this.dataForm.latitude, this.dataForm.longitude)
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
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 {
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.searchOptions = [];
}
},
await this.loadAgency()
await this.loadGrid()
await this.loadProperty()
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
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('请选择网格')
const { data, code, msg } = await requestPost(
"/gov/org/houseInformation/getNeighborHoodCoding/" + this.dataForm.gridId);
if (msg == "success" && code == 0) {
this.dataForm.coding = data.coding
this.dataForm.sysCoding = data.sysCoding
}
}
},
//
async loadAgency () {
@ -488,7 +491,9 @@ export default {
}
},
resetData () {
this.keyWords = ''
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.neighborHoodId = '' //ID
this.dataForm = {
neighborHoodName: '', // 50

1
src/views/modules/communityParty/regionalParty/activitysDetail.vue

@ -70,6 +70,7 @@
<script>
import { Loading } from 'element-ui' // Loading
import daiMap from "@/utils/dai-map";
var map
var search

57
src/views/modules/communityParty/regionalParty/activitysForm.vue

@ -136,48 +136,32 @@
</el-date-picker>
</el-form-item>
<el-form-item label="活动坐标"
<el-form-item label="地图位置"
prop="longitude"
label-width="150px"
style="display: block">
<div class="item_width_1">
<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>
<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_activity"
class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="活动地址"
<el-form-item label="详细地址"
prop="address"
label-width="150px"
style="display: block">
@ -224,6 +208,7 @@ import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import Tinymce from '@c/tinymce2/index.vue'
import daiMap from "@/utils/dai-map";
var map
var search

1
src/views/modules/communityParty/regionalParty/unitsDetail.vue

@ -66,6 +66,7 @@
import { Loading } from 'element-ui' // Loading
import nextTick from 'dai-js/tools/nextTick'
import daiMap from "@/utils/dai-map";
var map
var search

57
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -91,48 +91,32 @@
placeholder="请输入备注,不超过500字"
v-model="formData.remark"></el-input>
</el-form-item>
<el-form-item label="位置坐标"
<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>
<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_unit"
class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="地理位置"
<el-form-item label="详细地址"
prop="address"
label-width="150px"
style="display: block">
@ -161,6 +145,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";

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

@ -1,246 +1,192 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form
ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form"
>
<el-form-item
label="组织名称 "
prop="organizationName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入组织名称 "
v-model="dataForm.organizationName"
>
<el-form ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
:disabled="formType === 'detail'"
class="form">
<el-form-item label="组织名称 "
prop="organizationName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入组织名称 "
v-model="dataForm.organizationName">
</el-input>
</el-form-item>
<el-form-item
label="分类名称 "
prop="categoryCode"
label-width="150px"
style="display: block"
>
<el-select
v-model="dataForm.categoryCode"
placeholder="请选择"
clearable
>
<el-option
v-for="item in categoryList"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-form-item label="分类名称 "
prop="categoryCode"
label-width="150px"
style="display: block">
<el-select v-model="dataForm.categoryCode"
placeholder="请选择"
clearable>
<el-option v-for="item in categoryList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="组织人数 "
prop="organizationPersonCount"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="number"
maxlength="50"
show-word-limit
placeholder="请输入组织人数 "
v-model="dataForm.organizationPersonCount"
>
<el-form-item label="组织人数 "
prop="organizationPersonCount"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="number"
maxlength="50"
show-word-limit
placeholder="请输入组织人数 "
v-model="dataForm.organizationPersonCount">
</el-input>
</el-form-item>
<el-form-item
label="组织成员 "
prop="organizationPersonnel"
label-width="150px"
style="display: block"
>
<el-form-item label="组织成员 "
prop="organizationPersonnel"
label-width="150px"
style="display: block">
<div class="m-staffs">
<div
class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.organizationPersonnel"
>
<el-autocomplete
class="item_width_1"
v-model="item.personName"
:fetch-suggestions="querySearchVolunteer"
placeholder="成员姓名"
:maxlength="50"
show-word-limit
@select="(vItem) => handleSelectVolunteer(index, vItem)"
:disabled="item.icResiUserId != ''"
></el-autocomplete>
<el-input
style="margin-left: 10px"
class="item_width_1"
show-word-limit
placeholder="联系电话"
:disabled="item.icResiUserId != ''"
v-model="item.personPhone"
/>
<el-button
style="margin-left: 10px"
size="small"
@click="handleDelStaff(index)"
>删除</el-button
>
<div class="item"
:key="'staff' + index"
v-for="(item, index) in dataForm.organizationPersonnel">
<el-autocomplete class="item_width_1"
v-model="item.personName"
:fetch-suggestions="querySearchVolunteer"
placeholder="成员姓名"
:maxlength="50"
show-word-limit
@select="(vItem) => handleSelectVolunteer(index, vItem)"
:disabled="item.icResiUserId != ''"></el-autocomplete>
<el-input style="margin-left: 10px"
class="item_width_1"
show-word-limit
placeholder="联系电话"
:disabled="item.icResiUserId != ''"
v-model="item.personPhone" />
<el-button style="margin-left: 10px"
size="small"
@click="handleDelStaff(index)">删除</el-button>
</div>
<div class="item-add">
<el-button size="small" @click="handleAddStaff">添加</el-button>
<el-button size="small"
@click="handleAddStaff">添加</el-button>
</div>
</div>
</el-form-item>
<el-form-item
label="服务事项"
prop="serviceItem"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.serviceItem"
></el-input>
<el-form-item label="服务事项"
prop="serviceItem"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:rows="3"
placeholder="请输入服务事项,不超过1000字"
v-model="dataForm.serviceItem"></el-input>
</el-form-item>
<el-form-item
label="负责人 "
prop="principalName"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人 "
v-model="dataForm.principalName"
>
<el-form-item label="负责人 "
prop="principalName"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入负责人 "
v-model="dataForm.principalName">
</el-input>
</el-form-item>
<el-form-item
label="联系电话 "
prop="principalPhone"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入联系电话 "
v-model="dataForm.principalPhone"
>
<el-form-item label="联系电话 "
prop="principalPhone"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入联系电话 "
v-model="dataForm.principalPhone">
</el-input>
</el-form-item>
<el-form-item
label="创建时间"
prop="organizationCreatedTime"
label-width="150px"
style="display: block"
>
<el-date-picker
v-model="dataForm.organizationCreatedTime"
placeholder="创建时间"
value-format="yyyy-MM-dd"
>
<el-form-item label="创建时间"
prop="organizationCreatedTime"
label-width="150px"
style="display: block">
<el-date-picker v-model="dataForm.organizationCreatedTime"
placeholder="创建时间"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item
label="位置坐标"
prop="longitude"
label-width="150px"
style="display: block"
>
<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="dataForm.address"
>
</el-input>
<el-button
style="margin-left: 10px"
type="default"
size="small"
@click="handleSearchMap"
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px" v-show="false">
<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>
<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"
class="div_map"></div>
</div>
</el-form-item>
<el-form-item
label="备注"
prop="remark"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入备注,不超过500字"
v-model="dataForm.remark"
></el-input>
<el-form-item label="详细地址 "
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入位置 "
v-model="dataForm.address">
</el-input>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:rows="3"
placeholder="请输入备注,不超过500字"
v-model="dataForm.remark"></el-input>
</el-form-item>
</el-form>
</div>
<div class="div_btn resi-btns">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button
v-if="formType != 'detail'"
type="primary"
size="small"
:disabled="btnDisable"
@click="handleComfirm"
> </el-button
>
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'"
type="primary"
size="small"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
@ -263,10 +209,15 @@ var geocoder; // 新建一个正逆地址解析类
export default {
components: {},
props: {},
data() {
data () {
return {
formType: "add", // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false,
orgId: "",
@ -289,7 +240,7 @@ export default {
};
},
computed: {
dataRule() {
dataRule () {
return {
organizationName: [
{ required: true, message: "组织名称 不能为空", trigger: "blur" },
@ -324,25 +275,67 @@ export default {
},
watch: {},
async mounted() {
async mounted () {
this.getCategoryList();
this.getVolunteerList();
this.initMap();
},
methods: {
querySearchVolunteer(queryString, cb) {
async remoteMethod (query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
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 {
this.searchOptions = [];
}
},
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.dataForm.address = selPosition.address + selPosition.name
},
querySearchVolunteer (queryString, cb) {
const { volunteerList } = this;
var results = queryString
? volunteerList.filter((item) => {
return item.value.indexOf(queryString) !== -1;
})
return item.value.indexOf(queryString) !== -1;
})
: volunteerList;
// callback
cb(results);
},
handleSelectVolunteer(index, vItem) {
handleSelectVolunteer (index, vItem) {
this.dataForm.organizationPersonnel[index] = {
personName: vItem.name,
personPhone: vItem.mobile,
@ -350,7 +343,7 @@ export default {
};
},
async getVolunteerList() {
async getVolunteerList () {
const url = "/epmetuser/icresiuser/volunteer-list";
const params = {};
const { data, code, msg } = await requestPost(url, params);
@ -368,7 +361,7 @@ export default {
}
},
async getCategoryList() {
async getCategoryList () {
const url = "/sys/dict/data/dictlist";
const params = {
dictType: "self_org_category",
@ -380,21 +373,42 @@ export default {
this.$message.error(msg);
}
},
handleAddStaff() {
handleAddStaff () {
this.dataForm.organizationPersonnel = [
...this.dataForm.organizationPersonnel,
{ personName: "", personPhone: "", icResiUserId: "" },
];
},
handleDelStaff(index) {
handleDelStaff (index) {
const { organizationPersonnel } = this.dataForm;
organizationPersonnel.splice(index, 1);
this.dataForm.organizationPersonnel = organizationPersonnel;
},
// init
initMap() {
async initForm (type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
console.log(row);
let { latitude, longitude } = this.$store.state.user;
if (row) {
this.dataForm = { ...this.dataForm, ...row };
this.orgId = this.dataForm.orgId;
} else {
this.dataForm.latitude = latitude
this.dataForm.longitude = longitude
}
if (!map) {
this.initMap(this.dataForm.latitude, this.dataForm.longitude);
}
},
// init
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app"),
@ -410,22 +424,14 @@ export default {
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
},
async handleSearchMap() {
const { msg, data } = await map.searchNearby(this.dataForm.address);
if (msg == "success") {
const { lat, lng } = data;
map.setCenter(lat, lng);
map.setMarker(lat, lng);
this.dataForm.latitude = lat;
this.dataForm.longitude = lng;
} else {
this.$message.error("未检索到相关位置坐标");
}
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
async handleMoveCenter(e) {
async handleMoveCenter () {
//
const { lat, lng } = map.getCenter();
this.dataForm.latitude = lat;
@ -434,28 +440,16 @@ export default {
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.dataForm.address = data.address;
this.dataForm.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
async initForm(type, row) {
this.$refs.ref_form.resetFields();
this.formType = type;
console.log(row);
if (row) {
this.dataForm = { ...this.dataForm, ...row };
this.orgId = this.dataForm.orgId;
await nextTick(800);
if (map) {
map.setCenter(row.latitude, row.longitude);
map.setMarker(row.latitude, row.longitude);
}
}
},
async handleComfirm() {
async handleComfirm () {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
@ -488,7 +482,7 @@ export default {
});
},
async submit() {
async submit () {
let url = "";
if (this.formType === "add") {
url = "/heart/iccommunityselforganization/addcommunityselforganization";
@ -516,11 +510,16 @@ export default {
}
},
handleCancle() {
handleCancle () {
this.resetData();
this.$emit("dialogCancle");
},
resetData() {
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.orgId = "";
this.dataForm = {
organizationName: "",
@ -537,8 +536,23 @@ export default {
organizationPersonnel: [],
};
},
// async handleSearchMap () {
// const { msg, data } = await map.searchNearby(this.keyWords);
// if (msg == "success") {
// const { lat, lng } = data;
// map.setCenter(lat, lng);
// map.setMarker(lat, lng);
// this.dataForm.latitude = lat;
// this.dataForm.longitude = lng;
// this.handleMoveCenter()
// } else {
// this.$message.error("");
// }
// },
//
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -546,7 +560,7 @@ export default {
});
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();

265
src/views/modules/partymember/icpartyorg-add-or-update.vue

@ -1,155 +1,120 @@
<template>
<el-dialog
:visible.sync="visible"
:title="!dataForm.id ? '新增党组织' : '更新党组织'"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
class="form"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
:label-width="$i18n.locale === 'en-US' ? '120px' : '100px'"
>
<el-form-item prop="partyOrgType" label="党组织类型">
<el-select
:disabled="dataForm.id || dataForm.orgId ? true : false"
v-model="dataForm.partyOrgType"
@change="changePartyOrgType"
clearable
placeholder="请选择党组织类型"
>
<el-option
v-for="item in partyOrgTypeList"
:key="item.value"
:label="item.name"
:value="item.value"
>
<el-dialog :visible.sync="visible"
:title="!dataForm.id ? '新增党组织' : '更新党组织'"
:close-on-click-modal="false"
:close-on-press-escape="false">
<el-form class="form"
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
:label-width="$i18n.locale === 'en-US' ? '120px' : '100px'">
<el-form-item prop="partyOrgType"
label="党组织类型">
<el-select :disabled="dataForm.id || dataForm.orgId ? true : false"
v-model="dataForm.partyOrgType"
@change="changePartyOrgType"
clearable
placeholder="请选择党组织类型">
<el-option v-for="item in partyOrgTypeList"
:key="item.value"
:label="item.name"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="partyOrgName" label="党组织名称">
<el-input
v-model="dataForm.partyOrgName"
placeholder="请输入党组织名称"
style="width: 300px"
></el-input>
<el-form-item prop="partyOrgName"
label="党组织名称">
<el-input v-model="dataForm.partyOrgName"
placeholder="请输入党组织名称"
style="width: 300px"></el-input>
</el-form-item>
<el-form-item label="党组织编码" prop="partyOrgCode">
<el-input
v-model="dataForm.partyOrgCode"
placeholder="党组织编码"
style="width: 300px"
></el-input>
<el-form-item label="党组织编码"
prop="partyOrgCode">
<el-input v-model="dataForm.partyOrgCode"
placeholder="党组织编码"
style="width: 300px"></el-input>
</el-form-item>
<el-form-item
v-if="dataForm.partyOrgType != '5'"
prop="agencyId"
label="行政组织"
>
<el-cascader
style="width: 300px"
v-model="dataForm.agencyId"
:options="agencyOrgList"
placeholder="请选择行政组织"
:props="{
<el-form-item v-if="dataForm.partyOrgType != '5'"
prop="agencyId"
label="行政组织">
<el-cascader style="width: 300px"
v-model="dataForm.agencyId"
:options="agencyOrgList"
placeholder="请选择行政组织"
:props="{
emitPath: false,
checkStrictly: true,
label: 'name',
value: 'id',
children: 'children',
}"
:disabled="dataForm.id ? true : false"
:show-all-levels="false"
@change="changeAgencyOrg"
clearable
/>
:disabled="dataForm.id ? true : false"
:show-all-levels="false"
@change="changeAgencyOrg"
clearable />
</el-form-item>
<el-form-item
v-if="!dataForm.sjdzzName"
prop="mySelectOrg"
label="上级党组织"
>
<el-cascader
ref="myOrg"
style="width: 300px"
v-model="dataForm.mySelectOrg"
:options="orgList"
placeholder="请选择上级党组织"
:props="{
<el-form-item v-if="!dataForm.sjdzzName"
prop="mySelectOrg"
label="上级党组织">
<el-cascader ref="myOrg"
style="width: 300px"
v-model="dataForm.mySelectOrg"
:options="orgList"
placeholder="请选择上级党组织"
:props="{
checkStrictly: true,
label: 'partyOrgName',
value: 'id',
children: 'children',
}"
@change="handleChangeOrg"
:disabled="dataForm.id || dataForm.orgId ? true : false"
clearable
/>
@change="handleChangeOrg"
:disabled="dataForm.id || dataForm.orgId ? true : false"
clearable />
</el-form-item>
<el-form-item v-if="dataForm.sjdzzName" label="上级党组织">
<el-input
:disabled="true"
v-model="dataForm.sjdzzName"
style="width: 300px"
></el-input>
<el-form-item v-if="dataForm.sjdzzName"
label="上级党组织">
<el-input :disabled="true"
v-model="dataForm.sjdzzName"
style="width: 300px"></el-input>
</el-form-item>
<el-form-item label="党组织介绍" prop="introduction">
<el-input
style="width: 300px"
v-model="dataForm.introduction"
type="textarea"
maxlength="500"
placeholder="党组织介绍"
></el-input>
<el-form-item label="党组织介绍"
prop="introduction">
<el-input style="width: 300px"
v-model="dataForm.introduction"
type="textarea"
maxlength="500"
placeholder="党组织介绍"></el-input>
</el-form-item>
<el-form-item label="党组织位置" prop="longitude" style="display: block">
<div class="item_width_1">
<div class="div_map">
<div id="app"></div>
<div style="display: none" id="mapSeach_id" 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 id="lon_lat_id" style="margin-top: 10px; display: none">
<span>经度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入经度"
:readonly="true"
v-model="dataForm.longitude">
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input class="item_width_3"
maxlength="50"
placeholder="请输入纬度"
:readonly="true"
v-model="dataForm.latitude">
</el-input>
</div> -->
<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_icparty"
class="div_map"></div>
</div>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{
<el-button type="primary"
@click="dataFormSubmitHandle()">{{
$t("confirm")
}}</el-button>
</template>
@ -157,6 +122,8 @@
</template>
<script>
import daiMap from "@/utils/dai-map";
var map;
var search;
var markers;
@ -165,7 +132,7 @@ var geocoder; // 新建一个正逆地址解析类
import debounce from "lodash/debounce";
export default {
data() {
data () {
return {
visible: false,
keyWords: "",
@ -201,7 +168,7 @@ export default {
};
},
methods: {
init() {
init () {
this.visible = true;
this.agencyId = localStorage.getItem("agencyId");
this.dataForm.customerId = localStorage.getItem("customerId");
@ -238,7 +205,7 @@ export default {
// })
},
//
setPartyOrgType_xzxj() {
setPartyOrgType_xzxj () {
if (this.dataForm.partyOrgType === "0") {
// 0,1,2,3,4,5
this.dataForm.partyOrgType = "1";
@ -253,7 +220,7 @@ export default {
}
},
//
setPartyOrgType() {
setPartyOrgType () {
// community:street,: district,: city :province
// 0,1,2,3,4,5
this.level = localStorage.getItem("level")
@ -297,14 +264,14 @@ export default {
}
},
//
changeAgencyOrg() {
changeAgencyOrg () {
if (!this.dataForm.orgId) {
// orgId
this.getOrgList();
}
},
//
changePartyOrgType(value) {
changePartyOrgType (value) {
if (value == "5") {
//
this.dataForm.agencyId = localStorage.getItem("agencyId");
@ -329,7 +296,7 @@ export default {
}
},
//
getOrgList() {
getOrgList () {
if (!this.dataForm.id) {
//
this.orgList = [];
@ -352,9 +319,9 @@ export default {
}
this.orgList = this.removeEmptyChildren(res.data);
})
.catch(() => {});
.catch(() => { });
},
removeEmptyChildren(orgArray) {
removeEmptyChildren (orgArray) {
orgArray.forEach((orgInfo) => {
if (orgInfo && orgInfo.children) {
if (orgInfo.children.length === 0) {
@ -367,7 +334,7 @@ export default {
return orgArray;
},
//
handleChangeOrg(e) {
handleChangeOrg (e) {
if (this.dataForm.mySelectOrg.length > 0 && this.dataForm.mySelectOrg) {
this.dataForm.orgPid =
this.dataForm.mySelectOrg[this.dataForm.mySelectOrg.length - 1];
@ -384,7 +351,7 @@ export default {
}
},
//
getInfo() {
getInfo () {
this.$http
.get(`/resi/partymember/icPartyOrg/${this.dataForm.id}`)
.then(({ data: res }) => {
@ -407,9 +374,9 @@ export default {
this.getOrgList();
this.initMap();
})
.catch(() => {});
.catch(() => { });
},
getInfoAgencyLisy() {
getInfoAgencyLisy () {
this.$http
.get("/gov/org/customeragency/getOrgTreeByUserAndType", {
params: {
@ -425,10 +392,10 @@ export default {
}
this.agencyOrgList = this.removeEmptyChildren(res.data);
})
.catch(() => {});
.catch(() => { });
},
// init
initMap() {
initMap () {
document.getElementById("app").innerHTML = "";
if (document.getElementById("app")) {
document.getElementById("mapSeach_id").style.display = "block";
@ -465,7 +432,7 @@ export default {
this.handleMoveCenter();
this.convert();
},
setMarker(lat, lng) {
setMarker (lat, lng) {
markers.setGeometries([]);
markers.add([
{
@ -479,7 +446,7 @@ export default {
]);
},
handleSearchMap() {
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close();
});
@ -510,7 +477,7 @@ export default {
});
},
handleMoveCenter() {
handleMoveCenter () {
//
const center = map.getCenter();
const lat = center.getLat();
@ -526,7 +493,7 @@ export default {
this.convert(lat, lng);
},
convert(lat, lng) {
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(':');
let location;
@ -574,8 +541,8 @@ export default {
res.internalMsg
? res.internalMsg
: res.msg
? res.msg
: "查询失败"
? res.msg
: "查询失败"
);
}
this.$message({
@ -588,7 +555,7 @@ export default {
},
});
})
.catch(() => {});
.catch(() => { });
});
},
1000,
@ -596,7 +563,7 @@ export default {
),
},
computed: {
dataRule() {
dataRule () {
return {
partyOrgName: [
{ required: true, message: "党组织名称不能为空", trigger: "blur" },

5
src/views/modules/shequzhili/csgltc/csgl.vue

@ -52,7 +52,8 @@
style="margin-left:10px"
size="small"
@click="handleExportModule('room')">下载模板</el-button>
<el-upload :headers="$getElUploadHeaders()" ref="upload"
<el-upload :headers="$getElUploadHeaders()"
ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
@ -361,7 +362,7 @@ export default {
this.formShow = false
},
diaDetailClose () {
this.$refs.ref_detail.diaDestroy()
// this.$refs.ref_detail.diaDestroy()
this.detailShow = false
},

137
src/views/modules/shequzhili/csgltc/csglDetail.vue

@ -33,7 +33,7 @@
</div>
<div class="info-prop">
<span class="info-title-2">地理位置</span>
<span class="info-title-2">所在位置</span>
<span>{{ formData.address }}</span>
</div>
@ -41,7 +41,7 @@
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
<div id="app_csgl_detail"></div>
</div>
</div>
@ -61,6 +61,7 @@
<script>
import { Loading } from 'element-ui' // Loading
import daiMap from "@/utils/dai-map";
var map
var search
@ -85,14 +86,14 @@ export default {
methods: {
handleCancle () {
this.diaDestroy()
// this.diaDestroy()
this.$emit('diaDetailClose')
},
diaDestroy () {
if (map) {
map.destroy()
// map.destroy()
}
},
@ -100,17 +101,7 @@ export default {
this.startLoading()
this.formData = { ...row }
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
this.endLoading()
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
@ -121,115 +112,37 @@ export default {
latitude = 39.9088810666821;
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 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
this.$nextTick(() => {
this.initMap(latitude, longitude)
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
this.endLoading()
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
// this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
// init
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_csgl_detail"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
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.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address
//
});
},
//
startLoading () {
loading = Loading.service({

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

@ -96,23 +96,42 @@
placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item label="地"
prop="address"
<el-form-item label="地图位置"
prop="longitude"
label-width="150px"
style="display: block">
<div class="item_width_1">
<el-input style="width:420px"
:placeholder="'请输入所在地址'"
v-model="formData.address">
</el-input>
<el-button style="margin-left: 10px"
type="default"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
<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_csgl"
class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="详细地址 "
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入位置 "
v-model="formData.address">
</el-input>
</el-form-item>
</el-form>
</div>
@ -132,7 +151,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map
@ -146,6 +165,10 @@ export default {
data () {
return {
formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false,
serviceList: [],
@ -169,7 +192,7 @@ export default {
},
components: {},
mounted () {
this.initMap()
},
methods: {
@ -177,7 +200,7 @@ export default {
async initForm (type, icCityManagementId) {
this.startLoading()
this.$refs.ref_form.resetFields();
let { latitude, longitude } = this.$store.state.user;
//
await this.loadService()
@ -187,10 +210,12 @@ export default {
this.formData.icCityManagementId = icCityManagementId
await this.loadFormData()
} else {
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
// this.setMarker(36.0722275, 120.38945519)
this.formData.latitude = latitude
this.formData.longitude = longitude
}
// if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
// }
this.endLoading()
},
@ -231,10 +256,10 @@ export default {
// 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;
if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== '') {
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
}
// if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== '') {
// map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
// this.setMarker(this.formData.latitude, this.formData.longitude)
// }
} else {
this.$message.error(msg)
}
@ -289,133 +314,90 @@ export default {
},
// init
initMap () {
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
//
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, //
zoom: 16.2, //
pitch: 43.5, //
rotation: 45 //
})
initMap (latitude, longitude) {
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
map = new daiMap(
document.getElementById("app_csgl"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
// this.convert()
},
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchNearby({
keyword: this.formData.address,
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.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
async handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
const { lat, lng } = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
async remoteMethod (query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
if (msg == "success" && data.resultList && data.resultList.length > 0) {
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
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 {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
this.searchOptions = [];
}
},
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address === '' || result.result.address === null ? this.formData.address : result.result.address
this.formData.address = this.formData.address !== '' && this.formData.address !== null && (this.formData.longitude === '' || this.formData.longitude === null) ? this.formData.address : result.result.address
//
});
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.address = selPosition.address + selPosition.name
},
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.unitId = ''
this.keyWords = ''
this.formData = {

219
src/views/modules/shequzhili/event/cpts/add.vue

@ -143,36 +143,35 @@
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="cell-width-map"
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 class="item_width_4"
maxlength="50"
placeholder="请输入关键字"
v-model="formData.address">
</el-input>
<el-button style="margin-left: 10px"
type="default"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="map_event"
class="div_map"></div>
<!-- <div style="margin-top: 10px" v-show="false">
<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> -->
</div>
</el-form-item>
</el-form>
@ -238,7 +237,7 @@
import { Loading } from "element-ui"; // Loading
import { requestPost } from "@/js/dai/request";
import formVltHelper from "dai-js/tools/formVltHelper";
import daiMap from "@/utils/dai-map";
import { isCard } from "@/utils/validate";
let loading; //
@ -388,6 +387,7 @@ export default {
async mounted () {
const { user } = this.$store.state;
this.agencyId = user.agencyId;
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
@ -398,6 +398,10 @@ export default {
this.formData.longitude = longitude;
this.initMap();
map.setCenter(this.formData.latitude, this.formData.longitude);
map.setMarker(this.formData.latitude, this.formData.longitude);
this.handleMoveCenter()
this.loadGrid();
this.getCategoryList();
},
@ -567,126 +571,47 @@ export default {
// init
initMap () {
//
var center = new window.TMap.LatLng(
this.formData.latitude,
this.formData.longitude
);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), {
center: center, //
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
});
search = new window.TMap.service.Search({ pageSize: 10 });
//
markers = new TMap.MultiMarker({
map: map,
geometries: [],
});
infoWindowList = Array(10);
let { latitude, longitude } = this.$store.state.user;
geocoder = new TMap.service.Geocoder(); //
map = new daiMap(
document.getElementById("map_event"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
map.on("panend", () => {
this.handleMoveCenter();
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
this.handleMoveCenter();
// this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([]);
markers.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
},
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.formData.latitude = lat;
this.formData.longitude = lng;
this.convert();
} else {
this.$message.error("未检索到相关位置坐标");
}
});
async handleSearchMap () {
const { msg, data } = await map.searchNearby(this.formData.address);
if (msg == "success") {
const { lat, lng } = data;
map.setCenter(lat, lng);
map.setMarker(lat, lng);
this.formData.latitude = lat;
this.formData.longitude = lng;
} else {
this.$message.error("未检索到相关位置坐标");
}
},
handleMoveCenter () {
async handleMoveCenter (e) {
//
const center = map.getCenter();
const lat = center.getLat();
const lng = center.getLng();
const { lat, lng } = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
this.setMarker(lat, lng);
this.convert(lat, lng);
},
map.setMarker(lat, lng);
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location;
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(
this.formData.latitude,
this.formData.longitude
);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address;
}
// map.setCenter(location);
markers.updateGeometries([
{
id: "main", //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
if (!this.isFirst) {
//
this.formData.address = result.result.address;
}
if (this.isFirst) {
this.isFirst = false;
}
});
},
resetData () {
@ -711,11 +636,17 @@ export default {
},
};
</script>
<style
lang="scss"
src="@/assets/scss/modules/shequzhili/event-info.scss"
scoped
></style>
<style lang="scss" scoped>
@import "@/assets/scss/modules/shequzhili/event-info.scss";
.item_width_4 {
width: 350px;
}
.div_map {
margin-top: 10px;
}
</style>
<style lang="scss">
.el-dialog__body {

133
src/views/modules/shequzhili/ggfwtc/ggfwDetail.vue

@ -42,7 +42,7 @@
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
<div id="app_ggfw_detail"></div>
</div>
</div>
@ -62,6 +62,7 @@
<script>
import { Loading } from 'element-ui' // Loading
import daiMap from "@/utils/dai-map";
var map
var search
@ -86,14 +87,14 @@ export default {
methods: {
handleCancle () {
this.diaDestroy()
// this.diaDestroy()
this.$emit('diaDetailClose')
},
diaDestroy () {
if (map) {
map.destroy()
// map.destroy()
}
},
@ -101,15 +102,7 @@ export default {
this.startLoading()
this.formData = { ...row }
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
this.endLoading()
},
// init
initMap () {
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
@ -120,116 +113,38 @@ export default {
latitude = 39.9088810666821;
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 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
this.$nextTick(() => {
this.initMap(latitude, longitude)
})
infoWindowList = Array(10)
geocoder = new TMap.service.Geocoder(); //
this.endLoading()
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
console.log('initMap')
// this.convert()
},
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
// init
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_ggfw_detail"),
{ latitude, longitude },
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
])
},
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
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.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
);
handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
},
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
} else {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
}
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
// this.formData.address = result.result.address
//
});
},
//
startLoading () {
loading = Loading.service({

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

@ -77,23 +77,42 @@
class="item_width_1"
placeholder="请输入联系电话"></el-input>
</el-form-item>
<el-form-item label="地"
prop="address"
<el-form-item label="地图位置"
prop="longitude"
label-width="150px"
style="display: block">
<div class="item_width_1">
<el-input style="width:420px"
:placeholder="'请输入所在地址'"
v-model="formData.address">
</el-input>
<el-button style="margin-left: 10px"
type="default"
size="small"
@click="handleSearchMap">查询</el-button>
<div id="app"
<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_ggfw"
class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="详细地址 "
prop="address"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="50"
show-word-limit
placeholder="请输入位置 "
v-model="formData.address">
</el-input>
</el-form-item>
</el-form>
</div>
@ -113,7 +132,7 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import daiMap from "@/utils/dai-map";
var map
@ -127,11 +146,15 @@ export default {
data () {
return {
formType: 'add', // addeditdetail
searchOptions: [],
searchValue: '',
resultList: [],
loading: false,
btnDisable: false,
icPublicServiceId: '',
keyWords: '',
formData: {
name: '',//
category: '',
@ -149,7 +172,7 @@ export default {
},
components: {},
mounted () {
this.initMap()
},
methods: {
@ -157,7 +180,7 @@ export default {
async initForm (type, icPublicServiceId) {
this.startLoading()
this.$refs.ref_form.resetFields();
let { latitude, longitude } = this.$store.state.user;
//
await this.loadService()
@ -167,10 +190,13 @@ export default {
this.formData.icPublicServiceId = icPublicServiceId
await this.loadFormData()
} else {
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
// this.setMarker(36.0722275, 120.38945519)
this.formData.latitude = latitude
this.formData.longitude = longitude
}
// if (!map) {
this.initMap(this.formData.latitude, this.formData.longitude);
// }
this.endLoading()
},
@ -211,10 +237,10 @@ export default {
// let { latitude, longitude } = this.$store.state.user;
// const lat = this.formData.latitude === null || this.formData.latitude === '' ? '' : this.formData.latitude;
// const lon = this.formData.longitude === null || this.formData.longitude === '' ? '' : this.formData.longitude;
if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== '') {
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
}
// if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== '') {
// map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
// this.setMarker(this.formData.latitude, this.formData.longitude)
// }
} else {
this.$message.error(msg)
}
@ -270,130 +296,90 @@ export default {
},
// init
initMap () {
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
center: center, //
zoom: 16.2, //
pitch: 43.5, //
rotation: 45 //
})
search = new window.TMap.service.Search({ pageSize: 10 })
//
markers = new TMap.MultiMarker({
map: map,
geometries: []
})
infoWindowList = Array(10)
initMap (latitude, longitude) {
geocoder = new TMap.service.Geocoder(); //
map = new daiMap(
document.getElementById("app_ggfw"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
// this.convert()
},
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
setMarker (lat, lng) {
markers.setGeometries([])
markers.add([
{
id: '4',
styleId: 'marker',
position: new TMap.LatLng(lat, lng),
properties: {
title: 'marker4'
}
}
])
},
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
handleSearchMap () {
infoWindowList.forEach((infoWindow) => {
infoWindow.close()
})
infoWindowList.length = 0
markers.setGeometries([])
//
search
.searchNearby({
keyword: this.formData.address,
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.formData.latitude = lat
this.formData.longitude = lng
this.convert()
} else {
this.$message.error('未检索到相关位置坐标')
}
})
},
handleMoveCenter () {
async handleMoveCenter () {
//
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
this.formData.latitude = lat
this.formData.longitude = lng
this.setMarker(lat, lng)
this.convert(lat, lng)
const { lat, lng } = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.address = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
convert (lat, lng) {
markers.setGeometries([]);
// var input = document.getElementById('location').value.split(',');
let location
if (lat && lng) {
location = new TMap.LatLng(lat, lng);
async remoteMethod (query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = []
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 {
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
this.searchOptions = [];
}
// map.setCenter(location);
markers.updateGeometries([
{
id: 'main', //
position: location,
},
]);
geocoder
.getAddress({ location: location }) //
.then((result) => {
console.log(this.formData)
// this.formData.address = result.result.address === '' || result.result.address === null ? this.formData.address : result.result.address
this.formData.address = this.formData.address !== '' && this.formData.address !== null && (this.formData.longitude === '' || this.formData.longitude === null) ? this.formData.address : result.result.address
//
});
},
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.address = selPosition.address + selPosition.name
},
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.icPublicServiceId = ''
this.keyWords = ''
this.formData = {

Loading…
Cancel
Save