IO-2280 fixed query params in shop config

This commit is contained in:
swtmply
2023-06-06 22:20:22 +08:00
parent 0669282432
commit 5a3ddfad0f
3 changed files with 10 additions and 2 deletions

View File

@@ -311,7 +311,9 @@ function Header({
icon={<SettingOutlined />} icon={<SettingOutlined />}
> >
<Menu.Item key="shop" icon={<Icon component={GiSettingsKnobs} />}> <Menu.Item key="shop" icon={<Icon component={GiSettingsKnobs} />}>
<Link to="/manage/shop">{t("menus.header.shop_config")}</Link> <Link to="/manage/shop?tab=info">
{t("menus.header.shop_config")}
</Link>
</Menu.Item> </Menu.Item>
<Menu.Item key="dashboard" icon={<DashboardFilled />}> <Menu.Item key="dashboard" icon={<DashboardFilled />}>
<Link to="/manage/dashboard">{t("menus.header.dashboard")}</Link> <Link to="/manage/dashboard">{t("menus.header.dashboard")}</Link>

View File

@@ -52,7 +52,9 @@ export function ShopInfoComponent({ bodyshop, form, saveLoading }) {
<Tabs <Tabs
defaultActiveKey={search.subtab} defaultActiveKey={search.subtab}
onChange={(key) => onChange={(key) =>
history.push({ search: `?tab=${search.tab}&subtab=${key}` }) history.push({
search: `?tab=${search.tab}&subtab=${key}`,
})
} }
> >
<Tabs.TabPane key="general" tab={t("bodyshop.labels.shopinfo")}> <Tabs.TabPane key="general" tab={t("bodyshop.labels.shopinfo")}>

View File

@@ -40,6 +40,10 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
]); ]);
}, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]); }, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]);
useEffect(() => {
if (!search.tab) history.push({ search: "?tab=info" });
}, [history, search]);
return ( return (
<RbacWrapper action="shop:config"> <RbacWrapper action="shop:config">
<Tabs <Tabs