From 3746482e8cbc5efdd0ab56a3aa86458aa528c6a6 Mon Sep 17 00:00:00 2001 From: "Apple\\Apple" Date: Wed, 18 Jun 2025 02:59:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20chore(ui):=20Hide=20Typ?= =?UTF-8?q?e=20Tabs=20in=20Tag-Aggregation=20Mode=20&=20Refine=20Query=20L?= =?UTF-8?q?ogic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit frontend(ChannelsTable): • Do not render type-filter Tabs when `enableTagMode` is true, preventing UI/logic conflicts in tag aggregation view. • Adjust API query construction: – Append `type=` param only when NOT in tag mode and selected tab ≠ 'all'. – Applies to both `loadChannels` and `searchChannels`. • Result: UI stays clean in tag view, and backend receives correct parameters across modes. No other functionality affected. --- web/src/components/table/ChannelsTable.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/components/table/ChannelsTable.js b/web/src/components/table/ChannelsTable.js index a18920ab..90921460 100644 --- a/web/src/components/table/ChannelsTable.js +++ b/web/src/components/table/ChannelsTable.js @@ -867,7 +867,7 @@ const ChannelsTable = () => { const loadChannels = async (page, pageSize, idSort, enableTagMode, typeKey = activeTypeKey) => { const reqId = ++requestCounter.current; // 记录当前请求序号 setLoading(true); - const typeParam = typeKey === 'all' ? '' : `&type=${typeKey}`; + const typeParam = (!enableTagMode && typeKey !== 'all') ? `&type=${typeKey}` : ''; const res = await API.get( `/api/channel/?p=${page}&page_size=${pageSize}&id_sort=${idSort}&tag_mode=${enableTagMode}${typeParam}`, ); @@ -1046,7 +1046,7 @@ const ChannelsTable = () => { return; } - const typeParam = activeTypeKey === 'all' ? '' : `&type=${activeTypeKey}`; + const typeParam = (!enableTagMode && activeTypeKey !== 'all') ? `&type=${activeTypeKey}` : ''; const res = await API.get( `/api/channel/search?keyword=${searchKeyword}&group=${searchGroup}&model=${searchModel}&id_sort=${idSort}&tag_mode=${enableTagMode}${typeParam}`, ); @@ -1212,6 +1212,8 @@ const ChannelsTable = () => { }, [channelTypeCounts]); const renderTypeTabs = () => { + if (enableTagMode) return null; + return (