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