From 0e75a67f2811ba3dd9f83441fd03c1df3e1bcc0d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 15 Jan 2023 21:28:04 +0800 Subject: [PATCH] =?UTF-8?q?mp=EF=BC=9A=E8=8F=9C=E5=8D=95=E7=9A=84=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin/src/views/mp/menu/index.vue | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/yudao-ui-admin/src/views/mp/menu/index.vue b/yudao-ui-admin/src/views/mp/menu/index.vue index 9c9c2f666..0ff416dfd 100644 --- a/yudao-ui-admin/src/views/mp/menu/index.vue +++ b/yudao-ui-admin/src/views/mp/menu/index.vue @@ -254,6 +254,7 @@ export default { }, /** 搜索按钮操作 */ handleQuery() { + this.resetForm(); // 默认选中第一个 if (this.accountId) { this.setAccountId(this.accountId) @@ -262,7 +263,7 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - this.resetForm('queryForm') + this.resetForm(); // 默认选中第一个 if (this.accounts.length > 0) { this.setAccountId(this.accounts[0].id) @@ -302,6 +303,23 @@ export default { }); return menuList; }, + // 重置表单,清空表单数据 + resetForm() { + // 菜单操作 + this.isActive = -1; + this.isSubMenuActive = -1; + this.isSubMenuFlag = -1; + + // 菜单编辑 + this.showRightFlag = false; + this.nameMaxLength = 0; + this.showConfigureContent = 0; + this.hackResetWxReplySelect = true; + this.hackResetWxReplySelect = false; + this.tempObj = {}; + this.tempSelfObj = {}; + this.dialogNewsVisible = false; + }, // ======================== 菜单操作 ======================== // 一级菜单点击事件 @@ -397,7 +415,6 @@ export default { this.isSubMenuActive = -1; }).catch(() => {}); }, - // TODO 切换公众号时,清空;或者清空菜单时,也要清空表单; // ======================== 菜单编辑 ======================== handleSave() { @@ -423,7 +440,7 @@ export default { this.loading = true return deleteMenu(this.accountId); }).then(() => { - this.getList(); + this.handleQuery(); this.$modal.msgSuccess("清空成功"); }).catch(() => {}).finally(() => { this.loading = false @@ -494,11 +511,6 @@ export default { url: article.url, }) }) - // this.tempObj.mediaName = item.name - // this.tempObj.url = item.url - // item.mediaType = this.tempObj.mediaType - // item.content.articles = item.content.articles.slice(0,1) - // this.tempObj.content = item.content }, deleteMaterial() { this.$delete(this.tempObj,'articleId')