// // ScheduleHistoryVM.swift // QuickLocation // // Created by 八条 on 2026/6/26. // import RxSwift import RxCocoa import RxDataSources import MJRefresh import ObjectMapper class ScheduleHistoryViewModel: ViewModelType { struct Input {} struct Output { var sectionedItems: Observable<[ScheduleListSectionModel]> var refreshResult: Observable var pagination: Observable var error: Observable } let input: Input let output: Output private var listService: ListService private let sectionedItems = PublishSubject<[ScheduleListSectionModel]>() var refresh: MJRefreshComponentAction { return { self.listService.request.onNext(.refresh) } } var loadMore: MJRefreshComponentAction { return { self.listService.request.onNext(.more) } } lazy var cellAction: Action = { this in return Action { model in AppRouter.push(Route.itineraryDetail, userInfo: ["scheduleJson": model.toJSON()]) return .empty() } }(self) // MARK: - init init() { listService = ItineraryService.query(history: true) input = Input() output = Output( sectionedItems: listService.animatableSectionedItems, refreshResult: listService.refreshResult, pagination: listService.pagination, error: listService.error ) } }