Commit c5029e04 authored by 左玲玲's avatar 左玲玲 😬

1539

parent d82b6972
......@@ -152,16 +152,10 @@ export const layout = ({ initialState, setInitialState }) => {
noFound: <div>noFound</div>,
// 增加一个 loading 的状态
childrenRender: (children, props) => {
let home, items = initialState?.newMenu?.userHavePermList ?? [];
if (history.location.pathname != "/welcome" && history.location.pathname != "/") {
home = history.location.pathname
} else {
home = items?.length > 0 ? items[0].path.indexOf("/") > -1 ? items[0].path : items[0]?.routes?.length > 0 ? items[0]?.routes[0]?.path : "" : "";
}
return (
<>
{initialState?.currentUser && location.pathname !== loginPath ? (
<TagView home={home}>{children}</TagView>
<TagView home='/welcome'>{children}</TagView>
) : (
children
)}
......
......@@ -21,42 +21,42 @@ function strToHump(str) {
}
let CardItems = (datav, i, getstar, addHistory) => {
let name = datav.name,
collected = datav.isExist == '1',
icon = datav.icon ? strToHump(datav.icon) : 'ToolOutlined',
ItemIcon = icon ? Ant4Icons[icon] : Ant4Icons['ToolOutlined'];
return (
<div
key={i}
className={styles.carditem}
onClick={async () => {
history.push(datav.path);
await addHistory(datav.key);
}}
>
<a className={styles.diylink}>
{' '}
{React.createElement(Ant4Icons[icon], { style: { marginRight: 6 } })}
{name}
</a>
{collected ? (
<Ant4Icons.StarFilled
className={styles.collected}
onClick={async (e) => {
getstar(e, collected, datav.key);
}}
/>
) : (
<Ant4Icons.StarOutlined
className={styles.tocollect}
onClick={async (e) => {
getstar(e, collected, datav.key);
}}
/>
)}
</div>
);
},
let name = datav.name,
collected = datav.isExist == '1',
icon = datav.icon ? strToHump(datav.icon) : 'ToolOutlined',
ItemIcon = icon ? Ant4Icons[icon] : Ant4Icons['ToolOutlined'];
return (
<div
key={i}
className={styles.carditem}
onClick={async () => {
history.push(datav.path);
await addHistory(datav.key);
}}
>
<a className={styles.diylink}>
{' '}
{React.createElement(Ant4Icons[icon], { style: { marginRight: 6 } })}
{name}
</a>
{collected ? (
<Ant4Icons.StarFilled
className={styles.collected}
onClick={async (e) => {
getstar(e, collected, datav.key);
}}
/>
) : (
<Ant4Icons.StarOutlined
className={styles.tocollect}
onClick={async (e) => {
getstar(e, collected, datav.key);
}}
/>
)}
</div>
);
},
coles = { xs: 24, sm: 24, md: 12, lg: 8, xl: 6, xxl: 4 };
function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile, name, menuData }) {
......@@ -169,7 +169,6 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
};
});
}, [collectPerm]);
return (
<Sider
trigger={null}
......@@ -237,6 +236,12 @@ function SiderMenu({ logo, collapsed, onCollapse, fixSiderbar, theme, isMobile,
label: '产品与服务',
type: 'sub1',
},
{
key: '/welcome',
label: '首页',
type: 'sub1',
icon: <Ant4Icons.HomeOutlined />
},
...collectList,
]}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment