Merge branch 'master-20251023-tag' into test1024

This commit is contained in:
670788339
2025-11-04 17:17:15 +08:00

View File

@@ -330,7 +330,7 @@
class="option-item" style="font-weight: bold; padding-top: 2px;" class="option-item" style="font-weight: bold; padding-top: 2px;"
v-for="tag in hotTagsList" v-for="tag in hotTagsList"
:key="tag.id" :key="tag.id"
@click="handleTagClick(tag, hotTagsList)" @click="handleTagClick(tag, hotTagsList,1)"
:class="{ 'option-active': tag.checked }" :class="{ 'option-active': tag.checked }"
> >
<span>{{tag.tagName}}</span> <span>{{tag.tagName}}</span>
@@ -1075,7 +1075,7 @@ handleClearTags() {
this.searchData(); this.searchData();
}, },
//点击标签 //点击标签
handleTagClick(item, list) { handleTagClick(item, list,type) {
item.checked = !item.checked; item.checked = !item.checked;
// 更新course.tags // 更新course.tags
@@ -1085,7 +1085,7 @@ handleClearTags() {
// 强制触发stagList重新计算 // 强制触发stagList重新计算
this.$nextTick(() => { this.$nextTick(() => {
// this.searchData(); this.searchData(type);
}); });
}, },
//三级分类 //三级分类
@@ -1327,13 +1327,13 @@ handleClearTags() {
this.$refs.floatTools.toNeedCourse(); this.$refs.floatTools.toNeedCourse();
}, },
searchData() { searchData(type) {
this.course.pageIndex = 1; this.course.pageIndex = 1;
this.noPageList = true; //判断接口是否还有数据 this.noPageList = true; //判断接口是否还有数据
this.noDataList = true; //判断接口是否还有数据 this.noDataList = true; //判断接口是否还有数据
this.courseList = []; this.courseList = [];
this.totalPages = 4; this.totalPages = 4;
this.search(); this.search(type);
}, },
inputOn() { inputOn() {
this.$forceUpdate(); this.$forceUpdate();
@@ -1499,7 +1499,7 @@ handleClearTags() {
return list; return list;
}, },
// 查询 // 查询
async search() { async search(type) {
// //
if (this.searching) { if (this.searching) {
this.$message.warning("正在搜索中,请待搜索完成后再重新搜索"); this.$message.warning("正在搜索中,请待搜索完成后再重新搜索");
@@ -1543,18 +1543,20 @@ handleClearTags() {
that.course.sysType3 += item.id; that.course.sysType3 += item.id;
} }
}); });
apiCourseTag.getHotTagList(that.course).then(rs => { if (!type && type !== 1){
if (rs.status == 200) { apiCourseTag.getHotTagList(that.course).then(rs => {
// 保留已选中标签的状态 if (rs.status == 200) {
const currentCheckedTags = this.hotTagsList.filter(tag => tag.checked); // 保留已选中标签的状态
this.hotTagsList = rs.result.map(tag => ({ const currentCheckedTags = this.hotTagsList.filter(tag => tag.checked);
...tag, this.hotTagsList = rs.result.map(tag => ({
checked: currentCheckedTags.some(checkedTag => checkedTag.id === tag.id) ...tag,
})); checked: currentCheckedTags.some(checkedTag => checkedTag.id === tag.id)
} else { }));
console.log(rs.message); } 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) {