From 932c9112dff07cdeaae9fc10454f2bf55e9e6b1a Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 21 Dec 2021 18:28:54 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E4=BF=AE=E6=94=B9=20dcbox=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=B8=8D=E6=8F=90=E7=A4=BA=E5=B7=B2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9A=84=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 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