parent
0a98e7e8f2
commit
93b7abbd30
5
.changeset/five-walls-enjoy.md
Normal file
5
.changeset/five-walls-enjoy.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@hera/plugin-core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
修复页面 tab 问题
|
@ -95,6 +95,7 @@
|
|||||||
"@nocobase/schema": "0.21.2-alpha.4"
|
"@nocobase/schema": "0.21.2-alpha.4"
|
||||||
},
|
},
|
||||||
"changesets": [
|
"changesets": [
|
||||||
|
"five-walls-enjoy",
|
||||||
"hot-mugs-double",
|
"hot-mugs-double",
|
||||||
"long-dolphins-sit",
|
"long-dolphins-sit",
|
||||||
"pretty-wolves-allow",
|
"pretty-wolves-allow",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hera/plugin-core",
|
"name": "@hera/plugin-core",
|
||||||
"displayName": "Hera platform",
|
"displayName": "Hera platform",
|
||||||
"version": "1.7.4-alpha.7",
|
"version": "1.7.4-alpha.8",
|
||||||
"description": "Hera platform as nocobase plugin.",
|
"description": "Hera platform as nocobase plugin.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"System management"
|
"System management"
|
||||||
|
@ -215,27 +215,28 @@ export const InternalAdminLayout = (props: any) => {
|
|||||||
const params = useParams<{ name?: string }>();
|
const params = useParams<{ name?: string }>();
|
||||||
const { token } = useToken();
|
const { token } = useToken();
|
||||||
const { render } = useAppSpin();
|
const { render } = useAppSpin();
|
||||||
const { title } = useDocumentTitle();
|
const { title, setTitle } = useDocumentTitle();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [items, setItems] = useState<TabsProps['items']>([]);
|
const [items, setItems] = useState<TabsProps['items']>([]);
|
||||||
const pageStyle = usePageStyle();
|
const pageStyle = usePageStyle();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (params.name && title && pageStyle === 'tab') {
|
if (params.name && title && pageStyle === 'tab') {
|
||||||
setItems((items) => {
|
const targetItem = items.find((value) => value.key === params.name);
|
||||||
if (!items.find((value) => value.key === params.name)) {
|
if (!targetItem) {
|
||||||
return [
|
// 现有tab页数组里,不存在之前浏览的tab页面,添加新的tab页进数组
|
||||||
...items,
|
setItems([
|
||||||
{
|
...items,
|
||||||
key: params.name,
|
{
|
||||||
label: title,
|
key: params.name,
|
||||||
children: <MyRouteSchemaComponent name={params.name} />,
|
label: title,
|
||||||
},
|
children: <MyRouteSchemaComponent name={params.name} />,
|
||||||
];
|
},
|
||||||
} else {
|
]);
|
||||||
return items;
|
} else {
|
||||||
}
|
// 如果存在之前浏览的tab页面,只用更新页面标题
|
||||||
});
|
setTitle(targetItem.label);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [params.name, title]);
|
}, [params.name, title]);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hera/plugin-rental",
|
"name": "@hera/plugin-rental",
|
||||||
"displayName": "professional construction materials rental system - customized based on hera",
|
"displayName": "professional construction materials rental system - customized based on hera",
|
||||||
"version": "1.7.6-alpha.9",
|
"version": "1.7.6-alpha.10",
|
||||||
"description": "Offering a standardized leasing management system, encompassing comprehensive administration from materials to contracts to labor personnel, while providing a robust financial management mechanism, and real-time monitoring of the operational capacity of the leasing system.",
|
"description": "Offering a standardized leasing management system, encompassing comprehensive administration from materials to contracts to labor personnel, while providing a robust financial management mechanism, and real-time monitoring of the operational capacity of the leasing system.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"System management"
|
"System management"
|
||||||
|
Loading…
Reference in New Issue
Block a user