From 4a1745a29ca6e5a00a3c908a9b885b382e0406a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E8=AA=89=E7=A8=8B?= <2659568239@qq.com> Date: Fri, 8 Dec 2023 17:46:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/LeftMenuOne/index.tsx | 1 + src/layouts/index.tsx | 30 ++++++++++--------- .../DeviceRegister/AdminsTab/index.tsx | 4 +-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/layouts/LeftMenuOne/index.tsx b/src/layouts/LeftMenuOne/index.tsx index 43d1ce6..96d38cc 100644 --- a/src/layouts/LeftMenuOne/index.tsx +++ b/src/layouts/LeftMenuOne/index.tsx @@ -120,6 +120,7 @@ const LeftMenuCom: FC = ({ data }) => {
{item.name}
+ {/* 列表 */}
{ diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 1f5ab70..7efe939 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -125,16 +125,7 @@ export default function Layout() { if (tabList.length > 0 && !layoutInfo) { setActiveName(tabList[0].name) let info = MenuType[tabList[0].name]; - - if (info[0].name == '设备注册') { - for(let i=0; i 0) { - history.push(`/registerManage/deviceRegister/${treeData[i].children[0].key}`) - break; - } - } - return - } + if(isTreeType(info)) return if (info[0].data) { history.push(`${info[0].data[0].url}`) @@ -144,6 +135,19 @@ export default function Layout() { } }, [selectVal]) + // 校验是否是树结构列表 + const isTreeType = (info: any) => { + if (info[0].name == '设备注册') { + for(let i=0; i 0) { + history.push(`/registerManage/deviceRegister/${treeData[i].children[0].key}`) + break; + } + } + return true + } + } + return (