master
lion 3 years ago
parent 479e078d2a
commit 5b624f9870

@ -98,7 +98,7 @@ AMap.initAMapApiLoader({
// 高德的key
key: '795a757114c371f42cee1f8efa527684',
// 插件集合 (插件按需引入)
plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType',
plugin: ['AMap.Autocomplete','AMap.Geocoder','AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType',
'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.DistrictSearch','AMap.CircleMarker','AMap.Polyline'
// 'AMap.Object3DLayer', 'AMap.Object3D'
]

@ -133,9 +133,10 @@
<template v-slot:reside>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>现居住地
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>现居住地
</div>
<div class="xy-table-item-content">
<!-- <avue-input-map :params="mapparams" style="width: 300px;" placeholder="请选择地图" v-model="mapform"></avue-input-map> -->
<el-input v-model="form.reside" placeholder="请输入现居住地" clearable style="width: 300px;"></el-input>
</div>
</div>
@ -289,7 +290,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>固话
</div>
<div class="xy-table-item-content">
<el-input v-model="form.guardian_telephone" placeholder="请输入监护人固话 " clearable
<el-input v-model="form.guardian_telephone" placeholder="请输入监护人固话" clearable
style="width: 300px;"></el-input>
</div>
</div>
@ -310,6 +311,7 @@
</template>
<script>
import AvueMap from 'avue-plugin-map'
import {
getparameter
} from "@/api/system/dictionary";
@ -317,17 +319,25 @@
save,
index,
show
} from "@/api/system/baseForm.js"
import {
Message
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
components: {
AvueMap
},
data() {
return {
isShow: false,
id: '',
type: 'add',
tableName: 'records',
tableName: 'records',
//
mapparams: {
zoom: 11,
},
mapform: [],
form: {
infotext: '',
name: '',
@ -341,7 +351,9 @@
education: "",
household: "",
address: "",
reside: "",
reside: "",
longitude:'',
latitude:'',
disabilitytext: "",
number: "",
disabilitytype: "",
@ -381,6 +393,14 @@
this.type = ''
this.$refs['dialog'].reset()
}
},
mapform(newVal){
if(newVal){
console.log(newVal)
this.form.longitude = newVal[0]
this.form.latitude = newVal[1]
this.form.reside = newVal[2]
}
}
},
methods: {
@ -428,7 +448,9 @@
education: res?.education,
household: res?.household,
address: res?.address,
reside: res?.reside,
reside: res?.reside,
longitude: res?.longitude,
latitude:res?.latitude,
disabilitytext: '',
number: res?.number,
disabilitytype: res?.disabilitytype,
@ -444,12 +466,15 @@
guardian_mobile: res?.guardian_mobile,
guardian_telephone: res?.guardian_telephone,
remark: res?.remark,
}
}
this.mapform = [res.longitude,res.latitude,res.reside]
},
submit(val) {
submit(val) {
console.log(this.form)
// return
if (this.type === 'add') {
save({
table_name: this.tableName,

@ -5,7 +5,7 @@
<i @click='closeWin' class="el-icon-close"></i>
<div v-for="item in openData">
<p>姓名<span>{{item.name}}</span></p>
<p>现居住地<span>{{item.address}}dlkfijfdf;ld</span></p>
<p>现居住地<span>{{item.reside}}</span></p>
<p class="showInfo" @click="showInfo(item.id)"></p>
</div>
</div>
@ -13,44 +13,37 @@
</template>
<script>
// zoom,center便
// zoom,center便
import {
index
} from "@/api/system/baseForm.js"
export default {
data() {
return {
zoom: 13,
center: [119.431911, 31.678932],
zoom: 11,
center: [119.597897,31.723247],
mapHeight: 0,
map: null,
infoWindow: null,
openData: [],
// markerList: [],
mapList: [{
id: 1,
name: '小王',
address: '广东省广州市海珠区',
lnglats: [119.655114, 31.726251]
}, {
id: 2,
name: '小张',
address: '广东省广州市黄埔区',
lnglats: [119.471972, 31.578163]
}]
mapList: []
}
},
mounted() {
mounted() {
this.initHeight()
this.$nextTick(function() {
this.mapInit()
})
this.getindex()
},
methods: {
initHeight() {
async initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
},
//
mapInit() {
async mapInit() {
this.map = new AMap.Map("map", {
center: this.center,
mapStyle: "amap://styles/bfb1bb3feb0db7082367abca96b8d214", //
@ -60,7 +53,6 @@
let that = this
let adcode = ['320413'];
this.areaBG(this.map, adcode);
this.setMapMarker()
this.infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: true,
@ -104,10 +96,11 @@
});
});
},
//
setMapMarker() {
//
setMapMarker() {
console.log("mapList",this.mapList)
let makerList = []
//
this.mapList.forEach((item) => {
//
let marker = new AMap.Text({
@ -115,7 +108,7 @@
text: item.name,
zIndex: 9999999,
offset: new AMap.Pixel(-13, -30),
position: item.lnglats,
position: [item.longitude,item.latitude],
clickable: true,
extData: item.id,
style: {
@ -134,16 +127,66 @@
});
this.map.add(makerList)
//
this.map.setFitView();
this.map.setZoom(11)
},
closeWin() {
this.infoWindow.close()
},
showInfo(id) {
this.$router.push({path:"/record/personinfo",query:{id:id}})
},
async getindex() {
let res = await index({
page_size: 99999,
page: 1,
table_name: 'records',
})
let _data = []
for(var k of res.data){
if(k.longitude&&k.latitude){
_data.push(k)
}
}
this.mapList = _data
this.setMapMarker()
var geocoder = null
let that = this
// AMap.plugin("AMap.Geocoder",function(){
// geocoder = new AMap.Geocoder({
// city: '' // city adcode citycode
// })
// let _data = []
// for(var k of res.data){
// if(k.longitude==null||k.latitude==null){
// console.log(k.name)
// let m = k
// let _reside = k.reside
// console.log(_reside)
// geocoder.getLocation(_reside, function(status, result) {
// console.log(_reside)
// if (status === 'complete' && result.info === 'OK') {
// // result
// m.longitude = result.geocodes[0].location.lng
// m.latitude = result.geocodes[0].location.lat
// console.log("m",m)
// _data.push(m)
// console.log("_data",_data)
// return
// }
// })
// }else{
// console.log("---",k.name)
// _data.push(k)
// }
// }
// that.mapList = _data
// // that.setMapMarker()
// })
}
},

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

@ -21,7 +21,7 @@
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorRecord(scope.row.id,'editor')"></Button>
<Button type="primary" v-if="scope.row.checkstatus=='待审核'" size="small" @click="editorRecord(scope.row.id,'editor')"></Button>
<Button v-if="scope.row.checkstatus=='待审核'" style="margin-left: 10px;" type="primary" size="small" @click="checkRecord(scope.row.id,scope.row.person_id)"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRecord(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>

Loading…
Cancel
Save