using AntDesign; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using wispro.sp.entity; using wispro.sp.share; using wispro.sp.web.Services; namespace wispro.sp.web.Pages.Project { public partial class ProjectReviewer { private List projectContents; private ProjectInfo projectInfo; private List waitingReviewProjects; private ViewProjectWorkContent editObj; [Parameter] public string ProjectNo { get; set; } [Inject] IProjectService projectService { get; set; } [Inject] CalMonthServices calMonthServices { get; set; } [Inject] public MessageService _message { get; set; } [Inject] NavigationManager _NavigationManager { get; set; } protected async override Task OnInitializedAsync() { CalMonth cal =await calMonthServices.GetHandlingMonth(); if (!string.IsNullOrEmpty(ProjectNo)) { projectContents = await projectService.GetProjectCanReviewWorkContent(ProjectNo, cal); } else { waitingReviewProjects = await projectService.GetWaitingReviewProjects(); } await base.OnInitializedAsync(); } void startEdit(ViewProjectWorkContent pp) { editObj = pp; } void stopEdit() { editObj = null; } void ContentChanged(ViewProjectWorkContent pp) { pp.modifyState = ModifyState.Modified; } void OnInput(ChangeEventArgs e) { if (editObj != null) { editObj.modifyState = ModifyState.Modified; } } async void Save() { var ret = await projectService.ReviewProjectWorkContent(projectContents); if (ret.Success) { _NavigationManager.NavigateTo("/Home"); await _message.Success("保存成功!"); } else { await _message.Error("保存出错!"); } } } }