diff --git a/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue b/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue index e010c8d2b..dad62e67e 100644 --- a/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/administration/modelBox.vue @@ -148,9 +148,6 @@ export default { ], sysObjectId: [ { validator: sysObjectIdInput, trigger: 'blur' } - ], - panelId: [ - { required: true, message: this.$t('validate.required'), trigger: ['blur', 'change'] } ] } } @@ -164,13 +161,6 @@ export default { this.editModel = JSON.parse(JSON.stringify(n)) this.editModel.panelId = n.panelId ? n.panelId + '' : '' } - }, - 'editModel.panelId': { - handler (n) { - if (n) { - this.$refs.dashboardTemplate.$emit('el.form.change') - } - } } }, created () { @@ -195,6 +185,9 @@ export default { ...this.editModel, panelId: Number(this.editModel.panelId) } + if (Number(this.editModel.panelId) == 0) { + delete params.panelId + } if (this.editModel.id) { this.$put(this.url, params).then(res => { this.prevent_opt.save = false diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index 64db27437..face0a1b4 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -800,9 +800,6 @@ export default { ], timeout: [ { validator: nzNumber, trigger: 'blur' } - ], - panelId: [ - { required: true, message: this.$t('validate.required'), trigger: ['blur', 'change'] } ] }, projectList: [], @@ -1112,7 +1109,9 @@ export default { } if (valid) { this.prevent_opt.save = true - params.panelId = Number(this.editModule.panelId) + if (Number(this.editModule.panelId) !== 0) { + params.panelId = Number(this.editModule.panelId) + } if (this.editModule.id) { this.$put('monitor/module', params).then(response => { if (response.code === 200) { @@ -1687,13 +1686,6 @@ export default { this.configsCopyValue = JSON.stringify(params, null, 2) } } - }, - 'editModule.panelId': { - handler (n) { - if (n) { - this.$refs.dashboardTemplate.$emit('el.form.change') - } - } } } }