🏷️ chore(ui): Hide Type Tabs in Tag-Aggregation Mode & Refine Query Logic
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.
This commit is contained in:
@@ -867,7 +867,7 @@ const ChannelsTable = () => {
|
|||||||
const loadChannels = async (page, pageSize, idSort, enableTagMode, typeKey = activeTypeKey) => {
|
const loadChannels = async (page, pageSize, idSort, enableTagMode, typeKey = activeTypeKey) => {
|
||||||
const reqId = ++requestCounter.current; // 记录当前请求序号
|
const reqId = ++requestCounter.current; // 记录当前请求序号
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const typeParam = typeKey === 'all' ? '' : `&type=${typeKey}`;
|
const typeParam = (!enableTagMode && typeKey !== 'all') ? `&type=${typeKey}` : '';
|
||||||
const res = await API.get(
|
const res = await API.get(
|
||||||
`/api/channel/?p=${page}&page_size=${pageSize}&id_sort=${idSort}&tag_mode=${enableTagMode}${typeParam}`,
|
`/api/channel/?p=${page}&page_size=${pageSize}&id_sort=${idSort}&tag_mode=${enableTagMode}${typeParam}`,
|
||||||
);
|
);
|
||||||
@@ -1046,7 +1046,7 @@ const ChannelsTable = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeParam = activeTypeKey === 'all' ? '' : `&type=${activeTypeKey}`;
|
const typeParam = (!enableTagMode && activeTypeKey !== 'all') ? `&type=${activeTypeKey}` : '';
|
||||||
const res = await API.get(
|
const res = await API.get(
|
||||||
`/api/channel/search?keyword=${searchKeyword}&group=${searchGroup}&model=${searchModel}&id_sort=${idSort}&tag_mode=${enableTagMode}${typeParam}`,
|
`/api/channel/search?keyword=${searchKeyword}&group=${searchGroup}&model=${searchModel}&id_sort=${idSort}&tag_mode=${enableTagMode}${typeParam}`,
|
||||||
);
|
);
|
||||||
@@ -1212,6 +1212,8 @@ const ChannelsTable = () => {
|
|||||||
}, [channelTypeCounts]);
|
}, [channelTypeCounts]);
|
||||||
|
|
||||||
const renderTypeTabs = () => {
|
const renderTypeTabs = () => {
|
||||||
|
if (enableTagMode) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<Tabs
|
||||||
activeKey={activeTypeKey}
|
activeKey={activeTypeKey}
|
||||||
|
|||||||
Reference in New Issue
Block a user