|
@@ -26,7 +26,7 @@
|
|
placeholder="请输入经纬度 (格式:纬度,经度,可通过右侧地图小按钮获取)"
|
|
placeholder="请输入经纬度 (格式:纬度,经度,可通过右侧地图小按钮获取)"
|
|
clearable
|
|
clearable
|
|
>
|
|
>
|
|
- <el-button slot="append" icon="el-icon-map-location" @click="dialogMapVisible = true" />
|
|
|
|
|
|
+ <el-button slot="append" icon="el-icon-map-location" @click="initMap" />
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="联系电话:" prop="mobile">
|
|
<el-form-item label="联系电话:" prop="mobile">
|
|
@@ -128,7 +128,8 @@
|
|
width="80%"
|
|
width="80%"
|
|
>
|
|
>
|
|
<!-- <location v-if="dialogMapVisible" :init-point="formData.point" @point="handlePointChange" /> -->
|
|
<!-- <location v-if="dialogMapVisible" :init-point="formData.point" @point="handlePointChange" /> -->
|
|
- <map-ui v-if="dialogMapVisible" :init-point="formData.point" :address="locationAddress" @change="markerChange" />
|
|
|
|
|
|
+ <!-- <map-ui v-if="dialogMapVisible" :init-point="formData.point" :address="locationAddress" @change="markerChange" /> -->
|
|
|
|
+ <a-map ref="aMap" :lnglat="lnglat" :address="locationAddress" @position="onPosition" />
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" size="mini" @click="dialogMapVisible = false">确 定</el-button>
|
|
<el-button type="primary" size="mini" @click="dialogMapVisible = false">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -139,6 +140,7 @@
|
|
<script>
|
|
<script>
|
|
// import Location from '@/components/location'
|
|
// import Location from '@/components/location'
|
|
import AMapUI from '@/components/AMapUI'
|
|
import AMapUI from '@/components/AMapUI'
|
|
|
|
+import SimpleAMap from '@/components/SimpleAMap'
|
|
import UploadImage from '@/components/UploadImage'
|
|
import UploadImage from '@/components/UploadImage'
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
import { saveBrandAuth, getAuthFormData } from '@/api/auth'
|
|
import { saveBrandAuth, getAuthFormData } from '@/api/auth'
|
|
@@ -149,6 +151,7 @@ export default {
|
|
components: {
|
|
components: {
|
|
// Location
|
|
// Location
|
|
[AMapUI.name]: AMapUI,
|
|
[AMapUI.name]: AMapUI,
|
|
|
|
+ [SimpleAMap.name]: SimpleAMap,
|
|
UploadImage
|
|
UploadImage
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -256,7 +259,12 @@ export default {
|
|
},
|
|
},
|
|
// 定位使用的地址
|
|
// 定位使用的地址
|
|
locationAddress() {
|
|
locationAddress() {
|
|
|
|
+ // 广东省/深圳市/福田区景峰大厦
|
|
return this.address + this.formData.fullAddress
|
|
return this.address + this.formData.fullAddress
|
|
|
|
+ },
|
|
|
|
+ // 位置坐标
|
|
|
|
+ lnglat() {
|
|
|
|
+ return this.formData.point ? this.formData.point.split(',') : null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -265,6 +273,19 @@ export default {
|
|
this.initFormData()
|
|
this.initFormData()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 地图定位
|
|
|
|
+ initMap() {
|
|
|
|
+ this.dialogMapVisible = true
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.aMap.init()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取位置坐标
|
|
|
|
+ onPosition(lnglat) {
|
|
|
|
+ this.formData.point = `${lnglat.lng},${lnglat.lat}`
|
|
|
|
+ },
|
|
|
|
+
|
|
// 自定义属性修改
|
|
// 自定义属性修改
|
|
custromizeFormChange(data) {
|
|
custromizeFormChange(data) {
|
|
this.customValue = data.name
|
|
this.customValue = data.name
|