add.vm
4.68 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
141
142
143
144
145
146
147
148
149
150
#set($link=${webUtils.getLocalPath("DataDictionary/list.do")})
#set($page_title="添加数据字典")
#set($crumbs="首页:/home,数据字典管理:"+$link+",数据字典变量")
<div class="page-content">
<div class="page-header">
<span class="pull-right"><a href="${webUtils.getLocalPath("DataDictionary/list.do")}" class="btn btn-white btn-default">返回</a></span>
<h1>
<small>
<i class="icon-double-angle-right"></i>
添加数据字典
</small>
</h1>
</div>
<!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
<!-- PAGE CONTENT BEGINS -->
<form class="form-horizontal" role="form" method="post" id="addForm">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right"
for="form-field-2"> 字典编码: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
#if(${model})
$!{model.code}
<input type="hidden" value="$!{model.id}" name="dic.id" />
#else
<input type="text"
placeholder="变量编码" name="dic.code"
required
data-bv-message="必须填写!"
data-bv-stringlength-message="超出了最大范围!"
data-bv-stringlength
data-bv-stringlength-max="25"
maxlength="25"
class="width-100"
value="$!{model.code}">
<i class="ace-icon fa fa-asterisk orange"></i>
#end
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right"
for="form-field-5"> 字典名称: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<input type="text"
placeholder="变量名称" name="dic.name"
required
data-bv-message="必须填写!"
data-bv-stringlength-message="超出了最大范围!"
data-bv-stringlength
data-bv-stringlength-max="25"
maxlength="25"
value="$!{model.name}"
class="width-100"
value="$!{model.name}">
<i class="ace-icon fa fa-asterisk orange"></i>
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right"
for="form-field-6"> 字典描述: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<textarea class="form-control limited" name="dic.remark"
data-bv-stringlength-message="超出了最大范围!"
data-bv-stringlength
data-bv-stringlength-max="500"
maxlength="500">$!{model.remark}</textarea>
</span>
</div>
</div>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit">
<i class="icon-ok bigger-110"></i>
提交
</button>
<a href="${webUtils.getLocalPath("DataDictionary/list.do")}" class="btn" >
<i class="icon-undo bigger-110"></i>
返回
</a>
</div>
</div>
</form>
</div>
</div>
</div>
<link rel="stylesheet" href="$!{webUtils.getAssetsPath("/css/validator/bootstrapValidator.min.css")}" />
<script type="text/javascript" src="$!{webUtils.getAssetsPath("/js/validator/bootstrapValidator.min.js")}"></script>
<script type="text/javascript" src="$!{webUtils.getAssetsPath("/js/bootbox.min.js")}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#addForm').bootstrapValidator({submitHandler: function(validator, form, submitButton) {
var data = $('#addForm').serializeArray();
#if(${model})
var url = "$!{webUtils.getLocalPath("DataDictionary/edit.do")}";
#else
var url = "$!{webUtils.getLocalPath("DataDictionary/save.do")}";
#end
$.ajax({
url: url,
type : "post",
data : data,
success : function (data){
if(data.succ){
window.location = "$!{webUtils.getLocalPath("DataDictionary/list.do")}?succ=true";
}else {
var msg = null;
switch(data.code){
case 10000:
msg = "参数错误";
break;
case 10100:
msg = "该数据字典已经存在了";
break;
case 10200:
msg = "该数据字典已经不能存在了";
break;
default:
msg = "操作失败!";
break;
}
alert(msg);
}
}
});
}});
});
</script>