zhaolei
2020-11-20 4a2e5b9a21940f11757be37d99f0944e240e908b
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
@inherits GroupsBase
 
<EditPage @ref="EditPage" Id="group" FixedHeader="@FixedHeader" TItem="Bootstrap.DataAccess.Group" SubmitModalTitle="部门编辑窗口" QueryModel="QueryModel" OnQuery="Query" OnAdd="Add" OnDelete="Delete" OnSave="Save" OnResetSearch="ResetSearch">
    <QueryBody>
        <LgbInputText ColumnClass="col-sm-auto" @bind-Value="@context.GroupName" maxlength="50" />
        <LgbInputText ColumnClass="col-sm-auto" @bind-Value="@context.Description" maxlength="50" />
    </QueryBody>
    <TableToolbarTemplate>
        <TableToolbarButton class="btn btn-info" Icon="fa fa-user" Title="分配用户" OnClick="AssignUsers" />
        <TableToolbarButton class="btn btn-warning" Icon="fa fa-sitemap" Title="分配角色" OnClick="AssignRoles" />
    </TableToolbarTemplate>
    <TableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.GroupCode" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.GroupName" Sort="true"></LgbTableHeader>
        <LgbTableHeader TItem="string" @bind-Value="@context.Description" Sort="true"></LgbTableHeader>
    </TableHeader>
    <RowTemplate>
        <td>@context.GroupCode</td>
        <td>@context.GroupName</td>
        <td>@context.Description</td>
    </RowTemplate>
    <EditTemplate>
        <div class="row">
            <LgbInputText @bind-Value="@context.GroupName" placeholder="不可为空,50字以内" maxlength="50">
                <RequiredValidator />
                <StringLengthValidator Length="50" />
            </LgbInputText>
            <LgbInputText @bind-Value="@context.GroupCode" placeholder="不可为空,50字以内" maxlength="50">
                <RequiredValidator />
                <StringLengthValidator Length="50" />
            </LgbInputText>
            <LgbInputText @bind-Value="@context.Description" placeholder="不可为空,500字以内" maxlength="500">
                <RequiredValidator />
                <StringLengthValidator Length="500" />
            </LgbInputText>
        </div>
    </EditTemplate>
</EditPage>
 
<AssignModal @ref="AssignUserModal" TItem="Bootstrap.DataAccess.User" Id="group-user" Title="用户授权窗口" OnSave="SaveUsers">
    <ItemTemplate>
        <Checkbox TItem="Bootstrap.DataAccess.User" Item="@context" Text="@context.FormatDisplayName()" SetCheckCallback="SetUserCheck" OnClick="OnUserClick" />
    </ItemTemplate>
</AssignModal>
 
<AssignModal @ref="AssignRoleModal" TItem="Bootstrap.DataAccess.Role" Id="group-role" Title="角色授权窗口" OnSave="SaveRoles">
    <ItemTemplate>
        <Checkbox TItem="Bootstrap.DataAccess.Role" Item="@context" Text="@context.RoleName" SetCheckCallback="SetCheck" OnClick="OnClick" />
    </ItemTemplate>
</AssignModal>