@using System.Text.RegularExpressions
@using wispro.sp.web.Components

@page "/Home"
@attribute [Authorize]
<PageContainer>
    <Breadcrumb>
        <Breadcrumb>
            <BreadcrumbItem><Icon Type="home" />首页</BreadcrumbItem>
        </Breadcrumb>
    </Breadcrumb>
    <Content>
        <div class="pageHeaderContent__b__0">
            <div class="avatar">
                <Avatar size="large" src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png" />
            </div>
            <div class="content">
                @if (_CurrentUser != null)
                {
                <div class="contentTitle">
                    @(_CurrentUser.Name)好, 祝您一天愉快!
                </div>
                <div>
                    深圳威世博代理事务所 | 工作地：深圳
                </div>
                }
            </div>
        </div>
    </Content>
    <ExtraContent>
        @if (HandlingMonth != null)
        {
            <div class="statItem">
                <span>【@HandlingMonth.Year-@HandlingMonth.Month】月数据正在处理中,您有<a href="/MyCaseList">@waitingHandleItems</a>笔绩效数据需要处理！</span>
            </div>

        }

        <div class="statItem">
            <span>您的总绩效数据有：<a href="/MyCaseList">@allItems </a> </span>
        </div>
        
        
    </ExtraContent>
    <ChildContent>
        <Row Gutter="24">
            <AntDesign.Col Xl="24" Lg="24" Md="24" Sm="24" Xs="24">
                <Card BodyStyle="padding: 0px;" Class="activeCard">
                    <CardTabs>
                        <Tabs>
                            <TabPane Key="1">
                                <TabTemplate>信息动态</TabTemplate>
                                <ChildContent>
                                    @if (AppealRecords != null && AppealRecords.Count > 0)
                                    {
                                        <SSTable UserId="@_CurrentUser.Userid" Datas="@AppealRecords" OnReview="ShowModel" OnChangeReviewer="ShowChangeReviewer"></SSTable>
                                    }
                                </ChildContent>
                            </TabPane>
                            @if (WaitingReviewProjects != null && WaitingReviewProjects.Count > 0)
                            {
                            <TabPane @key="2">
                                <TabTemplate>待分配绩效专案</TabTemplate>
                                <ChildContent>
                                    <AntDesign.Table TItem="ProjectInfo"
                                                     
                                                     DataSource="@WaitingReviewProjects"
                                                     Bordered=@true
                                                     Size=@TableSize.Middle
                                                     HidePagination="@true">
                                        <RowTemplate>
                                            @*<Selection Key="@(context.ProjectNo)" />*@
                                            <AntDesign.Column Title="序号" TData="int" Width="60">
                                                @serialNumber(context)
                                            </AntDesign.Column>
                                            <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Sortable Filterable />
                                            <AntDesign.Column Title="案件名称" @bind-Field="@context.CaseName" TData="string" Sortable Filterable />
                                            <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" TData="string" Sortable Filterable />
                                            <AntDesign.Column Title="客户" DataIndex="Customer.Name" TData="string" Sortable Filterable />
                                            <AntDesign.Column Title="案件审核人"  DataIndex="Reviewer.Name" TData="string" Sortable Filterable />
                                            <ActionColumn>
                                                <a href="/Project/Reviewer/@context.CaseNo">绩效分配</a>
                                            </ActionColumn>
                                        </RowTemplate>
                                        
                                    </AntDesign.Table>
</ChildContent>
                            </TabPane>
                            }

                        </Tabs>
                        </CardTabs>
                </Card>
            </AntDesign.Col>
            
        </Row>
    </ChildContent>
</PageContainer>

<Modal Title="变更审核人"
       Visible="@_visible"
       OnOk="@HandleOk"
       OnCancel="@HandleCancel">

    <Form Model="_ChangedRecord" LabelColSpan="6"
          WrapperColSpan="16">
        <FormItem Label="审核人变更为">
            <StaffSelect @bind-StaffId="@_ChangedRecord.ReviewerId" StaffLists="_Staffs" />
        </FormItem>
    </Form>

</Modal>
