@page "/Project/ReadAssignPointMsg"
@using wispro.sp.web.Models

<PageContainer>
    <Breadcrumb>
        <Breadcrumb>
            <BreadcrumbItem>
                <a href="/Home"><Icon Type="home"></Icon></a>
            </BreadcrumbItem>
            <BreadcrumbItem>
                <Icon Type="setting"></Icon><span>项目</span>
            </BreadcrumbItem>
            <BreadcrumbItem>
                <Icon Type="user"></Icon><span>信息查看</span>
            </BreadcrumbItem>
        </Breadcrumb>
    </Breadcrumb>
    <Content>
        <div style="border:thin"><sapn><b>发信人：</b>@projectMessage.From</sapn><br /></div>
        <br />
        <div style="border: thin">
            <span>
                <b>收信人：</b>
                @foreach (MsgReadInfo rm in projectMessage.To)
                {
                    if (rm.isReaded)
                    {
                        <span style="color:darkgray">@rm.Reciever;</span>
                    }
                    else
                    {
                        <span style="color:black">@rm.Reciever;</span>
                    }
                }
            </span>
        </div>
    </Content>
    <ChildContent>
        <Card>
            <p><span>@projectMessage.MessageInfo </span> </p>
            <Divider />
            <AntDesign.Table @ref="table"
                             TItem="wispro.sp.web.Models.Task"
                             Loading="_loading"
                             DataSource="@projectMessage.Tasks"
                             Total="_total"
                             Bordered=@true
                             Size=@TableSize.Middle
                             PageIndex="_pageIndex"
                             PageSize="_pageSize">
                <ChildContent>
                    <Selection Key="@(context.Id.ToString())" />
                    <AntDesign.Column Title="序号" TData="int" @bind-Field="@context.Id">

                    </AntDesign.Column>
                    <AntDesign.Column Title="任务名称" @bind-Field="@context.Name" Sortable Filterable />
                    <AntDesign.Column Title="任务类型" @bind-Field="@context.Type" Sortable Filterable />
                    <AntDesign.Column Title="任务期限" @bind-Field="@context.LimiteDate" Format="yyyy-MM-dd" Sortable Filterable />
                    <AntDesign.Column Title="项目文号" TData="string">
                        @context.ProjectInfo.CaseNo
                    </AntDesign.Column>
                    <AntDesign.Column Title="项目名称" TData="string">
                        @context.ProjectInfo.CaseName
                    </AntDesign.Column>
                    <AntDesign.Column Title="处理事项" TData="string">
                        @context.ProjectInfo.DoItem
                    </AntDesign.Column>
                    <AntDesign.Column Title="处理人" TData="string">
                        @foreach (string name in context.ProjectInfo.DoPerson)
                        {
                            @name<span>;</span>
                        }
                    </AntDesign.Column>
                    <ActionColumn>
                        @if (context.Handles != null && context.Handles.Count < 3)
                        {
                            <Space>
                                @foreach (TaskHandleInfo taskHandleInfo in context.Handles)
                                {
                                    <SpaceItem><Button Danger Type="@ButtonType.Link" Size="small" OnClick="() => OnHandle()">@taskHandleInfo.Name</Button></SpaceItem>
                                }

                            </Space>
                        }
                        else
                        {
                            @if (context.Handles != null)
                            {

                            }
                        }
                    </ActionColumn>
                </ChildContent>

            </AntDesign.Table>
        </Card>
    </ChildContent>
</PageContainer>