Skip to content

Commit d3cdcf9

Browse files
author
Taois
committed
feat:目录筛选,以后用
1 parent 033b753 commit d3cdcf9

File tree

1 file changed

+47
-9
lines changed

1 file changed

+47
-9
lines changed

dashboard/src/components/VideoList.vue

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ import { ref, reactive, onMounted, watch, computed, nextTick } from "vue";
121121
import { usePaginationStore } from '@/stores/paginationStore';
122122
import { getCategoryData } from '@/api/modules/module';
123123
import { processExtendParam } from '@/utils/apiUtils';
124+
import { encodeFilters } from '@/api/utils';
124125
import CategoryNavigation from './CategoryNavigation.vue';
125126
import FilterSection from './FilterSection.vue';
126127
import VideoGrid from './VideoGrid.vue';
@@ -248,13 +249,25 @@ const toggleFilter = (filterKey, filterValue, filterName) => {
248249
selectedFilters[activeKey.value][filterKey] = filterValue;
249250
}
250251
251-
// 重新获取数据
252-
refreshCategoryData(activeKey.value);
252+
// 如果在目录模式下,重新获取目录数据
253+
if (props.folderNavigationState.isActive && props.folderNavigationState.currentBreadcrumb) {
254+
handleFolderNavigate(props.folderNavigationState.currentBreadcrumb);
255+
} else {
256+
// 重新获取分类数据
257+
refreshCategoryData(activeKey.value);
258+
}
253259
};
254260
255261
const resetFilters = (categoryId) => {
256262
delete selectedFilters[categoryId];
257-
refreshCategoryData(categoryId);
263+
264+
// 如果在目录模式下,重新获取目录数据
265+
if (props.folderNavigationState.isActive && props.folderNavigationState.currentBreadcrumb) {
266+
handleFolderNavigate(props.folderNavigationState.currentBreadcrumb);
267+
} else {
268+
// 重新获取分类数据
269+
refreshCategoryData(categoryId);
270+
}
258271
};
259272
260273
const refreshCategoryData = (categoryId) => {
@@ -682,13 +695,26 @@ const handleFolderNavigateFromGrid = async (video) => {
682695
emit('folder-navigate', loadingState);
683696
console.log('props.extend:',props.extend)
684697
console.log('processExtendParam(props.extend):',processExtendParam(props.extend))
685-
// 调用T4分类接口
686-
const response = await getCategoryData(props.module, {
698+
699+
// 获取当前分类的筛选条件
700+
const filters = selectedFilters[activeKey.value] || {};
701+
console.log('🗂️ [DEBUG] 目录模式应用筛选条件:', filters);
702+
703+
// 调用T4分类接口,包含筛选条件
704+
const requestParams = {
687705
t: video.vod_id, // 使用vod_id作为type_id
688706
pg: 1,
689707
extend: processExtendParam(props.extend),
690708
apiUrl: props.apiUrl
691-
});
709+
};
710+
711+
// 如果有筛选条件,添加ext参数
712+
if (Object.keys(filters).length > 0) {
713+
// requestParams.ext = encodeFilters(filters);
714+
console.log('🗂️ [DEBUG] 目录模式编码后的筛选条件:', requestParams.ext);
715+
}
716+
717+
const response = await getCategoryData(props.module, requestParams);
692718
693719
console.log('🗂️ [DEBUG] T4分类接口响应:', response);
694720
@@ -785,13 +811,25 @@ const handleFolderNavigate = async (breadcrumb) => {
785811
786812
emit('folder-navigate', loadingState);
787813
788-
// 调用T4分类接口
789-
const response = await getCategoryData(props.module, {
814+
// 获取当前分类的筛选条件
815+
const filters = selectedFilters[activeKey.value] || {};
816+
console.log('🗂️ [DEBUG] 面包屑导航应用筛选条件:', filters);
817+
818+
// 调用T4分类接口,包含筛选条件
819+
const requestParams = {
790820
t: breadcrumb.vod_id,
791821
pg: 1,
792822
extend: processExtendParam(props.extend),
793823
apiUrl: props.apiUrl
794-
});
824+
};
825+
826+
// 如果有筛选条件,添加ext参数
827+
if (Object.keys(filters).length > 0) {
828+
// requestParams.ext = encodeFilters(filters);
829+
console.log('🗂️ [DEBUG] 面包屑导航编码后的筛选条件:', requestParams.ext);
830+
}
831+
832+
const response = await getCategoryData(props.module, requestParams);
795833
796834
if (response && response.list && response.list.length > 0) {
797835
const folderData = response.list;

0 commit comments

Comments
 (0)