public override Widget build(BuildContext context) { return(new StoreConnector <AppState, SearchScreenViewModel>( converter: state => new SearchScreenViewModel { searchArticleLoading = state.searchState.searchArticleLoading, searchKeyword = state.searchState.keyword, searchArticleIds = state.searchState.searchArticleIdDict.ContainsKey(key: state.searchState.keyword) ? state.searchState.searchArticleIdDict[key: state.searchState.keyword] : null, searchArticleCurrentPage = state.searchState.searchArticleCurrentPage, searchArticlePages = state.searchState.searchArticlePages, articleDict = state.articleState.articleDict, userDict = state.userState.userDict, teamDict = state.teamState.teamDict, blockArticleList = state.articleState.blockArticleList }, builder: (context1, viewModel, dispatcher) => { var actionModel = new SearchScreenActionModel { pushToArticleDetail = articleId => dispatcher.dispatch( new MainNavigatorPushToArticleDetailAction { articleId = articleId }), startSearchArticle = keyword => dispatcher.dispatch(new StartSearchArticleAction { keyword = keyword }), searchArticle = (keyword, pageNumber) => dispatcher.dispatch <IPromise>( Actions.searchArticles(keyword: keyword, pageNumber: pageNumber)) }; return new SearchArticleScreen(viewModel: viewModel, actionModel: actionModel); } )); }
public SearchScreen( SearchScreenViewModel viewModel = null, SearchScreenActionModel actionModel = null, Key key = null ) : base(key) { this.viewModel = viewModel; this.actionModel = actionModel; }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, SearchScreenViewModel>( converter: state => { var searchUserIds = state.searchState.searchUserIdDict.ContainsKey(key: state.searchState.keyword) ? state.searchState.searchUserIdDict[key: state.searchState.keyword] : null; var currentUserId = state.loginState.loginInfo.userId ?? ""; var followMap = state.followState.followDict.ContainsKey(key: currentUserId) ? state.followState.followDict[key: currentUserId] : new Dictionary <string, bool>(); return new SearchScreenViewModel { searchUserLoading = state.searchState.searchUserLoading, searchKeyword = state.searchState.keyword, searchUserIds = searchUserIds, searchUserHasMore = state.searchState.searchUserHasMore, userDict = state.userState.userDict, userLicenseDict = state.userState.userLicenseDict, followMap = followMap, currentUserId = currentUserId, isLoggedIn = state.loginState.isLoggedIn }; }, builder: (context1, viewModel, dispatcher) => { var actionModel = new SearchScreenActionModel { pushToUserDetail = userId => dispatcher.dispatch( new MainNavigatorPushToUserDetailAction { userId = userId }), pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Login }), startSearchUser = () => dispatcher.dispatch(new StartSearchUserAction()), searchUser = (keyword, pageNumber) => dispatcher.dispatch <IPromise>( Actions.searchUsers(keyword: keyword, pageNumber: pageNumber)), startFollowUser = followUserId => dispatcher.dispatch(new StartFollowUserAction { followUserId = followUserId }), followUser = followUserId => dispatcher.dispatch <IPromise>(Actions.fetchFollowUser(followUserId: followUserId)), startUnFollowUser = unFollowUserId => dispatcher.dispatch(new StartUnFollowUserAction { unFollowUserId = unFollowUserId }), unFollowUser = unFollowUserId => dispatcher.dispatch <IPromise>(Actions.fetchUnFollowUser(unFollowUserId: unFollowUserId)) }; return new SearchUserScreen(viewModel: viewModel, actionModel: actionModel); } )); }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, SearchScreenViewModel>( converter: state => new SearchScreenViewModel { searchKeyword = state.searchState.keyword, searchArticleIds = state.searchState.searchArticleIdDict.ContainsKey(key: state.searchState.keyword) ? state.searchState.searchArticleIdDict[key: state.searchState.keyword] : new List <string>(), searchArticleHistoryList = state.searchState.searchArticleHistoryList, searchSuggest = state.articleState.searchSuggest, popularSearchArticleList = state.popularSearchState.popularSearchArticles, searchUserIds = state.searchState.searchUserIdDict.ContainsKey(key: state.searchState.keyword) ? state.searchState.searchUserIdDict[key: state.searchState.keyword] : new List <string>(), searchTeamIds = state.searchState.searchTeamIdDict.ContainsKey(key: state.searchState.keyword) ? state.searchState.searchTeamIdDict[key: state.searchState.keyword] : new List <string>() }, builder: (context1, viewModel, dispatcher) => { var actionModel = new SearchScreenActionModel { mainRouterPop = () => dispatcher.dispatch(new MainNavigatorPopAction()), fetchPopularSearch = () => dispatcher.dispatch <IPromise>(Actions.popularSearchArticle()), startSearchArticle = keyword => dispatcher.dispatch(new StartSearchArticleAction { keyword = keyword }), searchArticle = (keyword, pageNumber) => dispatcher.dispatch <IPromise>( Actions.searchArticles(keyword, pageNumber)), startSearchUser = () => dispatcher.dispatch(new StartSearchUserAction()), searchUser = (keyword, pageNumber) => dispatcher.dispatch <IPromise>( Actions.searchUsers(keyword, pageNumber)), startSearchTeam = () => dispatcher.dispatch(new StartSearchTeamAction()), searchTeam = (keyword, pageNumber) => dispatcher.dispatch <IPromise>( Actions.searchTeams(keyword, pageNumber)), clearSearchResult = () => dispatcher.dispatch(new ClearSearchResultAction()), saveSearchArticleHistory = keyword => dispatcher.dispatch(new SaveSearchArticleHistoryAction { keyword = keyword }), deleteSearchArticleHistory = keyword => dispatcher.dispatch(new DeleteSearchArticleHistoryAction { keyword = keyword }), deleteAllSearchArticleHistory = () => dispatcher.dispatch(new DeleteAllSearchArticleHistoryAction()) }; return new SearchScreen(viewModel, actionModel); } )); }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, SearchScreenViewModel>( converter: state => new SearchScreenViewModel { searchLoading = state.searchState.loading, searchKeyword = state.searchState.keyword, searchArticles = state.searchState.searchArticles, currentPage = state.searchState.currentPage, pages = state.searchState.pages, searchHistoryList = state.searchState.searchHistoryList, popularSearchList = state.popularSearchState.popularSearchs, userDict = state.userState.userDict, teamDict = state.teamState.teamDict, blockArticleList = state.articleState.blockArticleList }, builder: (context1, viewModel, dispatcher) => { var actionModel = new SearchScreenActionModel { mainRouterPop = () => dispatcher.dispatch(new MainNavigatorPopAction()), pushToArticleDetail = articleId => dispatcher.dispatch( new MainNavigatorPushToArticleDetailAction { articleId = articleId }), startSearchArticle = () => dispatcher.dispatch(new StartSearchArticleAction()), searchArticle = (keyword, pageNumber) => dispatcher.dispatch <IPromise>( Actions.searchArticles(keyword, pageNumber)), fetchPopularSearch = () => dispatcher.dispatch <IPromise>(Actions.popularSearch()), clearSearchArticleResult = () => dispatcher.dispatch(new ClearSearchArticleResultAction()), saveSearchHistory = keyword => dispatcher.dispatch(new SaveSearchHistoryAction { keyword = keyword }), deleteSearchHistory = keyword => dispatcher.dispatch(new DeleteSearchHistoryAction { keyword = keyword }), deleteAllSearchHistory = () => dispatcher.dispatch(new DeleteAllSearchHistoryAction()) }; return new SearchScreen(viewModel, actionModel); } )); }
public async Task <IEnumerable <ScreenActionModel> > GetScreenAction(SearchScreenActionModel searchScreenActionModel) { return(await _roleAndPermissionRepository.GetScreenAction(searchScreenActionModel)); }
public async Task <IEnumerable <ScreenActionModel> > GetScreenAction(SearchScreenActionModel searchScreenActionModel) { return(await Query <ScreenActionModel>("Stf.GetStaffActionPermissions", searchScreenActionModel)); }
public async Task <ActionResult> GetScreenActions([FromQuery] SearchScreenActionModel searchScreenActionModel) { var list = await _roleAndPermissionService.GetScreenAction(searchScreenActionModel); return(Ok(list)); }