Blame view

resources/ftl/createTreeCode/jsp_list_Template.ftl 12.1 KB
ad5081d3   孙向锦   初始化项目
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
  <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  <%
  	String path = request.getContextPath();
  	String basePath = request.getScheme() + "://"
  			+ request.getServerName() + ":" + request.getServerPort()
  			+ path + "/";
  %>
  <!DOCTYPE html>
  <html lang="en">
  <head>
  <base href="<%=basePath%>">
  <!-- 下拉框 -->
  <link rel="stylesheet" href="static/ace/css/chosen.css" />
  <!-- jsp文件头和头部 -->
  <%@ include file="../../system/index/top.jsp"%>
  <!-- 日期框 -->
  <link rel="stylesheet" href="static/ace/css/datepicker.css" />
  </head>
  <body class="no-skin">
  
  	<!-- /section:basics/navbar.layout -->
  	<div class="main-container" id="main-container">
  		<!-- /section:basics/sidebar -->
  		<div class="main-content">
  			<div class="main-content-inner">
  				<div class="page-content">
  					<div class="row">
  						<div class="col-xs-12">
  							
  						<!-- 检索  -->
  						<form action="${objectNameLower}/list.do" method="post" name="Form" id="Form">
  						<table style="margin-top:5px;">
  							<tr>
  								<td>
  									<div class="nav-search">
  										<span class="input-icon">
  											<input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${r"${pd.keywords }"}" placeholder="这里输入关键词"/>
  											<i class="ace-icon fa fa-search nav-search-icon"></i>
  										</span>
  									</div>
  								</td>
  								<td style="padding-left:2px;"><input class="span10 date-picker" name="lastStart" id="lastStart"  value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="开始日期"/></td>
  								<td style="padding-left:2px;"><input class="span10 date-picker" name="lastEnd" name="lastEnd"  value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="结束日期"/></td>
  								<td style="vertical-align:top;padding-left:2px;">
  								 	<select class="chosen-select form-control" name="name" id="id" data-placeholder="请选择" style="vertical-align:top;width: 120px;">
  									<option value=""></option>
  									<option value="">全部</option>
  									<option value="">1</option>
  									<option value="">2</option>
  								  	</select>
  								</td>
  								<c:if test="${r"${QX.cha == 1 }"}">
  								<td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();"  title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
  								</c:if>
  								<c:if test="${r"${QX.toExcel == 1 }"}"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if>
  							</tr>
  						</table>
  						<!-- 检索  -->
  					
  						<table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">	
  							<thead>
  								<tr>
  									<th class="center" style="width:50px;">序号</th>
  									<th class="center">名称</th>
  								<#list fieldList as var>
  									<th class="center">${var[2]}</th>
  								</#list>
  									<th class="center">操作</th>
  								</tr>
  							</thead>
  													
  							<tbody>
  							<!-- 开始循环 -->	
  							<c:choose>
  								<c:when test="${r"${not empty varList}"}">
  									<c:if test="${r"${QX.cha == 1 }"}">
  									<c:forEach items="${r"${varList}"}" var="var" varStatus="vs">
  										<tr>
  											<td class='center' style="width: 30px;">${r"${vs.index+1}"}</td>
7db3ebeb   孙向锦   添加一些模块
82
  											<td class='center'><a href="javascript:goSondict('${r"${var."}ID${r"}"}')"><i class="ace-icon fa fa-share bigger-100"></i>&nbsp;${r"${var.NAME}"}</a></td>
ad5081d3   孙向锦   初始化项目
83
84
85
86
87
88
89
90
91
  										<#list fieldList as var>
  											<td class='center'>${r"${var."}${var[0]}${r"}"}</td>
  										</#list>
  											<td class="center">
  												<c:if test="${r"${QX.edit != 1 && QX.del != 1 }"}">
  												<span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  												</c:if>
  												<div class="hidden-sm hidden-xs btn-group">
  													<c:if test="${r"${QX.edit == 1 }"}">
7db3ebeb   孙向锦   添加一些模块
92
  													<a class="btn btn-xs btn-success" title="编辑" onclick="edit('${r"${var."}ID${r"}"}');">
ad5081d3   孙向锦   初始化项目
93
94
95
96
  														<i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
  													</a>
  													</c:if>
  													<c:if test="${r"${QX.del == 1 }"}">
7db3ebeb   孙向锦   添加一些模块
97
  													<a class="btn btn-xs btn-danger" onclick="del('${r"${var."}ID${r"}"}');">
ad5081d3   孙向锦   初始化项目
98
99
100
101
102
103
104
105
106
107
108
109
110
  														<i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
  													</a>
  													</c:if>
  												</div>
  												<div class="hidden-md hidden-lg">
  													<div class="inline pos-rel">
  														<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
  															<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
  														</button>
  			
  														<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  															<c:if test="${r"${QX.edit == 1 }"}">
  															<li>
7db3ebeb   孙向锦   添加一些模块
111
  																<a style="cursor:pointer;" onclick="edit('${r"${var."}ID${r"}"}');" class="tooltip-success" data-rel="tooltip" title="修改">
ad5081d3   孙向锦   初始化项目
112
113
114
115
116
117
118
119
  																	<span class="green">
  																		<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
  																	</span>
  																</a>
  															</li>
  															</c:if>
  															<c:if test="${r"${QX.del == 1 }"}">
  															<li>
7db3ebeb   孙向锦   添加一些模块
120
  																<a style="cursor:pointer;" onclick="del('${r"${var."}ID${r"}"}');" class="tooltip-error" data-rel="tooltip" title="删除">
ad5081d3   孙向锦   初始化项目
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
  																	<span class="red">
  																		<i class="ace-icon fa fa-trash-o bigger-120"></i>
  																	</span>
  																</a>
  															</li>
  															</c:if>
  														</ul>
  													</div>
  												</div>
  											</td>
  										</tr>
  									
  									</c:forEach>
  									</c:if>
  									<c:if test="${r"${QX.cha == 0 }"}">
  										<tr>
  											<td colspan="100" class="center">您无权查看</td>
  										</tr>
  									</c:if>
  								</c:when>
  								<c:otherwise>
  									<tr class="main_info">
  										<td colspan="100" class="center" >没有相关数据</td>
  									</tr>
  								</c:otherwise>
  							</c:choose>
  							</tbody>
  						</table>
  						<div class="page-header position-relative">
  						<table style="width:100%;">
  							<tr>
  								<td style="vertical-align:top;">
  									<c:if test="${r"${QX.add == 1 }"}">
7db3ebeb   孙向锦   添加一些模块
154
  									<a class="btn btn-mini btn-success" onclick="add('${r"${"}ID${r"}"}');">新增</a>
ad5081d3   孙向锦   初始化项目
155
  									</c:if>
7db3ebeb   孙向锦   添加一些模块
156
  									<c:if test="${r"${null != pd."}ID${r" && pd."}ID${r" != ''}"}">
ad5081d3   孙向锦   初始化项目
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
  									<a class="btn btn-mini btn-success" onclick="goSondict('${r"${pd.PARENT_ID}"}');">返回</a>
  									</c:if>
  								</td>
  								<td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${r"${page.pageStr}"}</div></td>
  							</tr>
  						</table>
  						</div>
  						</form>
  					
  						</div>
  						<!-- /.col -->
  					</div>
  					<!-- /.row -->
  				</div>
  				<!-- /.page-content -->
  			</div>
  		</div>
  		<!-- /.main-content -->
  
  		<!-- 返回顶部 -->
  		<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  			<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  		</a>
  
  	</div>
  	<!-- /.main-container -->
  
  	<!-- basic scripts -->
  	<!-- 页面底部js¨ -->
  	<%@ include file="../../system/index/foot.jsp"%>
  	<!-- 删除时确认窗口 -->
  	<script src="static/ace/js/bootbox.js"></script>
  	<!-- ace scripts -->
  	<script src="static/ace/js/ace/ace.js"></script>
  	<!-- 下拉框 -->
  	<script src="static/ace/js/chosen.jquery.js"></script>
  	<!-- 日期框 -->
  	<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
  	<!--提示框-->
  	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
  	<script type="text/javascript">
  		$(top.hangge());//关闭加载状态
  		//检索
  		function tosearch(){
  			//top.jzts();
  			//$("#Form").submit();
  		}
  		
  		//去此ID下子级列表
7db3ebeb   孙向锦   添加一些模块
206
  		function goSondict(ID){
ad5081d3   孙向锦   初始化项目
207
  			top.jzts();
7db3ebeb   孙向锦   添加一些模块
208
  			window.location.href="<%=basePath%>${objectNameLower}/list.do?ID="+ID;
ad5081d3   孙向锦   初始化项目
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
  		};
  		
  		$(function() {
  		
  			//日期框
  			$('.date-picker').datepicker({
  				autoclose: true,
  				todayHighlight: true
  			});
  			
  			//下拉框
  			if(!ace.vars['touch']) {
  				$('.chosen-select').chosen({allow_single_deselect:true}); 
  				$(window)
  				.off('resize.chosen')
  				.on('resize.chosen', function() {
  					$('.chosen-select').each(function() {
  						 var $this = $(this);
  						 $this.next().css({'width': $this.parent().width()});
  					});
  				}).trigger('resize.chosen');
  				$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
  					if(event_name != 'sidebar_collapsed') return;
  					$('.chosen-select').each(function() {
  						 var $this = $(this);
  						 $this.next().css({'width': $this.parent().width()});
  					});
  				});
  				$('#chosen-multiple-style .btn').on('click', function(e){
  					var target = $(this).find('input[type=radio]');
  					var which = parseInt(target.val());
  					if(which == 2) $('#form-field-select-4').addClass('tag-input-style');
  					 else $('#form-field-select-4').removeClass('tag-input-style');
  				});
  			}
  			
  		});
  		
  		//新增
7db3ebeb   孙向锦   添加一些模块
248
  		function add(ID){
ad5081d3   孙向锦   初始化项目
249
250
251
252
  			 top.jzts();
  			 var diag = new top.Dialog();
  			 diag.Drag=true;
  			 diag.Title ="新增";
7db3ebeb   孙向锦   添加一些模块
253
  			 diag.URL = '<%=basePath%>${objectNameLower}/goAdd.do?ID='+ID;
ad5081d3   孙向锦   初始化项目
254
255
256
257
258
259
260
  			 diag.Width = 800;
  			 diag.Height = 600;
  			 diag.Modal = true;				//有无遮罩窗口
  			 diag. ShowMaxButton = true;	//最大化按钮
  		     diag.ShowMinButton = true;		//最小化按钮
  			 diag.CancelEvent = function(){ //关闭事件
  				 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
7db3ebeb   孙向锦   添加一些模块
261
  					 parent.location.href="<%=basePath%>${objectNameLower}/listTree.do?ID=${r"${"}ID${r"}"}&dnowPage=${r"${page.currentPage}"}";
ad5081d3   孙向锦   初始化项目
262
263
264
265
266
267
268
269
270
271
272
  				}
  				diag.close();
  			 };
  			 diag.show();
  		}
  		
  		//删除
  		function del(Id){
  			bootbox.confirm("确定要删除吗?", function(result) {
  				if(result) {
  					top.jzts();
7db3ebeb   孙向锦   添加一些模块
273
  					var url = "<%=basePath%>${objectNameLower}/delete.do?ID="+Id+"&tm="+new Date().getTime();
ad5081d3   孙向锦   初始化项目
274
275
276
277
278
279
280
281
282
283
284
285
  					$.get(url,function(data){
  						tosearch();
  					});
  				}
  			});
  		}
  		
  		//删除
  		function del(Id){
  			bootbox.confirm("确定要删除吗?", function(result) {
  				if(result) {
  					top.jzts();
7db3ebeb   孙向锦   添加一些模块
286
  					var url = "<%=basePath%>${objectNameLower}/delete.do?ID="+Id+"&tm="+new Date().getTime();
ad5081d3   孙向锦   初始化项目
287
288
  					$.get(url,function(data){
  						if("success" == data.result){
7db3ebeb   孙向锦   添加一些模块
289
  							parent.location.href="<%=basePath%>${objectNameLower}/listTree.do?ID=${r"${"}ID${r"}"}&dnowPage=${r"${page.currentPage}"}";
ad5081d3   孙向锦   初始化项目
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
  						}else if("false" == data.result){
  							top.hangge();
  							bootbox.dialog({
  								message: "<span class='bigger-110'>删除失败!请先删除子级.</span>",
  								buttons: 			
  								{
  									"button" :
  									{
  										"label" : "确定",
  										"className" : "btn-sm btn-success"
  									}
  								}
  							});
  						}
  					});
  				}
  			});
  		}
  		
  		
  		//修改
  		function edit(Id){
  			 top.jzts();
  			 var diag = new top.Dialog();
  			 diag.Drag=true;
  			 diag.Title ="编辑";
7db3ebeb   孙向锦   添加一些模块
316
  			 diag.URL = '<%=basePath%>${objectNameLower}/goEdit.do?ID='+Id;
ad5081d3   孙向锦   初始化项目
317
318
319
320
321
322
323
  			 diag.Width = 800;
  			 diag.Height = 600;
  			 diag.Modal = true;				//有无遮罩窗口
  			 diag. ShowMaxButton = true;	//最大化按钮
  		     diag.ShowMinButton = true;		//最小化按钮
  			 diag.CancelEvent = function(){ //关闭事件
  				 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
7db3ebeb   孙向锦   添加一些模块
324
  					 parent.location.href="<%=basePath%>${objectNameLower}/listTree.do?ID=${r"${"}ID${r"}"}&dnowPage=${r"${page.currentPage}"}";
ad5081d3   孙向锦   初始化项目
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
  				}
  				diag.close();
  			 };
  			 diag.show();
  		}
  		
  		//导出excel
  		function toExcel(){
  			window.location.href='<%=basePath%>${objectNameLower}/excel.do';
  		}
  	</script>
  
  
  </body>
  </html>