From e844f1669cf02dd71b0c2637ae03d9563ed37403 Mon Sep 17 00:00:00 2001 From: likexuan Date: Wed, 23 Nov 2022 15:38:56 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E6=9B=B4=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/rightBox/administration/modelBox.vue | 5 +---- nezha-fronted/src/components/common/rightBox/moduleBox.vue | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue b/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue index dad62e67e..f07ee60cf 100644 --- a/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue @@ -183,10 +183,7 @@ export default { if (valid) { const params = { ...this.editModel, - panelId: Number(this.editModel.panelId) - } - if (Number(this.editModel.panelId) == 0) { - delete params.panelId + panelId: this.editModel.panelId == '' ? null : Number(this.editModel.panelId) } if (this.editModel.id) { this.$put(this.url, params).then(res => { diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index face0a1b4..13d9aa600 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -1109,9 +1109,7 @@ export default { } if (valid) { this.prevent_opt.save = true - if (Number(this.editModule.panelId) !== 0) { - params.panelId = Number(this.editModule.panelId) - } + params.panelId = this.editModule.panelId !== '' ? Number(this.editModule.panelId) : null if (this.editModule.id) { this.$put('monitor/module', params).then(response => { if (response.code === 200) {