fix: 修改 dc新增坐标默认为system设置的地图中心坐标
This commit is contained in:
@@ -42,23 +42,19 @@ export default {
|
||||
mapConfigVisible: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
if (this.initData) {
|
||||
this.mapParam = JSON.parse(JSON.stringify(this.initData))
|
||||
} else {
|
||||
this.queryDefaultMapConfig()
|
||||
}
|
||||
this.lnglat = this.mapParam.longitude + ',' + this.mapParam.latitude
|
||||
},
|
||||
watch: {
|
||||
initData: {
|
||||
immediate: true,
|
||||
handler () {
|
||||
console.log(this.initData)
|
||||
if (this.initData) {
|
||||
this.mapParam = JSON.parse(JSON.stringify(this.initData))
|
||||
} else {
|
||||
this.queryDefaultMapConfig()
|
||||
}
|
||||
this.lnglat = this.mapParam.longitude + ',' + this.mapParam.latitude
|
||||
} else {
|
||||
this.queryDefaultMapConfig().then(() => {
|
||||
this.lnglat = this.mapParam.longitude + ',' + this.mapParam.latitude
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -152,11 +148,15 @@ export default {
|
||||
}
|
||||
},
|
||||
queryDefaultMapConfig: function () {
|
||||
return new Promise(resolve => {
|
||||
this.$get('/sysConfig?paramKey=map_center_config').then(response => {
|
||||
if (response.code == 200) {
|
||||
console.log(response)
|
||||
this.mapParam = JSON.parse(response.data.paramKey.map_center_config)
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<!--</select-area>-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item :label="$t('config.dc.lnglat')" prop="state">
|
||||
<latlng-picker ref="latlngPicker" :append-to-body="false" :show-zoom="false"></latlng-picker>
|
||||
<latlng-picker ref="latlngPicker" :append-to-body="false" :show-zoom="false" :init-data= ' editDc.latitude? {latitude:editDc.latitude,longitude:editDc.longitude} : "" '></latlng-picker>
|
||||
</el-form-item>
|
||||
<el-form-item :label='$t("config.dc.state")' prop="state">
|
||||
<el-switch
|
||||
|
||||
Reference in New Issue
Block a user