testForm.jsp
7.27 KB
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
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>测试管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
$("#name").focus();
$("#inputForm").validate({
submitHandler: function(form){
loading('正在提交,请稍等...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
});
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li><a href="${ctx}/test/test/">硕正列表</a></li>
<li class="active"><a href="${ctx}/test/test/form?id=${test.id}">组件<shiro:hasPermission name="test:test:edit">${not empty test.id?'修改':'表单'}</shiro:hasPermission><shiro:lacksPermission name="test:test:edit">查看</shiro:lacksPermission></a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="test" action="${ctx}/test/test/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<div class="control-group">
<label class="control-label">名称:</label>
<div class="controls">
<form:input path="name" htmlEscape="false" maxlength="200" class="required"/>
</div>
</div>
<div class="control-group">
<label class="control-label">下拉框:</label>
<div class="controls">
<form:select path="name" class="input-medium">
<form:option value="" label="请选择"/>
<form:options items="${fns:getDictList('act_category')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label">单选框:</label>
<div class="controls">
<form:radiobuttons path="name" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</div>
</div>
<div class="control-group">
<label class="control-label">复选框:</label>
<div class="controls">
<form:checkboxes path="name" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</div>
</div>
<div class="control-group">
<label class="control-label">选人,选部门,选区域:</label>
<div class="controls">
<sys:treeselect id="user" name="user.id" value="${user.user.id}" labelName="user.name" labelValue="${user.office.name}"
title="用户" url="/sys/office/treeData?type=3" cssClass="required" allowClear="true" notAllowSelectParent="true"/>
<sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}"
title="部门" url="/sys/office/treeData?type=2" cssClass="required" notAllowSelectParent="true"/>
<sys:treeselect id="company" name="company.id" value="${user.company.id}" labelName="company.name" labelValue="${user.company.name}"
title="公司" url="/sys/office/treeData?type=1" cssClass="required"/><br/>多选:<br/>
<sys:treeselect id="user2" name="user.id" value="${user.user.id}" labelName="user.name" labelValue="${user.office.name}"
title="用户" url="/sys/office/treeData?type=3" cssClass="required" notAllowSelectParent="true" checked="true"/>
<sys:treeselect id="office2" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}"
title="部门" url="/sys/office/treeData?type=2" cssClass="required" notAllowSelectParent="true" checked="true"/>
<sys:treeselect id="company2" name="company.id" value="${user.company.id}" labelName="company.name" labelValue="${user.company.name}"
title="公司" url="/sys/office/treeData?type=1" cssClass="required" notAllowSelectParent="true" checked="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">上传图片、文件:</label>
<div class="controls">
<form:hidden id="nameImage" path="name" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameImage" type="images" uploadPath="/test/test" selectMultiple="false"/>
<form:hidden id="nameFiles" path="name" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameFiles" type="files" uploadPath="/test/test" selectMultiple="true"/>
</div>
</div>
<div class="control-group">
<label class="control-label">富文本编辑器:</label>
<div class="controls">
<form:textarea id="remarks" htmlEscape="true" path="remarks" rows="4" maxlength="200" class="input-xxlarge"/>
<sys:ckeditor replace="remarks" uploadPath="/test/test" />
</div>
</div>
<div class="control-group">
<label class="control-label">多行文本框:</label>
<div class="controls">
<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="200" class="input-xxlarge"/>
</div>
</div>
<div class="control-group">
<label class="control-label">验证码:</label>
<div class="controls">
<label class="input-label mid" for="validateCode">验证码</label>
<sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
</div>
</div>
<div class="control-group">
<label class="control-label">JSTL、EL:</label>
<div class="controls">
日期格式:<fmt:formatDate value="${test.createDate}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
<input id="createDate" name="createDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
value="<fmt:formatDate value="${test.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss' });"/>
<br/>
当前用户:${fns:getUser().name}<br/>
当前用户缓存:${fns:getCache('menuList','')[0]}<br/>
当前用户部门:${fns:getOfficeList()[0]}<br/>
字典取值:[${fns:getDictLabel('0', 'yes_no', '未知')}, ${fns:getDictLabel('1', 'yes_no', '未知')}]
字典取列表:${fns:getDictList('yes_no')}<br/>
</div>
</div>
<div class="control-group">
<label class="control-label">CSS、JS:</label>
<div class="controls">
<a class="btn" href="${ctxStatic}/bootstrap/2.3.1/docs/index.html">Bootstrap</a>
<a class="btn" href="http://ivaynberg.github.io/select2/">多功能下拉框组件</a>
<a class="btn" href="${ctxStatic}/jquery-ztree/3.5.12/demo/cn/index.html">树结构组件</a>
<input class="btn" type="button" value="对话框" onclick="top.$.jBox('iframe:${ctxStatic}/jquery-jbox/2.3/docs/jbox-demo.html',{title: '对话框',width: 950,height: 600,buttons: { '关闭': true }});"/>
<input class="btn" type="button" value="客户端验证" onclick="top.$.jBox('iframe:${ctxStatic}/jquery-validation/1.11.0/demo/index.html',{title: '客户端验证',width: 950,height: 600,buttons: { '关闭': true }});"/>
</div>
</div>
<div class="form-actions">
<shiro:hasPermission name="test:test:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/> </shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>
</form:form>
</body>
</html>