@namespace AntSK.Pages.KmsPage
@using AntSK.Domain.Repositories
@using AntSK.Domain.Domain.Model.Dto
@page "/Kms/DetailList/{KmsID}/{FileId}"
@inject NavigationManager NavigationManager
@using AntSK.Services.Auth
@inherits AuthComponentBase


<Button Type="@ButtonType.Primary" OnClick="NavigateBack">返回</Button>
<Divider />
<AntList DataSource="@_data" TItem="KMFile" ItemLayout="ListItemLayout.Horizontal" Grid="LayoutModel._listGridType">
    <ListItem  >
        <Card Hoverable Bordered Class="card" Style="max-height:247px;" Actions="(new[] {
                            info(()=> Info(context.Text)) ,
                             })">
            <CardMeta>
                <DescriptionTemplate>
                    <Paragraph class="item" Ellipsis Style="display: -webkit-box; -webkit-line-clamp: 3;-webkit-box-orient: vertical;overflow: hidden; text-overflow: ellipsis;white-space: normal;height:65px;">
                        <!--todo: Ellipsis not working-->
                        @context.Text
                    </Paragraph>
                </DescriptionTemplate>
            </CardMeta>
        </Card>
    </ListItem>
</AntList>

<Modal Visible="_infolVisible" Footer="null" Closable Title="详情" OnCancel="OnCancelLog" DestroyOnClose Width="1000" MaxBodyHeight="600">
   <Paragraph>
        @_infoText
   </Paragraph> 
</Modal>

@code {
    RenderFragment info(Action clickAction) =>@<a key="info" @onclick="@clickAction">查看</a>;
}
