Skip to content

Commit f8c4387

Browse files
committed
mp:菜单的清空处理
1 parent 59777cd commit f8c4387

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/views/mp/menu/index.vue

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ export default {
254254
},
255255
/** 搜索按钮操作 */
256256
handleQuery() {
257+
this.resetForm();
257258
// 默认选中第一个
258259
if (this.accountId) {
259260
this.setAccountId(this.accountId)
@@ -262,7 +263,7 @@ export default {
262263
},
263264
/** 重置按钮操作 */
264265
resetQuery() {
265-
this.resetForm('queryForm')
266+
this.resetForm();
266267
// 默认选中第一个
267268
if (this.accounts.length > 0) {
268269
this.setAccountId(this.accounts[0].id)
@@ -302,6 +303,23 @@ export default {
302303
});
303304
return menuList;
304305
},
306+
// 重置表单,清空表单数据
307+
resetForm() {
308+
// 菜单操作
309+
this.isActive = -1;
310+
this.isSubMenuActive = -1;
311+
this.isSubMenuFlag = -1;
312+
313+
// 菜单编辑
314+
this.showRightFlag = false;
315+
this.nameMaxLength = 0;
316+
this.showConfigureContent = 0;
317+
this.hackResetWxReplySelect = true;
318+
this.hackResetWxReplySelect = false;
319+
this.tempObj = {};
320+
this.tempSelfObj = {};
321+
this.dialogNewsVisible = false;
322+
},
305323
306324
// ======================== 菜单操作 ========================
307325
// 一级菜单点击事件
@@ -397,7 +415,6 @@ export default {
397415
this.isSubMenuActive = -1;
398416
}).catch(() => {});
399417
},
400-
// TODO 切换公众号时,清空;或者清空菜单时,也要清空表单;
401418
402419
// ======================== 菜单编辑 ========================
403420
handleSave() {
@@ -423,7 +440,7 @@ export default {
423440
this.loading = true
424441
return deleteMenu(this.accountId);
425442
}).then(() => {
426-
this.getList();
443+
this.handleQuery();
427444
this.$modal.msgSuccess("清空成功");
428445
}).catch(() => {}).finally(() => {
429446
this.loading = false
@@ -494,11 +511,6 @@ export default {
494511
url: article.url,
495512
})
496513
})
497-
// this.tempObj.mediaName = item.name
498-
// this.tempObj.url = item.url
499-
// item.mediaType = this.tempObj.mediaType
500-
// item.content.articles = item.content.articles.slice(0,1)
501-
// this.tempObj.content = item.content
502514
},
503515
deleteMaterial() {
504516
this.$delete(this.tempObj,'articleId')

0 commit comments

Comments
 (0)