using AntDesign;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using wispro.sp.web.Models;

namespace wispro.sp.web.Pages.Project
{
    public partial class ReadMessage
    {
        [Parameter]
        public int messageId { get; set; }

        [Inject] protected NavigationManager NavigationManager { get; set; }
        ITable table;

        int _pageIndex = 1;
        int _pageSize = 10;
        int _total = 0;
        bool _loading = false;

        wispro.sp.entity.StaffGrade EditingStaff = null;
        bool _visible = false;
        bool _isAdd = false;
        private ProjectMessage projectMessage = new ProjectMessage()
        {
            From ="系统",
            To= new List<MsgReadInfo>()
            {
                new(){Reciever = "钟子敏"}
            },
            MessageInfo ="系统已将专案数据导入，如下案件需要您分配点数，请尽快处理！",
            Type="专案点数分配任务通知",
            Tasks = new List<Models.Task>()
            {
                new(){ 
                    ProjectInfo = new ProjectInfo(){
                        CaseNo ="S2112394",
                        CaseName ="美的-洗碗机专利调查",
                        DoItem="提出报告",
                        DoPerson=new List<string>(){"李申", "何倚雯", "王晴", "陆跃" }, 
                        ResponseMan ="黄瑜"
                    },
                    Id =1,
                    Name ="2021年9月专案点数分配任务", 
                    Type="专案点数分配任务", 
                    ResponseMan ="黄瑜", 
                    State="待处理", 
                    LimiteDate = DateTime.Now.AddDays(4), 
                    Handles= new List<TaskHandleInfo>()
                    {
                        new TaskHandleInfo(){Name = "分配点数",UIUrl="/Project/AssignPoint"}
                    },
                    //UIUrl = "/Project/AssignPoint"
                },
                new(){
                    ProjectInfo = new ProjectInfo(){
                        CaseNo ="S2112214",
                        CaseName ="EV热管理项目",
                        DoItem="提出报告",
                        DoPerson=new List<string>(){"何倚雯", "王晴", "陆跃" },
                        ResponseMan ="黄瑜"
                    },
                    Id =2,
                    Name ="2021年9月专案点数分配任务",
                    Type="专案点数分配任务",
                    ResponseMan ="黄瑜",
                    State="待处理",
                    LimiteDate = DateTime.Now.AddDays(4),
                    Handles= new List<TaskHandleInfo>()
                    {
                        new TaskHandleInfo(){Name = "分配点数",UIUrl="/Project/AssignPoint"}
                    }
                }
            }
        };

        private void Handle(string UIUrl,  int id)
        {
            NavigationManager.NavigateTo($"{UIUrl}/{id}");
        }


    }
}
