Commit 94e4e0ba authored by chenshouchao's avatar chenshouchao

feat: 不在产品页面下的时候清空当前产品

parent d5ea2237
......@@ -31,6 +31,7 @@ const ConsoleLayout = observer(() => {
const { currentProjectStore, fileListStore } = useStores();
const { openFileList, setOpenFileList } = fileListStore;
const productInfo = toJS(currentProjectStore.currentProductInfo);
console.log(productInfo);
const { run: runGetProjectList } = useMyRequest(getProjectList, {
onSuccess: (res) => {
let list = res.data;
......@@ -67,6 +68,16 @@ const ConsoleLayout = observer(() => {
const location = useLocation();
const { permissionStore, menuStore } = useStores();
// 不在产品页面下的时候清空
useEffect(() => {
console.log(location.pathname.slice(0, 8));
if (location.pathname.slice(0, 8) !== "/product") {
currentProjectStore.setProjectList([]);
currentProjectStore.changeProject({});
currentProjectStore.changeProductInfo({});
}
}, [location, currentProjectStore]);
useEffect(() => {
permissionStore.setSidebarRouters(location.pathname);
}, [location, permissionStore]);
......
......@@ -401,7 +401,9 @@ const ProjectMembers = observer(() => {
onClick={() => rowClick(item.id)}
>
<Box className={styles.tabBoxInfo}>
<MyTooltip title={item.name}><div className={styles.tabBoxTitle}>{item.name}</div></MyTooltip>
<MyTooltip title={item.name}>
<div className={styles.tabBoxTitle}>{item.name}</div>
</MyTooltip>
<Box className={styles.tabBoxDescInfo}>
<div
className={styles.tabBoxDesc}
......@@ -499,11 +501,7 @@ const ProjectMembers = observer(() => {
</MyCircularProgress>
</Box>
<div className={styles.pagination}>
<MyPagination
page={page}
pageChange={handleChangePage}
count={count || jobList.length}
/>
<MyPagination page={page} pageChange={handleChangePage} count={count} />
</div>
{/* <TablePagination
......
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