From fb07c111c5a30c6c4258a19e8aa8e46290e52568 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 4 Jun 2021 15:11:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(fix):=E6=A8=A1=E7=89=88=E7=AE=A1=E7=90=86f?= =?UTF-8?q?orm=E6=A0=A1=E9=AA=8Cfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/template/index.vue | 23 ++++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/panel/template/index.vue b/frontend/src/views/panel/template/index.vue index 41b19b0b0f..01ec18bf26 100644 --- a/frontend/src/views/panel/template/index.vue +++ b/frontend/src/views/panel/template/index.vue @@ -139,17 +139,24 @@ export default { this.showTemplateEditDialog('edit', templateInfo) }, saveTemplateEdit(templateEditForm) { - save(templateEditForm).then(response => { - this.$message({ - message: this.$t('commons.save_success'), - type: 'success', - showClose: true - }) - this.editTemplate = false - this.getTree() + this.$refs['templateEditForm'].validate((valid) => { + if (valid) { + save(templateEditForm).then(response => { + this.close() + this.$message({ + message: this.$t('commons.save_success'), + type: 'success', + showClose: true + }) + this.getTree() + }) + } else { + return false + } }) }, close() { + this.$refs['templateEditForm'].resetFields() this.editTemplate = false }, getTree() {