修复标签模块的分类关联标签搜索以及清除按钮问题

This commit is contained in:
王卓煜
2025-09-09 14:23:36 +08:00
parent a265c226fb
commit e81d81a3ee

View File

@@ -43,7 +43,7 @@
:disabled="!twoList.children.length" :open-delay="0" :close-delay="0" trigger="hover" :disabled="!twoList.children.length" :open-delay="0" :close-delay="0" trigger="hover"
:visible-arrow="false" @hide="leaveIndex" @show="changeIndex(twoList.id)" transition="none"> :visible-arrow="false" @hide="leaveIndex" @show="changeIndex(twoList.id)" transition="none">
<div class="course-two-content" slot="reference">{{ <div class="course-two-content" slot="reference">{{
twoList.name }}</div> twoList.name }}</div>-
<!-- 内容 --> <!-- 内容 -->
<div class="course-three-box"> <div class="course-three-box">
<div class="course-three-box-title"> <div class="course-three-box-title">
@@ -1030,6 +1030,21 @@ handleClearTags() {
item.checked = false; item.checked = false;
}); });
this.course.tags = ''; // 清空标签ID this.course.tags = ''; // 清空标签ID
// 添加清除三级分类的逻辑
this.oneList.forEach(one => {
one.checked = false;
one.children.forEach(two => {
two.checked = false;
two.children.forEach(three => {
three.checked = false;
});
});
});
// 清空导航标题
this.navTitle = [];
this.searchData(); this.searchData();
}, },
// 导航切换(录播课,线下课,学习项目) // 导航切换(录播课,线下课,学习项目)
@@ -1061,7 +1076,6 @@ handleClearTags() {
handleOptionClick(item, level, list) { handleOptionClick(item, level, list) {
// 线上品牌展示效果 // 线上品牌展示效果
this.newData = item.newData; this.newData = item.newData;
console.log(this.newData);
// 单选,排除法 // 单选,排除法
this.oneList.forEach(one => { this.oneList.forEach(one => {
one.checked = false; one.checked = false;
@@ -1536,7 +1550,18 @@ handleClearTags() {
that.course.sysType3 += item.id; that.course.sysType3 += item.id;
} }
}); });
apiCourseTag.getHotTagList(that.course).then(rs => {
if (rs.status == 200) {
// 保留已选中标签的状态
const currentCheckedTags = this.hotTagsList.filter(tag => tag.checked);
this.hotTagsList = rs.result.map(tag => ({
...tag,
checked: currentCheckedTags.some(checkedTag => checkedTag.id === tag.id)
}));
} else {
console.log(rs.message);
}
}),
this.isFind = true; this.isFind = true;
this.course.device = 1; this.course.device = 1;
if (this.course.pageIndex == 1) { if (this.course.pageIndex == 1) {