kongzy
2024-07-01 47a751cb301d05276ae5d75145d57b2d090fe4e1
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
<head></head>
<ui:composition>
    <h:form id="roleMngForm">
        <p:panel styleClass="center-header">
            <p:outputLabel styleClass="title" value="角色管理"></p:outputLabel>
        </p:panel>
        <p:panel styleClass="center-body">
            <p:panelGrid columns="5" styleClass="btn">
                <p:commandButton value="新建" styleClass="new-btn"
                                 process="@this"
                                 actionListener="#{roleMngController.onNewBtnClick}"
                                 oncomplete="PF('dialog').show();"
                                 update=":dialog,:dialogForm"></p:commandButton>
                <p:commandButton value="修改" styleClass="edit-btn"
                                 process="@form"
                                 actionListener="#{roleMngController.onEditBtnClick}"
                                 update=":dialog,:dialogForm"></p:commandButton>
                <p:commandButton value="删除" styleClass="del-btn"
                                 process="@form"
                                 actionListener="#{roleMngController.onDeleteBtnClick}"
                                 update="@form">
                    <p:confirm header="确认" message="确认操作?"></p:confirm>
                </p:commandButton>
 
                <p:commandButton value="按钮权限" styleClass="edit-btn"
                                 process="@form"
                                 actionListener="#{roleMngController.btnPermissionClick}"
                                 update=":btnDialog,:btnDialogForm"/>
 
                <p:commandButton value="人员权限" styleClass="edit-btn"
                                 process="@form"
                                 actionListener="#{roleMngController.userPermissionClick}"
                                 update=":userDialog,:userDialogForm"/>
            </p:panelGrid>
 
            <p:dataTable id="roleMngDataTable" styleClass="data-table"
                         paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
                         lazy="true" value="#{roleMngController.dataModel}" var="row" rowKey="#{row.id}"
                         emptyMessage="无数据" selection="#{roleMngController.selectedList}"
                         rows="20" pageLinks="5">
                <p:column selectionMode="multiple" style="width: 30px;text-align: center;"/>
                <p:column headerText="角色名称">
                    <h:outputText value="#{row.name}"></h:outputText>
                </p:column>
                <p:column headerText="备注">
                    <h:outputText value="#{row.memo}"></h:outputText>
                </p:column>
            </p:dataTable>
        </p:panel>
    </h:form>
 
    <p:dialog modal="true" header="#{roleMngController.action==constants.ACTION_ADD?'新建':'修改'}" appendTo="@(body)"
              id="dialog" widgetVar="dialog" resizable="false" width="420">
        <h:form id="dialogForm">
            <p:panelGrid columns="1" styleClass="content">
                <p:outputLabel value="角色名称"></p:outputLabel>
                <p:inputText value="#{roleMngController.baseRole.name}"></p:inputText>
 
                <p:outputLabel value="备注"></p:outputLabel>
                <p:inputTextarea autoResize="false" style="height: 80px"
                                 value="#{roleMngController.baseRole.memo}"
                                 maxlength="200"></p:inputTextarea>
 
                <p:selectManyCheckbox value="#{roleMngController.baseRole.pageIdList}" layout="grid" columns="2" style="width: 100%;margin-top: 20px">
                    <f:selectItems value="#{roleMngController.basePageList}"
                                   var="item" itemLabel="#{item.name}" itemValue="#{item.id}"></f:selectItems>
                </p:selectManyCheckbox>
            </p:panelGrid>
            <p:panel styleClass="btn">
                <p:commandButton value="保存" actionListener="#{roleMngController.onSaveBtnClick}"
                                 process="@form" update=":roleMngForm:roleMngDataTable">
                    <p:confirm header="确认" message="确认操作?"></p:confirm>
                </p:commandButton>
            </p:panel>
        </h:form>
    </p:dialog>
 
    <p:dialog modal="true" header="修改" appendTo="@(body)"
              id="btnDialog" widgetVar="btnDialog" resizable="false" width="420">
        <h:form id="btnDialogForm">
            <p:panelGrid columns="1" styleClass="content">
                <p:outputLabel value="角色名称"/>
                <p:inputText value="#{roleMngController.baseRole.name}" readonly="true"/>
 
                <p:outputLabel value="人员管理页面:"/>
 
                <p:selectManyCheckbox value="#{roleMngController.baseRole.btnPermissions}" layout="grid" columns="2" style="width: 100%;">
                    <f:selectItem itemLabel="新增功能" itemValue="新增"/>
                    <f:selectItem itemLabel="修改功能" itemValue="修改"/>
                    <f:selectItem itemLabel="删除功能" itemValue="删除"/>
                    <f:selectItem itemLabel="导入功能" itemValue="导入"/>
                </p:selectManyCheckbox>
            </p:panelGrid>
            <p:panel styleClass="btn">
                <p:commandButton value="保存" actionListener="#{roleMngController.onSaveBtnPermission}"
                                 process="@form" update=":roleMngForm:roleMngDataTable">
                    <p:confirm header="确认" message="确认操作?"/>
                </p:commandButton>
            </p:panel>
        </h:form>
    </p:dialog>
 
    <p:dialog modal="true" header="修改" appendTo="@(body)"
              id="userDialog" widgetVar="userDialog" resizable="false" width="420">
        <h:form id="userDialogForm">
            <p:panelGrid columns="1" styleClass="content">
                <p:outputLabel value="角色名称"/>
                <p:inputText value="#{roleMngController.baseRole.name}" readonly="true"/>
 
                <p:outputLabel value="人员管理页面:"/>
 
                <p:selectOneRadio value="#{roleMngController.baseRole.userPermission}" layout="grid" columns="1" style="width: 100%;">
                    <f:selectItem itemLabel="可见所有人员" itemValue="所有人员"/>
                    <f:selectItem itemLabel="只可见课题组成员" itemValue="课题组"/>
                    <f:selectItem itemLabel="只可见自己" itemValue="自己"/>
                </p:selectOneRadio>
            </p:panelGrid>
            <p:panel styleClass="btn">
                <p:commandButton value="保存" actionListener="#{roleMngController.onSaveUserPermission}"
                                 process="@form" update=":roleMngForm:roleMngDataTable">
                    <p:confirm header="确认" message="确认操作?"/>
                </p:commandButton>
            </p:panel>
        </h:form>
    </p:dialog>
</ui:composition>
</html>