重构首页为单一集合视图并添加全部功能自定义
This commit is contained in:
@ -223,11 +223,20 @@ final class HomeViewModel {
|
||||
func rebuildCommonMenus() {
|
||||
let permissions = appStore.permissionItems()
|
||||
let allMenus = HomeMenuCatalog.visibleMenus(from: permissions)
|
||||
let accountScope = appStore.accountCachePrefix
|
||||
let roleCode = appStore.roleCode
|
||||
let savedURIs = commonMenuStore.savedCommonURIs(accountScope: accountScope, roleCode: roleCode)
|
||||
|
||||
if savedURIs.isEmpty, !permissions.isEmpty {
|
||||
let defaultURIs = HomeCommonMenuStore.defaultCommonURIs(from: permissions)
|
||||
commonMenuStore.saveCommonURIs(defaultURIs, accountScope: accountScope, roleCode: roleCode)
|
||||
}
|
||||
|
||||
commonMenus = commonMenuStore.commonMenus(
|
||||
from: allMenus,
|
||||
permissions: permissions,
|
||||
accountScope: appStore.accountCachePrefix,
|
||||
roleCode: appStore.roleCode
|
||||
accountScope: accountScope,
|
||||
roleCode: roleCode
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user