|
|
|
@ -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<treeData.length; i++) {
|
|
|
|
|
if (treeData[i].children.length > 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<treeData.length; i++) {
|
|
|
|
|
if (treeData[i].children.length > 0) {
|
|
|
|
|
history.push(`/registerManage/deviceRegister/${treeData[i].children[0].key}`)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<ConfigProvider
|
|
|
|
|
locale={zhCN}
|
|
|
|
@ -199,13 +203,11 @@ export default function Layout() {
|
|
|
|
|
|
|
|
|
|
setActive(item.id)
|
|
|
|
|
setActiveName(item.name)
|
|
|
|
|
|
|
|
|
|
if(isTreeType(info)) return
|
|
|
|
|
|
|
|
|
|
if (info.length == 0 || info[0].data && info[0].data.length == 0) {
|
|
|
|
|
history.push('/construction');
|
|
|
|
|
// 暂时屏蔽
|
|
|
|
|
// setActive(tabList[0].id)
|
|
|
|
|
// setActiveName(tabList[0].name)
|
|
|
|
|
// message.info(item.name + '模块正在建设中!')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|