zhaolei
2020-11-20 921de2254ff5712a44ed8575ee8efe34252f6603
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@inherits UsersBase
 
<EditPage @ref="EditPage" Id="user" FixedHeader="@FixedHeader" TItem="Bootstrap.DataAccess.User" SubmitModalTitle="用户编辑窗口" QueryModel="QueryModel" OnQuery="Query" OnAdd="Add" OnDelete="Delete" OnSave="Save" OnResetSearch="ResetSearch">
    <QueryBody>
        <LgbInputText ColumnClass="col-sm-auto" @bind-Value="@context.UserName" maxlength="50" />
        <LgbInputText ColumnClass="col-sm-auto" @bind-Value="@context.DisplayName" maxlength="50" />
    </QueryBody>
    <TableToolbarTemplate>
        <TableToolbarButton class="btn btn-info" Icon="fa fa-bank" Title="分配部门" OnClick="AssignGroups" />
        <TableToolbarButton class="btn btn-warning" Icon="fa fa-sitemap" Title="分配角色" OnClick="AssignRoles" />
    </TableToolbarTemplate>
    <TableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.UserName" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.DisplayName" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="DateTime" @bind-Value="@context.RegisterTime" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="DateTime?" @bind-Value="@context.ApprovedTime" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.ApprovedBy" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.Description" Sort="true"></LgbTableHeader>
    </TableHeader>
    <RowTemplate>
        <td>@context.UserName</td>
        <td>@context.DisplayName</td>
        <td>@context.RegisterTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
        <td>@(context.ApprovedTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? "-")</td>
        <td>@context.ApprovedBy</td>
        <td>@context.Description</td>
    </RowTemplate>
    <EditTemplate>
        <div class="row">
            <LgbInputText @bind-Value="@context.UserName" placeholder="不可为空,16字以内" maxlength="16">
                <RequiredValidator />
                <StringLengthValidator Length="16" />
            </LgbInputText>
            <LgbInputText @bind-Value="@context.DisplayName" placeholder="不可为空,20字以内" maxlength="20">
                <RequiredValidator />
                <StringLengthValidator Length="20" />
            </LgbInputText>
            <LgbInputText InputType="password" @bind-Value="@context.Password" autocomplete="off" placeholder="不可为空,16字以内" maxlength="16">
                <RequiredValidator />
                <StringLengthValidator Length="16" />
            </LgbInputText>
            <LgbInputText InputType="password" @bind-Value="@context.NewPassword" autocomplete="off" placeholder="与登录密码一致" maxlength="16">
                <RequiredValidator />
                <StringLengthValidator Length="16" />
                <EqualToValidator @bind-Value="@context.Password" />
            </LgbInputText>
        </div>
    </EditTemplate>
</EditPage>
 
<AssignModal @ref="AssignGroupModal" TItem="Bootstrap.DataAccess.Group" Id="user-group" Title="部门授权窗口" OnSave="SaveGroups">
    <ItemTemplate>
        <Checkbox TItem="Bootstrap.DataAccess.Group" Item="@context" Text="@context.GroupName" SetCheckCallback="SetGroupCheck" OnClick="OnGroupClick" />
    </ItemTemplate>
</AssignModal>
 
<AssignModal @ref="AssignRoleModal" TItem="Bootstrap.DataAccess.Role" Id="user-role" Title="角色授权窗口" OnSave="SaveRoles">
    <ItemTemplate>
        <Checkbox TItem="Bootstrap.DataAccess.Role" Item="@context" Text="@context.RoleName" SetCheckCallback="SetCheck" OnClick="OnClick" />
    </ItemTemplate>
</AssignModal>