Commit 8b122053 authored by youjie's avatar youjie

no message

parent f7edfd87
......@@ -251,7 +251,7 @@
<button class="hollowFixedBtn" type="button"
@click="resetPageIndex(),selectResource()">{{$t('pub.searchBtn')}}</button>
<button class="normalBtn" type="button"
@click="$router.push('CharteringInfoManage')">{{$t('pub.addBtn')}}</button>
@click="goUrl('CharteringInfoManage')">{{$t('pub.addBtn')}}</button>
<!-- <button class="hollowFixedBtn" type="button" @click="DownLoadFile()">{{$t('adm.adm_download')}}</button> -->
</li>
</ul>
......@@ -527,6 +527,7 @@
);
},
goUrl(path, id) {
if(id){
this.$store.commit("pageConditionUpdate", this.msg);
this.$router.push({
path: path,
......@@ -536,6 +537,17 @@
tab: '修改产品信息'
}
});
}else{
this.$router.push({
path: path,
query: {
id: 0,
blank: 'y',
tab: '新增产品信息'
}
});
}
},
goUrlT(path, id,Name) {
let data = {
......
<template>
<div>
<div style="text-align: center;display: flex;justify-content: center;">
<el-input class="w300" style="margin-right: 10px;" id="suggestId" v-model="city" placeholder="请输入搜索名称" name="address_detail" />
<input type="button" class="normalBtn sureBtn" value="搜索" @click="search"/>
<el-input class="w300" style="margin-right: 10px;" id="suggestId" v-model="city"
placeholder="请输入需要检索的地名" name="address_detail" @input="search"/>
<!-- <input type="button" class="normalBtn sureBtn" value="搜索" @click="search"/> -->
</div>
<div style="height: 330px;width: 100%;margin-top: 15px;" :id="`allmap_${id}${type}_${index}`"></div>
<div style="height: 320px;width: 100%;margin-top: 15px;" :id="`allmap_${id}${type}_${index}`"></div>
<div style="margin-top: 10px;" v-if="address_detail">当前地址:{{address_detail}}</div>
<div class="btnList">
<input type="button" class="normalBtn sureBtn" value="确定" @click="sendMsg"/>
<input type="button" class="hollowFixedBtn" value="取消" @click="closeDialog"/>
......@@ -19,20 +21,23 @@ export default {
return{
city: '',
address_detail: null, //详细地址
add_housing_list: [""],
userlocation: null,
dataList: null,
point: {
lng:'',
lat: ''
}
},
}
},
watch: {
Address: {
handler(newValue) {
this.city = this.Address
if(!newValue){
this.getcity()
}else{
this.search()
}
},
immediate: true
},
......@@ -47,9 +52,9 @@ export default {
},
sendMsg() {
if (!this.point.lng) {
this.Error("请搜索选择");
this.Error("请点击地图上你需要选择的地址");
} else {
this.$emit("headCallBack", this.point,this.type);
this.$emit("headCallBack", this.point,this.type,this.address_detail);
this.$emit("refList");
}
},
......@@ -69,16 +74,17 @@ export default {
})
local.search(that.city)
map.addEventListener('click', function(e,target) {
var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
map.centerAndZoom(point, 15)
// console.log(e,target)
// // 经度
// console.log(that.userlocation.lng)
// // 纬度
// console.log(that.userlocation.lat)
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// map.centerAndZoom(point, 11)
// that.point = e.point
})
var gc = new BMap.Geocoder();
map.addEventListener('mousedown', function(type) {
var pt = type.point;
gc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
that.address_detail = addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber
})
map.addEventListener('mousedown', function(type, target, point,pixel) {
console.log(type.point, target+'---', point+'---',pixel+'---')
})
},
getcity(){
......@@ -86,22 +92,53 @@ export default {
var that = this
// 创建Map实例
var map = new BMap.Map(`allmap_${that.id}${that.type}_${that.index}`)
// 获取当前位置
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(r){
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
map.panTo(r.point);
that.address_detail = addComp.province + "" + addComp.city + "" + addComp.district + "" + addComp.street + "" + addComp.streetNumber
that.point.lng = r.point.lng
that.point.lat = r.point.lat
console.log(that.address_detail,'城市===')
console.log('您的位置:'+r.point.lng+','+r.point.lat);
}
else {
console.log('failed');
}
});
// 点击地图
map.addEventListener('click', function(e,target) {
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// map.centerAndZoom(point, 11)
// that.point = e.point
})
var gc = new BMap.Geocoder();
map.addEventListener('mousedown', function(type) {
map.centerAndZoom(type.point, 11)
that.point = type.point
var pt = type.point;
gc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
that.address_detail = addComp.province + "" + addComp.city + "" + addComp.district + "" + addComp.street + "" + addComp.streetNumber
})
})
// 初始化地图,设置中心点坐标,
var point = new BMap.Point(120.211877, 30.255194) // 创建点坐标
map.centerAndZoom(point, 15)
if(that.point.lat){
var point = new BMap.Point(that.point.lat, that.point.lng) // 创建点坐标
map.centerAndZoom(point, 11)
}else{
map.centerAndZoom(new BMap.Point(104.073652,30.664369), 11);
}
map.enableScrollWheelZoom()
if(that.Address){
that.search()
}
})
},
// 新增小区 点击的地址增加进list
add_housing() {
this.add_housing_list.push(this.city)
},
// 删除小区
delete_housing(index) {
// console.log(index)
this.add_housing_list.splice(index, 1)
},
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment