From fa6fdb103bb846d3d0ef523fadecdad708c91e79 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Tue, 21 Dec 2021 18:52:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DdcBox=20=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=A1=86=E4=B8=8D=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/dcBox.vue | 11 +++-------- nezha-fronted/src/components/page/config/dc.vue | 11 +++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/dcBox.vue b/nezha-fronted/src/components/common/rightBox/dcBox.vue index 7f2d1306c..a58822fa1 100644 --- a/nezha-fronted/src/components/common/rightBox/dcBox.vue +++ b/nezha-fronted/src/components/common/rightBox/dcBox.vue @@ -199,14 +199,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 970e51138..666b46b28 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