' +
65 | ''+ (v.id==null?'':v.id) +' | ' +
66 | ''+ (v.name==null?'':v.name) +' | ' +
67 | ''+ (v.createDate==null?'': getSmpFormatDateByLong(v.createDate,true)) +' | ' ;
68 | html += '查看修改删除 | ' ;
69 | html +='
' ;
70 |
71 | $list.append($(html));
72 | });
73 | }
74 | //分页结束
75 | var artdialog ;
76 | function detail(id){
77 | $.get("./"+id,{ts:new Date().getTime()},function(data){
78 | art.dialog({
79 | lock:true,
80 | opacity:0.3,
81 | title: "查看信息",
82 | width:'750px',
83 | height: 'auto',
84 | left: '50%',
85 | top: '50%',
86 | content:data,
87 | esc: true,
88 | init: function(){
89 | artdialog = this;
90 | },
91 | close: function(){
92 | artdialog = null;
93 | }
94 | });
95 | });
96 | }
97 | function edit(id){
98 | $.get("./edit/"+id,{ts:new Date().getTime()},function(data){
99 | art.dialog({
100 | lock:true,
101 | opacity:0.3,
102 | title: "修改",
103 | width:'750px',
104 | height: 'auto',
105 | left: '50%',
106 | top: '50%',
107 | content:data,
108 | esc: true,
109 | init: function(){
110 | artdialog = this;
111 | },
112 | close: function(){
113 | artdialog = null;
114 | }
115 | });
116 | });
117 | }
118 | function del(id){
119 | if(!confirm("您确定删除此记录吗?")){
120 | return false;
121 | }
122 | $.get("./delete/"+id,{ts:new Date().getTime()},function(data){
123 | if(data==1){
124 | alert("删除成功");
125 | pageaction();
126 | }else{
127 | alert(data);
128 | }
129 | });
130 | }
131 | function create(){
132 | $.get("./new",{ts:new Date().getTime()},function(data){
133 | art.dialog({
134 | lock:true,
135 | opacity:0.3,
136 | title: "新增",
137 | width:'750px',
138 | height: 'auto',
139 | left: '50%',
140 | top: '50%',
141 | content:data,
142 | esc: true,
143 | init: function(){
144 | artdialog = this;
145 | },
146 | close: function(){
147 | artdialog = null;
148 | }
149 | });
150 | });
151 | }
152 |
153 | function closeDialog() {
154 | artdialog.close();
155 | }
156 |
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/movie/new.js:
--------------------------------------------------------------------------------
1 | $(function(){
2 | $('#saveForm').validate({
3 | rules: {
4 | name :{required:true},
5 | createDate :{required:true}
6 | },messages:{
7 | name :{required:"必填"},
8 | createDate :{required:"必填"}
9 | }
10 | });
11 | $('.saveBtn').click(function(){
12 | if($('#saveForm').valid()){
13 | $.ajax({
14 | type: "POST",
15 | url: "./save",
16 | data: $("#saveForm").serialize(),
17 | headers: {"Content-type": "application/x-www-form-urlencoded;charset=UTF-8"},
18 | success: function (data) {
19 | if (data == 1) {
20 | alert("保存成功");
21 | pageaction();
22 | closeDialog();
23 | } else {
24 | alert(data);
25 | }
26 | },
27 | error:function(data){
28 | var e;
29 | $.each(data,function(v){
30 | e += v + " ";
31 | });
32 | alert(e);
33 | }
34 | });
35 | }else{
36 | alert('数据验证失败,请检查!');
37 | }
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/pagination/pagination.css:
--------------------------------------------------------------------------------
1 | .pagination a,.pagination span{margin:0px 2px;padding:2px 6px;line-height:24px;font-size:15px;display:inline-block;background:#FFF;border:1px solid #ccc;}
2 | .pagination a{border:1px solid #ccc;text-decoration:none;border-radius:2px;}
3 | .pagination .current,.pagination a:hover{background:#FFF;color:#50a73f;border:1px solid #50a73f;}
4 | #pageSelect {height: 30px}
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/pagination/wait.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chenfromsz/spring-boot-ui/2adff5373224d260ba7ec7ec13fb613086092fa7/webui/src/main/resources/static/scripts/pagination/wait.gif
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/public/public.js:
--------------------------------------------------------------------------------
1 |
2 | $.ajaxSetup({
3 | contentType : "application/x-www-form-urlencoded;charset=utf-8",
4 | complete: function(XMLHttpRequest, textStatus) {
5 | },
6 | statusCode: {
7 | 401: function() {
8 | var conf=confirm('您还未登录,或者您的登录已失效。是否需要重新登录?');
9 | if(conf==true){
10 | window.location.reload();
11 | }
12 | },
13 | 403: function() {
14 | alert('请求的页面不存在。请联系系统管理员,错误代码:403');
15 | },
16 | 404: function() {
17 | alert('数据获取/输入失败,没有此服务。请联系系统管理员,错误代码:404');
18 | },
19 | 504: function() {
20 | alert('数据获取/输入失败,服务器没有响应。请联系系统管理员,错误代码:504');
21 | },
22 | 500: function() {
23 | alert('服务器有误。请联系系统管理员,错误代码:500');
24 | },
25 | 400:function(){
26 | alert(' 由于语法格式有误,服务器无法理解此请求。请联系系统管理员,错误代码:400');
27 | }
28 | }
29 | });
30 |
31 |
32 | //扩展Date的format方法
33 | Date.prototype.format = function (format) {
34 | var o = {
35 | "M+": this.getMonth() + 1,
36 | "d+": this.getDate(),
37 | "h+": this.getHours(),
38 | "m+": this.getMinutes(),
39 | "s+": this.getSeconds(),
40 | "q+": Math.floor((this.getMonth() + 3) / 3),
41 | "S": this.getMilliseconds()
42 | }
43 | if (/(y+)/.test(format)) {
44 | format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
45 | }
46 | for (var k in o) {
47 | if (new RegExp("(" + k + ")").test(format)) {
48 | format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
49 | }
50 | }
51 | return format;
52 | }
53 | /**
54 | *转换日期对象为日期字符串
55 | * @param date 日期对象
56 | * @param isFull 是否为完整的日期数据,
57 | * 为true时, 格式如"2000-03-05 01:05:04"
58 | * 为false时, 格式如 "2000-03-05"
59 | * @return 符合要求的日期字符串
60 | */
61 | function getSmpFormatDate(date, isFull) {
62 | var pattern = "";
63 | if (isFull == true || isFull == undefined) {
64 | pattern = "yyyy-MM-dd hh:mm:ss";
65 | } else {
66 | pattern = "yyyy-MM-dd";
67 | }
68 | return getFormatDate(date, pattern);
69 | }
70 | /**
71 | *转换当前日期对象为日期字符串
72 | * @param date 日期对象
73 | * @param isFull 是否为完整的日期数据,
74 | * 为true时, 格式如"2000-03-05 01:05:04"
75 | * 为false时, 格式如 "2000-03-05"
76 | * @return 符合要求的日期字符串
77 | */
78 | function getSmpFormatNowDate(isFull) {
79 | return getSmpFormatDate(new Date(), isFull);
80 | }
81 | /**
82 | *转换long值为日期字符串
83 | * @param l long值
84 | * @param isFull 是否为完整的日期数据,
85 | * 为true时, 格式如"2000-03-05 01:05:04"
86 | * 为false时, 格式如 "2000-03-05"
87 | * @return 符合要求的日期字符串
88 | */
89 | function getSmpFormatDateByLong(l, isFull) {
90 | return getSmpFormatDate(new Date(l), isFull);
91 | }
92 | /**
93 | *转换long值为日期字符串
94 | * @param l long值
95 | * @param pattern 格式字符串,例如:yyyy-MM-dd hh:mm:ss
96 | * @return 符合要求的日期字符串
97 | */
98 | function getFormatDateByLong(l, pattern) {
99 | return getFormatDate(new Date(l), pattern);
100 | }
101 | /**
102 | *转换日期对象为日期字符串
103 | * @param l long值
104 | * @param pattern 格式字符串,例如:yyyy-MM-dd hh:mm:ss
105 | * @return 符合要求的日期字符串
106 | */
107 | function getFormatDate(date, pattern) {
108 | if (date == undefined) {
109 | date = new Date();
110 | }
111 | if (pattern == undefined) {
112 | pattern = "yyyy-MM-dd hh:mm:ss";
113 | }
114 | return date.format(pattern);
115 | }
116 |
117 |
118 | if(typeof $ =="undefined"){
119 | $={};
120 | }
121 |
122 | $.isMoney=function(x){
123 | var value=parseFloat(x);
124 | if(isNaN(value) || value>20000000.0 || value<0 || ((value+"").split(".").length==2 && (value+"").split(".")[1].length>2)){
125 | return false;
126 | }
127 | return true;
128 | };
129 |
130 | $.isPositiveNum=function(s,max){//是否为正整数
131 | var re = /^[0-9]*[1-9][0-9]*$/ ;
132 | if(re.test(s)==false){
133 | return false;
134 | }
135 | if(max==null || max==undefined ){
136 | return true;
137 | }
138 | if(parseInt(s)>max){
139 | return false;
140 | }
141 | return true;
142 | };
143 |
144 | //验证手机号
145 | String.prototype.isMobile = function() {
146 | var pattern = /^(13[0-9]{9})|(14[0-9])|(18[0-9])|(15[0-9][0-9]{8})$/;
147 | if (!pattern.exec(this)){
148 | return false;
149 | }
150 | return true;
151 | };
152 |
153 | //验证电话
154 | String.prototype.isTel = function() {
155 | return (/^(([0+]d{2,3}-)?(0d{2,3})-)(d{7,8})(-(d{3,}))?$/.test(this));
156 | };
157 |
158 | //邮箱验证函数
159 | String.prototype.isEmail=function (){
160 | var reg=/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
161 | return reg.test(this);
162 | };
163 | function trimAllText(){
164 | $("input:text").each(function(){
165 | $(this).val($.trim($(this).val()));
166 | });
167 | };
168 |
169 | $.fn.maxLength=function(){
170 | var maxLength=$(this).attr("maxLength");
171 | if(maxLength==undefined || $(this).val()==undefined){
172 | return true;
173 | }
174 | if($(this).val().length>maxLength){
175 | return false;
176 | }
177 | };
178 |
179 | $.fn.getLabel=function(){
180 | var parent=$(this).parent();
181 | if(parent.get(0).nodeName.toLowerCase()=="td"){
182 | return parent.prev("td").html();
183 | }
184 | return undefined;
185 | };
186 |
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/additional-methods.js:
--------------------------------------------------------------------------------
1 | jQuery.validator
2 | .addMethod(
3 | "byPhone",
4 | function(value, element) {
5 | var phone = /^(1[3,5,8,7]{1}[\d]{9})|(((400)-(\d{3})-(\d{4}))|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{3,7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)$/;
6 | return this.optional(element) || (phone.test(value));
7 | }, "例如:xxxx-6666666或13866668888");
8 |
9 | jQuery.validator
10 | .addMethod(
11 | "byFacsimile",
12 | function(value, element) {
13 | var facsimile =/^(\d{3}-)(\d{8})$|^(\d{4}-)(\d{7})$|^(\d{4}-)(\d{8})$/;
14 | return this.optional(element) || (facsimile.test(value));
15 | }, "例如:xxxx-6666666");
16 |
17 | jQuery.validator.addMethod("byZipCode", function(value, element) {
18 | var zipCode = /^[1-9][0-9]{5}$/;
19 | return this.optional(element) || (zipCode.test(value));
20 | }, "邮编例如:518000");
21 |
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/css/chili.css:
--------------------------------------------------------------------------------
1 | .jscom, .mix htcom { color: #4040c2; }
2 | .com { color: green; }
3 | .regexp { color: maroon; }
4 | .string { color: teal; }
5 | .keywords { color: blue; }
6 | .global { color: #008; }
7 | .numbers { color: #880; }
8 | .comm { color: green; }
9 | .tag { color: blue; }
10 | .entity { color: blue; }
11 | .string { color: teal; }
12 | .aname { color: maroon; }
13 | .avalue { color: maroon; }
14 | .jquery { color: #00a; }
15 | .plugin { color: red; }
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/css/cmxform.css:
--------------------------------------------------------------------------------
1 | /**********************************
2 |
3 | Name: cmxform Styles
4 |
5 | ***********************************/
6 | form.cmxform {
7 | width: 370px;
8 | font-size: 1.0em;
9 | color: #333;
10 | }
11 |
12 | form.cmxform legend {
13 | padding-left: 0;
14 | }
15 |
16 | form.cmxform legend, form.cmxform label {
17 | color: #333;
18 | }
19 |
20 | form.cmxform fieldset {
21 | border: none;
22 | border-top: 1px solid #C9DCA6;
23 | background: url(../../../images/cmxform-fieldset.gif) left bottom repeat-x;
24 | background-color: #F8FDEF;
25 | }
26 |
27 | form.cmxform fieldset fieldset {
28 | background: none;
29 | }
30 |
31 | form.cmxform fieldset p, form.cmxform fieldset fieldset {
32 | padding: 5px 10px 7px;
33 | background: url(../../../images/cmxform-divider.gif) left bottom repeat-x;
34 | }
35 |
36 | form.cmxform label.error, label.error {
37 | background:url("../../../images/reg.gif") no-repeat 10px 0px;
38 | padding-left: 32px;
39 | padding-bottom: 2px;
40 | font-size:12px;
41 | color: #EA5200;
42 | }
43 | form.cmxform label.checked ,label.checked{
44 | background:url("../../../images/reg.gif") no-repeat 10px -44px;
45 | }
46 |
47 | div.error { display: none; }
48 | input.checkbox { border: none }
49 | input:focus {/* border: 1px dotted black;*/ }
50 | input.error { border: 1px dotted red!important; }
51 | textarea.error { border: 1px dotted red!important; }
52 | form.cmxform .gray * { color: gray; }
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/css/cmxformTemplate.css:
--------------------------------------------------------------------------------
1 | /**********************************
2 |
3 | Use: cmxform template
4 |
5 | ***********************************/
6 | form.cmxform fieldset {
7 | margin-bottom: 10px;
8 | }
9 |
10 | form.cmxform legend {
11 | padding: 0 2px;
12 | font-weight: bold;
13 | _margin: 0 -7px; /* IE Win */
14 | }
15 |
16 | form.cmxform label {
17 | display: inline-block;
18 | line-height: 1.8;
19 | vertical-align: top;
20 | cursor: hand;
21 | }
22 |
23 | form.cmxform fieldset p {
24 | list-style: none;
25 | padding: 5px;
26 | margin: 0;
27 | }
28 |
29 | form.cmxform fieldset fieldset {
30 | border: none;
31 | margin: 3px 0 0;
32 | }
33 |
34 | form.cmxform fieldset fieldset legend {
35 | padding: 0 0 5px;
36 | font-weight: normal;
37 | }
38 |
39 | form.cmxform fieldset fieldset label {
40 | display: block;
41 | width: auto;
42 | }
43 |
44 | form.cmxform label { width: 100px; } /* Width of labels */
45 | form.cmxform fieldset fieldset label { margin-left: 103px; } /* Width plus 3 (html space) */
46 | form.cmxform label.error {
47 | margin-left: 103px;
48 | width: 220px;
49 | }
50 |
51 | form.cmxform input.submit {
52 | margin-left: 103px;
53 | }
54 |
55 | /*\*//*/ form.cmxform legend { display: inline-block; } /* IE Mac legend fix */
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/css/core.css:
--------------------------------------------------------------------------------
1 | #main { padding: 1em; }
2 | #banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc;
3 | background: url(/images/bg.gif) repeat-x; text-align: center }
4 | #banner a { color: white; }
5 | .hi-tooltip {
6 | position: absolute!important;
7 | overflow:hidden;
8 | font-size: 12px;
9 | z-index: 10000!important;
10 | width:206px;
11 | }
12 | .hi-tooltip .xtop, .hi-tooltip .xbottom { display: block; background: transparent; font-size: 1px; }
13 | .hi-tooltip .xb1, .hi-tooltip .xb2, .hi-tooltip .xb3, .tooltip .xb4 { display: block; overflow: hidden; }
14 | .hi-tooltip .xb1, .hi-tooltip .xb2, .hi-tooltip .xb3 { height: 1px; }
15 | .hi-tooltip .xb2, .hi-tooltip .xb3, .hi-tooltip .xb4 { background: #666; border-left: 1px solid #333; border-right: 1px solid #333; }
16 | .hi-tooltip .xbottom .xb2, .hi-tooltip .xbottom .xb3, .hi-tooltip .xbottom .xb4 { background: #666; }
17 | .hi-tooltip .xb1 { margin: 0 5px; background: #333; }
18 | .hi-tooltip .xb2 { margin: 0 3px; border-width: 0 2px; }
19 | .hi-tooltip .xb3 { margin: 0 2px; }
20 | .hi-tooltip .xb4 { height: 2px; margin: 0 1px; }
21 |
22 | .hi-tooltip .xboxcontent {
23 | padding: 0 .5em;
24 | margin: 0;
25 | color: #000;
26 | text-shadow: 2px 2px 0px #CCC;
27 | word-wrap:break-word;
28 | border: 1px solid #333;
29 | border-width: 0px 1px 0 1px;
30 | background-color: #666;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/css/reset.css:
--------------------------------------------------------------------------------
1 | /**********************************
2 |
3 | Use: Reset Styles for all browsers
4 |
5 | ***********************************/
6 |
7 | body, p, blockquote {
8 | margin: 0;
9 | padding: 0;
10 | }
11 |
12 | a img, iframe { border: none; }
13 |
14 | /* Headers
15 | ------------------------------*/
16 |
17 | h1, h2, h3, h4, h5, h6 {
18 | margin: 0;
19 | padding: 0;
20 | font-size: 100%;
21 | }
22 |
23 | /* Lists
24 | ------------------------------*/
25 |
26 | ul, ol, dl, li, dt, dd {
27 | margin: 0;
28 | padding: 0;
29 | }
30 |
31 | /* Links
32 | ------------------------------*/
33 |
34 | a, a:link {}
35 | a:visited {}
36 | a:hover {}
37 | a:active {}
38 |
39 | /* Forms
40 | ------------------------------*/
41 |
42 | form, fieldset {
43 | margin: 0;
44 | padding: 0;
45 | }
46 |
47 | fieldset { border: 1px solid #000; }
48 |
49 | legend {
50 | padding: 0;
51 | color: #000;
52 | }
53 |
54 | input, textarea, select {
55 | margin: 0;
56 | padding: 1px;
57 | font-size: 100%;
58 | font-family: inherit;
59 | }
60 |
61 | select { padding: 0; }
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/css/screen.css:
--------------------------------------------------------------------------------
1 | /**********************************
2 |
3 | Use: Main Screen Import
4 |
5 | ***********************************/
6 |
7 | @import "reset.css";
8 | @import "core.css";
9 | @import "cmxformTemplate.css";
10 | @import "cmxform.css";
--------------------------------------------------------------------------------
/webui/src/main/resources/static/scripts/validate/jquery.metadata.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Metadata - jQuery plugin for parsing metadata from elements
3 | *
4 | * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
5 | *
6 | * Dual licensed under the MIT and GPL licenses:
7 | * http://www.opensource.org/licenses/mit-license.php
8 | * http://www.gnu.org/licenses/gpl.html
9 | *
10 | * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
11 | *
12 | */
13 |
14 | /**
15 | * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
16 | * in the JSON will become a property of the element itself.
17 | *
18 | * There are three supported types of metadata storage:
19 | *
20 | * attr: Inside an attribute. The name parameter indicates *which* attribute.
21 | *
22 | * class: Inside the class attribute, wrapped in curly braces: { }
23 | *
24 | * elem: Inside a child element (e.g. a script tag). The
25 | * name parameter indicates *which* element.
26 | *
27 | * The metadata for an element is loaded the first time the element is accessed via jQuery.
28 | *
29 | * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
30 | * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
31 | *
32 | * @name $.metadata.setType
33 | *
34 | * @example