Refactor venue booth functions for outdoor fairs
- Renamed `getVenueBoothList` to `getOutdoorFairBoothMap` for clarity. - Updated the endpoint to fetch booth maps for outdoor fairs. - Renamed `saveVenueBoothList` to `saveOutdoorFairBoothMap` to reflect its purpose. - Adjusted the endpoint for saving booth maps for outdoor fairs. - Removed the redundant `getOutdoorFairBoothMap` function as it was previously defined.
This commit is contained in:
@@ -18,6 +18,7 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
const [fairInfo, setFairInfo] = useState<OutdoorFairItem | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [activeTab, setActiveTab] = useState('fair-info');
|
||||
const [fairInfoRefreshKey, setFairInfoRefreshKey] = useState(0);
|
||||
|
||||
const fetchFairInfo = async () => {
|
||||
setLoading(true);
|
||||
@@ -48,6 +49,13 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
{ key: 'statistics', label: '数据统计' },
|
||||
];
|
||||
|
||||
const handleTabChange = (key: string) => {
|
||||
setActiveTab(key);
|
||||
if (key === 'fair-info') {
|
||||
setFairInfoRefreshKey((prev) => prev + 1);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContainer
|
||||
header={{
|
||||
@@ -64,7 +72,7 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
{fairInfo && (
|
||||
<Tabs
|
||||
activeKey={activeTab}
|
||||
onChange={setActiveTab}
|
||||
onChange={handleTabChange}
|
||||
items={tabItems.map((tab) => ({
|
||||
key: tab.key,
|
||||
label: tab.label,
|
||||
@@ -75,6 +83,7 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
<FairInfoTab
|
||||
fairId={fairId}
|
||||
fairInfo={fairInfo}
|
||||
refreshKey={fairInfoRefreshKey}
|
||||
onFairUpdate={fetchFairInfo}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user