diff --git a/src/views/tag/index.vue b/src/views/tag/index.vue index d61c273..a4ab137 100644 --- a/src/views/tag/index.vue +++ b/src/views/tag/index.vue @@ -96,9 +96,8 @@ plain icon="el-icon-full-screen" type="primary" - v-if="tagType === 1" @click="handleChangeChildrenTag" - >查看二级{{ ["", "查看二级", "查看一级"][tagType] }} @@ -595,14 +594,24 @@ export default { * 查看二级按钮点击事件 */ handleChangeChildrenTag() { - this.tagType = 2; - // 搜索条件重置 - this.queryForm.data.level = 2; - this.handleResetClick(); - // 弹窗内容重置 - this.modifyDialog.form.rules["parentId"] = [ - { required: true, message: "请选择父级", trigger: "change" } - ]; + if (this.tagType === 1) { + this.tagType = 2; + // 搜索条件重置 + this.queryForm.data.level = 2; + this.handleResetClick(); + // 弹窗内容重置 + this.modifyDialog.form.rules["parentId"] = [ + { required: true, message: "请选择父级", trigger: "change" } + ]; + } else { + this.tagType = 1; + // 搜索条件重置 + this.queryForm.data.level = 1; + this.handleResetClick(); + // 弹窗内容重置 + delete this.modifyDialog.form.rules["parentId"]; + } + // 表格、分页重置 this.table.data = []; this.table.page.current = 1;