kongzy
2023-10-23 1eeae82f74cbb3469ad8931e45b6fc77a945b912
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?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>
    <style type="text/css">
        div.ui-fileupload-content.ui-widget-content .ui-corner-bottom{
            display: none;
        }
 
 
    </style>
 
 
</head>
<ui:composition>
    <h:form id="fileMngForm">
        <p:panel styleClass="center-header">
            <p:outputLabel styleClass="title" value="app文件管理"></p:outputLabel>
            <p:panelGrid styleClass="filter" columns="8">
                <p:outputLabel value="app名称:"></p:outputLabel>
                <p:inputText value="#{sysFileMngController.name}"></p:inputText>
                <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink>
            </p:panelGrid>
        </p:panel>
        <p:panel styleClass="center-body">
            <p:panelGrid columns="3" styleClass="btn">
                <p:commandButton value="新建" styleClass="new-btn"
                                 process="@this"
                                 actionListener="#{sysFileMngController.onNewBtnClick}"
                                 oncomplete="PF('dialog').show();"
                                 update=":dialog,:dialogForm"></p:commandButton>
                <p:commandButton value="修改" styleClass="edit-btn"
                                 process="@form"
                                 actionListener="#{sysFileMngController.onEditBtnClick}"
                                 update=":dialog,:dialogForm"></p:commandButton>
                <p:commandButton value="删除" styleClass="del-btn"
                                 process="@form"
                                 actionListener="#{sysFileMngController.onDeleteBtnClick}"
                                 update="@form">
                    <p:confirm header="确认" message="确认操作?"></p:confirm>
                </p:commandButton>
            </p:panelGrid>
 
            <p:dataTable id="fileMngDataTable" styleClass="data-table"
                         paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
                         lazy="true" value="#{sysFileMngController.dataModel}" var="row" rowKey="#{row.id}"
                         emptyMessage="无数据" selection="#{sysFileMngController.selectedList}"
                         rows="20" pageLinks="5">
                <p:column selectionMode="multiple" style="width: 30px;text-align: center;"/>
                <p:column headerText="app名称">
                    <h:outputText value="#{row.name}"></h:outputText>
                </p:column>
                <p:column headerText="版本号">
                    <h:outputText value="#{row.version}"></h:outputText>
                </p:column>
                <p:column headerText="RFID版本">
                    <h:outputText value="1" rendered="#{row.newOrOld==1}"></h:outputText>
                    <h:outputText value="2" rendered="#{row.newOrOld==2}"></h:outputText>
                </p:column>
                <p:column headerText="文件名称">
                    <h:outputText value="#{row.fileName}"></h:outputText>
                </p:column>
                <p:column headerText="备注">
                    <h:outputText value="#{row.remark}"></h:outputText>
                </p:column>
            </p:dataTable>
        </p:panel>
    </h:form>
 
    <p:dialog modal="true" header="#{sysFileMngController.action==constants.ACTION_ADD?'新建':'修改'}" appendTo="@(body)"
              id="dialog" widgetVar="dialog" resizable="false" width="450">
        <h:form id="dialogForm" enctype="multipart/form-data">
            <p:panelGrid columns="1" styleClass="content">
                <p:row>
                    <p:column>
                        <p:outputLabel value="app名称"></p:outputLabel>
                    </p:column>
                    <p:column>
                        <p:inputText value="#{sysFileMngController.sysFile.name}" required="true" requiredMessage="请输入名称"></p:inputText>
                    </p:column>
                </p:row>
                <p:row>
                    <p:column>
                        <p:outputLabel value="RFID版本"></p:outputLabel>
                    </p:column>
                    <p:column>
                        <p:selectOneMenu value="#{sysFileMngController.sysFile.newOrOld}" required="true" requiredMessage="请选择RFID版本">
                            <f:selectItem itemLabel="请选择" itemValue="#{null}" noSelectionOption="true" ></f:selectItem>
                            <f:selectItem itemLabel="1" itemValue="1" ></f:selectItem>
                            <f:selectItem itemLabel="2" itemValue="2" ></f:selectItem>
                        </p:selectOneMenu>
                    </p:column>
                </p:row>
                <p:row>
                    <p:column>
                        <p:outputLabel value="版本号"></p:outputLabel>
                    </p:column>
                    <p:column>
                        <p:inputText  decimalPlaces="0" minValue="0"
                                      required="true" requiredMessage="请输入版本号" value="#{sysFileMngController.sysFile.version}"></p:inputText>
                    </p:column>
                </p:row>
                <p:row>
                    <p:column>
                        <p:outputLabel value="上传文件"></p:outputLabel>
                    </p:column>
 
                    <style type="text/css">
                        #dialogForm\:fileUploadComponent_label{
                            position: relative ;
                            font-size: 1.1rem ;
                            background-color: #206cdd ;
                            background-size: 46px 26px ;
                            color: white ;
                            transition: all ease 0.3s ;
                            border: unset;
                            height: 25px;
                        }
 
                        #dialogForm\:fileUploadComponent_label::after {
                            position: absolute ;
                            top: 41%;
                            right: 0.6em ;
                            transform: translateY(-50%) ;
                            content:"»" ;
                            font-size: 1.2em ;
                            transition: all ease 0.3s ;
                            opacity: 0;
                        }
                        #dialogForm\:fileUploadComponent_label:hover {
                            padding: .3em 1.8em .3em 0.9em;
                        }
 
                        .ui-button-text-icon-left .ui-button-text {
                            padding: 0.3em 1em 0.3em 1.1em;
                        }
 
                        #dialogForm\:fileUploadComponent_label:hover::after{
                            right: 0.6em;
                            opacity: 1 ;
                        }
                        #dialogForm\:fileUploadComponent .ui-icon-plusthick,#dialogForm\:fileUploadComponent>.ui-corner-bottom{
                            display: none ;
                        }
                        #dialogForm\:fileUploadComponent>.ui-corner-top{
                            background: white;
                            border: 0;
                        }
                        #dialogForm\:fileUploadComponent>.ui-fileupload-buttonbar>.ui-button{
                            float: right;
                            right: -16px;
                            text-shadow: none;
                            height: 31px;
                        }
                        #dialogForm\:fileUploadComponent_input{
                            position: absolute;
                            top: unset;
                        }
 
                        label#dialogForm\:uploadFileInfo{
                            position: absolute;
                            top: 291px;
                            width: 257px;
                            height: 25px;
                            border: 1px solid #e5e5e5!important;
                            background-color: #f7f7f7;
                            border-radius: 3px;
                            display: inline-block;
                            cursor: pointer;
                            font-family: "Oracle Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
                            -webkit-font-smoothing: antialiased;
                            font-weight: 500;
                            padding: 5px 0 0 6px;
                        }
                    </style>
                    <script type="text/javascript">
                        document.getElementById("dialogForm:fileUploadComponent_label").onclick=function (){
                            document.getElementById("dialogForm:fileUploadComponent_input").click()
                        }
 
                    </script>
                    <p:fileUpload id="fileUploadComponent" auto="true" label="选择"
                                  fileUploadListener="#{sysFileMngController.upload}"
                                  mode="advanced" dragDropSupport="false" update="uploadFileInfo" skinSimple="true"/>
 
                    <p:outputLabel id="uploadFileInfo" value="#{sysFileMngController.sysFile.fileName}"></p:outputLabel>
                </p:row>
                <p:row>
                    <p:column>
                        <p:outputLabel value="备注"></p:outputLabel>
                    </p:column>
                    <p:column>
                        <p:inputTextarea autoResize="false" style="height: 80px"
                                         value="#{sysFileMngController.sysFile.remark}"
                                         maxlength="200"></p:inputTextarea>
                    </p:column>
                </p:row>
 
 
            </p:panelGrid>
            <p:panel styleClass="btn">
                <p:commandButton value="保存" actionListener="#{sysFileMngController.onSaveBtnClick}"
                                 process="@form" update=":fileMngForm:fileMngDataTable">
                    <p:confirm header="确认" message="确认操作?"></p:confirm>
                </p:commandButton>
            </p:panel>
        </h:form>
    </p:dialog>
</ui:composition>
 
</html>