|
|
@ -58,7 +58,7 @@ onMounted(() => { |
|
|
|
function menuApi() { |
|
|
|
//获取表格左侧菜单 |
|
|
|
getMenu().then((res: any) => { |
|
|
|
if (res.code === 200) { |
|
|
|
if (res.code === 200 && res.data.length != 0) { |
|
|
|
menuDeptKey.value = |
|
|
|
routerType.value === '1' |
|
|
|
? deptId.value |
|
|
@ -71,13 +71,17 @@ function menuApi() { |
|
|
|
sessionStorageIns.setUseStorage('deptId', menuDeptKey.value); |
|
|
|
mitt.emit('menuKey', menuDeptKey.value); |
|
|
|
emit('tableMenuData', res.data); |
|
|
|
} else { |
|
|
|
menuDeptKey.value = 0; |
|
|
|
selectedKey.value = menuDeptKey.value; |
|
|
|
sessionStorageIns.setUseStorage('deptId', menuDeptKey.value); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
function comMenuApi() { |
|
|
|
//获取组态左侧菜单 |
|
|
|
getMenuData().then((res: any) => { |
|
|
|
if (res.code === 200) { |
|
|
|
if (res.code === 200 && res.data.length != 0) { |
|
|
|
menuIdKey.value = |
|
|
|
routerType.value === '1' |
|
|
|
? id.value |
|
|
@ -91,6 +95,11 @@ function comMenuApi() { |
|
|
|
sessionStorageIns.setUseStorage('deptId', routerType.value === '1' ? deptId.value : parentId); |
|
|
|
mitt.emit('deviceMenuKey', menuIdKey.value); |
|
|
|
emit('tableMenuData', res.data); |
|
|
|
} else { |
|
|
|
menuIdKey.value = 0; |
|
|
|
selectedKey.value = menuIdKey.value; |
|
|
|
sessionStorageIns.setUseStorage('id', menuIdKey.value); |
|
|
|
sessionStorageIns.setUseStorage('deptId', menuIdKey.value); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|