功能完善

This commit is contained in:
lzh
2023-02-12 19:08:38 +08:00
parent 9a3693f2c8
commit c6c6e72936
51 changed files with 5015 additions and 3847 deletions

View File

@@ -8,8 +8,8 @@
<el-form-item label="小区栋数:" prop="counts">
<el-input v-model="community.counts"></el-input>
</el-form-item>
<el-form-item label="小区地址:" prop="address">
<el-input v-model="community.address"></el-input>
<el-form-item label="小区地址:" prop="details">
<el-input v-model="community.details"></el-input>
</el-form-item>
<el-form-item label="地标:" prop="nearbyLandmarks">
@@ -19,6 +19,9 @@
<el-form-item label="电话:" prop="phone">
<el-input v-model="community.phone"></el-input>
</el-form-item>
<el-form-item label="照片:" prop="pic">
<single-upload v-model="community.pic"></single-upload>
</el-form-item>
<el-form-item label="地图:" prop="phone">
<input v-model.number="center.lng" />
@@ -41,7 +44,7 @@
:copyright="[{id: 1, content: 'Copyright Message', bounds: {ne: {lng: 110, lat: 40}, sw:{lng: 0, lat: 0}}}, {id: 2, content: '<a>宇运动多租户商城</a>'}]">
</bm-copyright>
<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT" @changeAfter="changeAfters"></bm-city-list>
<bm-marker :position="center" :dragging="false" />
<!-- <bm-local-search :keyword="keyword" :auto-viewport="true" :location="location"></bm-local-search>-->
</baidu-map>
@@ -60,6 +63,7 @@
import BmCityList from 'vue-baidu-map/components/controls/CityList';
import BmCopyright from 'vue-baidu-map/components/controls/Copyright';
import BmView from 'vue-baidu-map/components/map/MapView';
import BmMarker from 'vue-baidu-map/components/overlays/Marker'
import {createCommunity, getCommunity, updateCommunity} from '@/api/build/community'
import SingleUpload from '@/components/Upload/singleUpload'
import {formatDate} from '@/utils/date';
@@ -68,7 +72,7 @@
};
export default {
name: 'CommunityDetail',
components:{SingleUpload,BaiduMap,BmLocalSearch,BmCityList,BmView,BmCopyright},
components:{SingleUpload,BaiduMap,BmLocalSearch,BmCityList,BmView,BmCopyright,BmMarker},
props: {
isEdit: {
type: Boolean,
@@ -108,6 +112,15 @@
if (this.isEdit) {
getCommunity(this.$route.query.id).then(response => {
this.community = response.data;
if(this.community.latitude){
this.center.lat=this.community.latitude;
}
if(this.community.longitude){
this.center.lng=this.community.longitude;
}
if(this.community.city){
this.location=this.community.city;
}
});
}else{
this.community = Object.assign({},defaultCommunity);