diff --git a/nezha-fronted/src/components/common/rightBox/dcBox.vue b/nezha-fronted/src/components/common/rightBox/dcBox.vue index 8cfb84fb5..226df3eaa 100644 --- a/nezha-fronted/src/components/common/rightBox/dcBox.vue +++ b/nezha-fronted/src/components/common/rightBox/dcBox.vue @@ -197,14 +197,9 @@ export default { handler (n, o) { this.isEdit = true if (!n.id) { - this.$get('/sysConfig?paramKey=map_center_config').then(response => { - if (response.code === 200) { - const mapParam = JSON.parse(response.data.paramKey.map_center_config) - this.editDc = { ...JSON.parse(JSON.stringify(n)), lnglat: `${mapParam.longitude},${mapParam.latitude}` } - this.$nextTick(() => { - this.$refs.latlngPicker.setLnglat(this.editDc.latitude, this.editDc.longitude) - }) - } + this.editDc = { ...JSON.parse(JSON.stringify(n)), lnglat: `${n.longitude},${n.latitude}` } + this.$nextTick(() => { + this.$refs.latlngPicker.setLnglat(this.editDc.latitude, this.editDc.longitude) }) } else { this.editDc = { ...JSON.parse(JSON.stringify(n)), lnglat: `${n.longitude},${n.latitude}` } diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index fc98250f1..a10aa696d 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -245,6 +245,17 @@ export default { addCabinet () { this.cabinetBoxShow = true }, + add () { + this.$get('/sysConfig?paramKey=map_center_config').then(response => { + if (response.code === 200) { + const mapParam = JSON.parse(response.data.paramKey.map_center_config) + this.object = this.newObject() + this.object.longitude = mapParam.longitude + this.object.latitude = mapParam.latitude + this.rightBox.show = true + } + }) + }, closeRightBox (refresh) { this.rightBox.show = false this.cabinetBoxShow = false