lyfO_o
2023-03-31 798aa9213a565c6c5ffb411e3cef40a10f99e9d1
src/main/webapp/user_mng.xhtml
@@ -35,7 +35,7 @@
            </p:panelGrid>
        </p:panel>
        <p:panel styleClass="center-body">
            <p:panelGrid columns="5" styleClass="btn">
            <p:panelGrid columns="6" styleClass="btn">
                <p:commandButton value="新建" styleClass="new-btn"
                                 process="@form"
                                 actionListener="#{userMngController.onNewBtnClick}"
@@ -60,6 +60,8 @@
                <p:outputLabel rendered="#{userMngController.isAccess('导入')}">
                    <a href="resources/template/用户导入模板.xlsx" style="display: inline-block;"><img src="resources/images/xlsx.png" width="30px;" alt=""/></a>
                </p:outputLabel>
                <p:commandButton value="导出" styleClass="new-btn" ajax="false"  actionListener="#{userMngController.exportLab2Excel}"
                />
                <script>
                    function importUser(){
                        $("#userMngForm\\:importUserBtn_input").click();
@@ -80,6 +82,9 @@
                .ui-datatable-resizable thead th, .ui-datatable-resizable tbody td {
                    white-space: normal;
                    word-break: break-all;
                }
                #dialogForm\:img-pic > tbody > tr > td:nth-child(2):has(img) {
                    width: 200px !important;
                }
            </style>
            <p:dataTable id="userMngDataTable" styleClass="data-table"
@@ -160,7 +165,8 @@
    <p:dialog modal="true" header="#{userMngController.action==constants.ACTION_ADD?'新建':'修改'}" appendTo="@(body)"
              id="dialog" widgetVar="dialog"
              resizable="false" width="800">
              resizable="false" width="900">
        <h:form id="dialogForm">
            <p:panelGrid columns="4" styleClass="content2 grid-padding-bottom2">
                <p:outputLabel value="单位"></p:outputLabel>
@@ -248,6 +254,26 @@
                    <f:selectItems value="#{userMngController.wasterSelectList}"
                                   var="item" itemLabel="#{item.text}" itemValue="#{item}"></f:selectItems>
                </p:selectOneMenu>
                <p:outputLabel value="考试分数"/>
                <p:inputNumber value="#{userMngController.sysUser.score}"  decimalPlaces="0" minValue="0"
                               > </p:inputNumber>
                <p:outputLabel />
                <p:outputLabel />
            </p:panelGrid>
            <p:panelGrid columns="4" styleClass="content2 grid-padding-bottom2" id="img-pic">
            <p:outputLabel value="图片"/>
            <p:graphicImage  rendered="#{userMngController.sysUser.url ne null and userMngController.sysUser.url ne ''}"
                         url="#{userMngController.sysUser.url}"
                         width="120"
                         height="120"/>
            <p:commandButton value="点击上传"
                             oncomplete="PF('imgDialog').show();"/>
            </p:panelGrid>
            <p:panel styleClass="btn">
                <p:commandButton value="保存" actionListener="#{userMngController.onSaveBtnClick}"
@@ -257,5 +283,27 @@
            </p:panel>
        </h:form>
    </p:dialog>
    <p:dialog modal="true" header="图片上传" appendTo="@(body)"
              id="imgDialog" widgetVar="imgDialog"
              resizable="false" width="700">
        <p:panelGrid columns="1" styleClass="content2 grid-padding-bottom2">
            <h:form id="dialogForm2">
                <p:fileUpload fileUploadListener="#{userMngController.handleImageUpload}"
                              mode="advanced"
                              dragDropSupport="false"
                              uploadLabel="上传"
                              cancelLabel="取消"
                              label="浏览"
                              invalidFileMessage="请上传gif、jpe、jpg、png文件"
                              multiple="false"
                              sizeLimit="10000000"
                              fileLimit="1"
                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
                > </p:fileUpload>
            </h:form>
        </p:panelGrid>
    </p:dialog>
</ui:composition>
</html>