新增门店订单与核销管理列表,对齐 Android 订单能力并完善账号级缓存。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -9,6 +9,7 @@ import SwiftUI
|
||||
|
||||
/// 首页全部功能视图,展示常用应用和当前角色拥有的更多功能。
|
||||
struct HomeMoreFunctionsView: View {
|
||||
@EnvironmentObject private var accountContext: AccountContext
|
||||
@EnvironmentObject private var permissionContext: PermissionContext
|
||||
@EnvironmentObject private var appRouter: AppRouter
|
||||
@EnvironmentObject private var router: RouterPath
|
||||
@ -124,13 +125,19 @@ struct HomeMoreFunctionsView: View {
|
||||
Button {
|
||||
let roleCode = permissionContext.currentAppRole?.rawValue
|
||||
if isCommon {
|
||||
commonUris = commonMenuStore.remove(item.uri, current: commonUris, roleCode: roleCode)
|
||||
commonUris = commonMenuStore.remove(
|
||||
item.uri,
|
||||
current: commonUris,
|
||||
roleCode: roleCode,
|
||||
accountScope: accountContext.accountCachePrefix
|
||||
)
|
||||
} else {
|
||||
commonUris = commonMenuStore.add(
|
||||
item.uri,
|
||||
current: commonUris,
|
||||
menuItems: viewModel.menuItems,
|
||||
roleCode: roleCode
|
||||
roleCode: roleCode,
|
||||
accountScope: accountContext.accountCachePrefix
|
||||
)
|
||||
}
|
||||
} label: {
|
||||
@ -187,6 +194,9 @@ struct HomeMoreFunctionsView: View {
|
||||
appRouter.select(tab)
|
||||
case .orders(let entry):
|
||||
appRouter.selectOrders(entry: entry)
|
||||
case .orderPush(let route):
|
||||
appRouter.select(.orders)
|
||||
appRouter.router(for: .orders).navigate(to: .orders(route))
|
||||
case .destination(let route):
|
||||
if route == .moreFunctions {
|
||||
return
|
||||
@ -210,6 +220,7 @@ struct HomeMoreFunctionsView: View {
|
||||
commonUris = commonMenuStore.load(
|
||||
menuItems: viewModel.menuItems,
|
||||
roleCode: roleCode,
|
||||
accountScope: accountContext.accountCachePrefix,
|
||||
legacyRoleId: legacyRoleId,
|
||||
topLevelPermissionURIs: permissionContext.topLevelPermissionURIs(for: roleCode)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user