Add scenic application flow aligned with Android.

Implement scenic apply models, API, upload, UI, and tests; wire entry from permission apply pages and include related permission/scenic selection UI fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 11:09:27 +08:00
parent 2bea05b1d9
commit 77fec21563
22 changed files with 2202 additions and 216 deletions

View File

@ -163,9 +163,23 @@ final class PermissionApplyViewModel {
.flatMap(\.scenic)
}
func clearRoleSelection() {
selectedRoleId = nil
selectedRoleName = ""
selectedScenicIds = []
selectedScenicNames = []
availableScenics = []
availableRoles = availableRoles.map { role in
var copy = role
copy.isSelected = false
return copy
}
notifyStateChange()
}
func submit(api: HomeAPI) async {
guard let roleId = selectedRoleId else {
onShowMessage?("选择角色")
onShowMessage?("请选择角色")
return
}
let newScenicIds = selectedScenicIds.filter { id in