…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/laytpl.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.5 MIT License By https://www.layui.com */
2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/mobile/layer-mobile.js:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @Name:layer mobile v2.0.0 弹层组件移动版
4 | @Author:贤心
5 | @Site:http://layer.layui.com/mobie/
6 | @License:MIT
7 |
8 | */
9 |
10 | layui.define(function(exports){
11 |
12 | "use strict";
13 |
14 | var win = window, doc = document, query = 'querySelectorAll', claname = 'getElementsByClassName', S = function(s){
15 | return doc[query](s);
16 | };
17 |
18 | //默认配置
19 | var config = {
20 | type: 0
21 | ,shade: true
22 | ,shadeClose: true
23 | ,fixed: true
24 | ,anim: 'scale' //默认动画类型
25 | };
26 |
27 | var ready = {
28 | extend: function(obj){
29 | var newobj = JSON.parse(JSON.stringify(config));
30 | for(var i in obj){
31 | newobj[i] = obj[i];
32 | }
33 | return newobj;
34 | },
35 | timer: {}, end: {}
36 | };
37 |
38 | //点触事件
39 | ready.touch = function(elem, fn){
40 | elem.addEventListener('click', function(e){
41 | fn.call(this, e);
42 | }, false);
43 | };
44 |
45 | var index = 0, classs = ['layui-m-layer'], Layer = function(options){
46 | var that = this;
47 | that.config = ready.extend(options);
48 | that.view();
49 | };
50 |
51 | Layer.prototype.view = function(){
52 | var that = this, config = that.config, layerbox = doc.createElement('div');
53 |
54 | that.id = layerbox.id = classs[0] + index;
55 | layerbox.setAttribute('class', classs[0] + ' ' + classs[0]+(config.type || 0));
56 | layerbox.setAttribute('index', index);
57 |
58 | //标题区域
59 | var title = (function(){
60 | var titype = typeof config.title === 'object';
61 | return config.title
62 | ? ''+ (titype ? config.title[0] : config.title) +'
'
63 | : '';
64 | }());
65 |
66 | //按钮区域
67 | var button = (function(){
68 | typeof config.btn === 'string' && (config.btn = [config.btn]);
69 | var btns = (config.btn || []).length, btndom;
70 | if(btns === 0 || !config.btn){
71 | return '';
72 | }
73 | btndom = ''+ config.btn[0] +''
74 | if(btns === 2){
75 | btndom = ''+ config.btn[1] +'' + btndom;
76 | }
77 | return ''+ btndom + '
';
78 | }());
79 |
80 | if(!config.fixed){
81 | config.top = config.hasOwnProperty('top') ? config.top : 100;
82 | config.style = config.style || '';
83 | config.style += ' top:'+ ( doc.body.scrollTop + config.top) + 'px';
84 | }
85 |
86 | if(config.type === 2){
87 | config.content = ''+ (config.content||'') +'
';
88 | }
89 |
90 | if(config.skin) config.anim = 'up';
91 | if(config.skin === 'msg') config.shade = false;
92 |
93 | layerbox.innerHTML = (config.shade ? '' : '')
94 | +''
95 | +'
'
96 | +'
'
97 | + title
98 | +'
'+ config.content +'
'
99 | + button
100 | +'
'
101 | +'
'
102 | +'
';
103 |
104 | if(!config.type || config.type === 2){
105 | var dialogs = doc[claname](classs[0] + config.type), dialen = dialogs.length;
106 | if(dialen >= 1){
107 | layer.close(dialogs[0].getAttribute('index'))
108 | }
109 | }
110 |
111 | document.body.appendChild(layerbox);
112 | var elem = that.elem = S('#'+that.id)[0];
113 | config.success && config.success(elem);
114 |
115 | that.index = index++;
116 | that.action(config, elem);
117 | };
118 |
119 | Layer.prototype.action = function(config, elem){
120 | var that = this;
121 |
122 | //自动关闭
123 | if(config.time){
124 | ready.timer[that.index] = setTimeout(function(){
125 | layer.close(that.index);
126 | }, config.time*1000);
127 | }
128 |
129 | //确认取消
130 | var btn = function(){
131 | var type = this.getAttribute('type');
132 | if(type == 0){
133 | config.no && config.no();
134 | layer.close(that.index);
135 | } else {
136 | config.yes ? config.yes(that.index) : layer.close(that.index);
137 | }
138 | };
139 | if(config.btn){
140 | var btns = elem[claname]('layui-m-layerbtn')[0].children, btnlen = btns.length;
141 | for(var ii = 0; ii < btnlen; ii++){
142 | ready.touch(btns[ii], btn);
143 | }
144 | }
145 |
146 | //点遮罩关闭
147 | if(config.shade && config.shadeClose){
148 | var shade = elem[claname]('layui-m-layershade')[0];
149 | ready.touch(shade, function(){
150 | layer.close(that.index, config.end);
151 | });
152 | }
153 |
154 | config.end && (ready.end[that.index] = config.end);
155 | };
156 |
157 | var layer = {
158 | v: '2.0 m',
159 | index: index,
160 |
161 | //核心方法
162 | open: function(options){
163 | var o = new Layer(options || {});
164 | return o.index;
165 | },
166 |
167 | close: function(index){
168 | var ibox = S('#'+classs[0]+index)[0];
169 | if(!ibox) return;
170 | ibox.innerHTML = '';
171 | doc.body.removeChild(ibox);
172 | clearTimeout(ready.timer[index]);
173 | delete ready.timer[index];
174 | typeof ready.end[index] === 'function' && ready.end[index]();
175 | delete ready.end[index];
176 | },
177 |
178 | //关闭所有layer层
179 | closeAll: function(){
180 | var boxs = doc[claname](classs[0]);
181 | for(var i = 0, len = boxs.length; i < len; i++){
182 | layer.close((boxs[0].getAttribute('index')|0));
183 | }
184 | }
185 | };
186 |
187 | exports('layer-mobile', layer);
188 |
189 | });
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/mobile/layim-mobile-open.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:layim mobile 开源包
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define(function(exports){
10 | exports('layim-mobile', layui.v);
11 | });
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/mobile/upload-mobile.js:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @Title: layui.upload 单文件上传 - 全浏览器兼容版
4 | @Author: 贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define(['layer-mobile', 'zepto'] , function(exports){
10 | "use strict";
11 |
12 | var $ = layui.zepto;
13 | var layer = layui['layer-mobile'];
14 | var device = layui.device();
15 |
16 | var elemDragEnter = 'layui-upload-enter';
17 | var elemIframe = 'layui-upload-iframe';
18 |
19 | var msgConf = {
20 | icon: 2
21 | ,shift: 6
22 | }, fileType = {
23 | file: '文件'
24 | ,video: '视频'
25 | ,audio: '音频'
26 | };
27 |
28 | layer.msg = function(content){
29 | return layer.open({
30 | content: content || ''
31 | ,skin: 'msg'
32 | ,time: 2 //2秒后自动关闭
33 | });
34 | };
35 |
36 | var Upload = function(options){
37 | this.options = options;
38 | };
39 |
40 | //初始化渲染
41 | Upload.prototype.init = function(){
42 | var that = this, options = that.options;
43 | var body = $('body'), elem = $(options.elem || '.layui-upload-file');
44 | var iframe = $('');
45 |
46 | //插入iframe
47 | $('#'+elemIframe)[0] || body.append(iframe);
48 |
49 | return elem.each(function(index, item){
50 | item = $(item);
51 | var form = '';
52 |
53 | var type = item.attr('lay-type') || options.type; //获取文件类型
54 |
55 | //包裹ui元素
56 | if(!options.unwrap){
57 | form = '' + form + ''+ (
58 | item.attr('lay-title') || options.title|| ('上传'+ (fileType[type]||'图片') )
59 | ) +'
';
60 | }
61 |
62 | form = $(form);
63 |
64 | //拖拽支持
65 | if(!options.unwrap){
66 | form.on('dragover', function(e){
67 | e.preventDefault();
68 | $(this).addClass(elemDragEnter);
69 | }).on('dragleave', function(){
70 | $(this).removeClass(elemDragEnter);
71 | }).on('drop', function(){
72 | $(this).removeClass(elemDragEnter);
73 | });
74 | }
75 |
76 | //如果已经实例化,则移除包裹元素
77 | if(item.parent('form').attr('target') === elemIframe){
78 | if(options.unwrap){
79 | item.unwrap();
80 | } else {
81 | item.parent().next().remove();
82 | item.unwrap().unwrap();
83 | }
84 | };
85 |
86 | //包裹元素
87 | item.wrap(form);
88 |
89 | //触发上传
90 | item.off('change').on('change', function(){
91 | that.action(this, type);
92 | });
93 | });
94 | };
95 |
96 | //提交上传
97 | Upload.prototype.action = function(input, type){
98 | var that = this, options = that.options, val = input.value;
99 | var item = $(input), ext = item.attr('lay-ext') || options.ext || ''; //获取支持上传的文件扩展名;
100 |
101 | if(!val){
102 | return;
103 | };
104 |
105 | //校验文件
106 | switch(type){
107 | case 'file': //一般文件
108 | if(ext && !RegExp('\\w\\.('+ ext +')$', 'i').test(escape(val))){
109 | layer.msg('不支持该文件格式', msgConf);
110 | return input.value = '';
111 | }
112 | break;
113 | case 'video': //视频文件
114 | if(!RegExp('\\w\\.('+ (ext||'avi|mp4|wma|rmvb|rm|flash|3gp|flv') +')$', 'i').test(escape(val))){
115 | layer.msg('不支持该视频格式', msgConf);
116 | return input.value = '';
117 | }
118 | break;
119 | case 'audio': //音频文件
120 | if(!RegExp('\\w\\.('+ (ext||'mp3|wav|mid') +')$', 'i').test(escape(val))){
121 | layer.msg('不支持该音频格式', msgConf);
122 | return input.value = '';
123 | }
124 | break;
125 | default: //图片文件
126 | if(!RegExp('\\w\\.('+ (ext||'jpg|png|gif|bmp|jpeg') +')$', 'i').test(escape(val))){
127 | layer.msg('不支持该图片格式', msgConf);
128 | return input.value = '';
129 | }
130 | break;
131 | }
132 |
133 | options.before && options.before(input);
134 | item.parent().submit();
135 |
136 | var iframe = $('#'+elemIframe), timer = setInterval(function() {
137 | var res;
138 | try {
139 | res = iframe.contents().find('body').text();
140 | } catch(e) {
141 | layer.msg('上传接口存在跨域', msgConf);
142 | clearInterval(timer);
143 | }
144 | if(res){
145 | clearInterval(timer);
146 | iframe.contents().find('body').html('');
147 | try {
148 | res = JSON.parse(res);
149 | } catch(e){
150 | res = {};
151 | return layer.msg('请对上传接口返回JSON字符', msgConf);
152 | }
153 | typeof options.success === 'function' && options.success(res, input);
154 | }
155 | }, 30);
156 |
157 | input.value = '';
158 | };
159 |
160 | //暴露接口
161 | exports('upload-mobile', function(options){
162 | var upload = new Upload(options = options || {});
163 | upload.init();
164 | });
165 | });
166 |
167 |
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/tree.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.5 MIT License By https://www.layui.com */
2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o(''),s=o(["",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),""].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o(''));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/upload.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.5 MIT License By https://www.layui.com */
2 | ;layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",f="layui-upload-iframe",s="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap(''),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['"].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(f)||(e.elemFile.wrap(a),t.elem.next("."+f).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){r.append(e,i)}),i.ajax({url:l.url,type:l.method,data:r,contentType:!1,processData:!1,dataType:"json",success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)});
--------------------------------------------------------------------------------
/src/main/resources/static/layui/lay/modules/util.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.5 MIT License By https://www.layui.com */
2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['',e.bar1?'- '+c[0]+"
":"",e.bar2?'- '+c[1]+"
":"",'- '+c[2]+"
","
"].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void(n.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(n.modules[f])!function g(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void("string"==typeof n.modules[f]&&n.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":n.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[f]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,t(o)},void(o.onerror=function(e){o.onerror=null,n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(n.href=e=e.replace(/^#\//,""),e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r
2 |
3 |
4 |
5 |
6 | 任务组列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
30 |
31 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/src/main/resources/templates/quartz/quartzList.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 任务列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
32 |
33 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/src/test/java/com/baozi/ElasticsearchTest.java:
--------------------------------------------------------------------------------
1 | package com.baozi;
2 |
3 | import com.baozi.configurer.ElasticsearchConfig;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 | import org.springframework.test.context.web.WebAppConfiguration;
9 |
10 | /**
11 | * Copyright: 张文君
12 | *
13 | * @author: zhangwenjun
14 | * @version: V1.0
15 | * @Date: 2019-05-14 13:20
16 | */
17 | @RunWith(SpringRunner.class)
18 | @SpringBootTest
19 | @WebAppConfiguration
20 | public class ElasticsearchTest {
21 |
22 | @Test
23 | public void centralized(){
24 | //System.out.println(ElasticsearchConfig.deleteIndex("goods_oupon"));
25 | //System.out.println(ElasticsearchConfig.createIndex("goods_oupon","goods_oupon"));
26 | //System.out.println(ElasticsearchConfig.batchImportData("goods_oupon"));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/com/baozi/MpCodeGenerator.java:
--------------------------------------------------------------------------------
1 | package com.baozi;
2 |
3 | import com.baomidou.mybatisplus.generator.AutoGenerator;
4 | import com.baomidou.mybatisplus.generator.InjectionConfig;
5 | import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
6 | import com.baomidou.mybatisplus.generator.config.GlobalConfig;
7 | import com.baomidou.mybatisplus.generator.config.PackageConfig;
8 | import com.baomidou.mybatisplus.generator.config.StrategyConfig;
9 | import com.baomidou.mybatisplus.generator.config.rules.DbType;
10 | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
11 | import org.junit.Test;
12 |
13 | import java.util.HashMap;
14 | import java.util.Map;
15 |
16 | /**
17 | * Copyright: 张文君
18 | * 代码生成器演示
19 | * @author: zhangwenjun
20 | * @version: V1.0
21 | * @Date: 2018-08-01 11:13
22 | */
23 | public class MpCodeGenerator {
24 |
25 | @Test
26 | public void codeGenerator(){
27 | AutoGenerator mpg = new AutoGenerator();
28 | //1.全局配置
29 | GlobalConfig gc = new GlobalConfig();
30 | gc.setOutputDir("C:\\Users\\Administrator\\Desktop");
31 | gc.setFileOverride(true);
32 | gc.setActiveRecord(true);
33 | //XML二级缓存
34 | gc.setEnableCache(false);
35 | //XML ResultMap
36 | gc.setBaseResultMap(true);
37 | //XML columList
38 | gc.setBaseColumnList(true);
39 | gc.setAuthor("wenjunzhangp");
40 | // 自定义文件命名,注意 %s 会自动填充表实体属性!
41 | // gc.setMapperName("%sDao");
42 | // gc.setXmlName("%sDao");
43 | // gc.setServiceName("MP%sService");
44 | // gc.setServiceImplName("%sServiceDiy");
45 | // gc.setControllerName("%sAction");
46 | mpg.setGlobalConfig(gc);
47 | //2.数据源配置
48 | DataSourceConfig dsc = new DataSourceConfig();
49 | dsc.setDbType(DbType.MYSQL);
50 | dsc.setDriverName("com.mysql.jdbc.Driver");
51 | dsc.setUsername("root");
52 | dsc.setPassword("Zz971886506");
53 | dsc.setUrl("jdbc:mysql://123.56.219.123:3306/test?characterEncoding=utf8");
54 | mpg.setDataSource(dsc);
55 | //3.策略配置
56 | StrategyConfig strategy = new StrategyConfig();
57 | //此处可以修改为您的表前缀
58 | //strategy.setTablePrefix("beautiful_");
59 | //表名生成策略
60 | strategy.setNaming(NamingStrategy.underline_to_camel);
61 | //需要生成的表
62 | //strategy.setInclude(new String[] { "admin_operator_log"});
63 | //排除生成的表
64 | //strategy.setExclude(new String[]{"test"});
65 | //字段名生成策略
66 | strategy.setFieldNaming(NamingStrategy.underline_to_camel);
67 | // 自定义实体父类
68 | // strategy.setSuperEntityClass("com.baomidou.demo.TestEntity");
69 | // 自定义实体,公共字段
70 | // strategy.setSuperEntityColumns(new String[] { "test_id", "age" });
71 | // 自定义 mapper 父类
72 | // strategy.setSuperMapperClass("com.baomidou.demo.TestMapper");
73 | // 自定义 service 父类
74 | // strategy.setSuperServiceClass("com.baomidou.demo.TestService");
75 | // 自定义 service 实现类父类
76 | // strategy.setSuperServiceImplClass("com.baomidou.demo.TestServiceImpl");
77 | // 自定义 controller 父类
78 | // strategy.setSuperControllerClass("com.baomidou.demo.TestController");
79 | // 【实体】是否生成字段常量(默认 false)
80 | // public static final String ID = "test_id";
81 | // strategy.setEntityColumnConstant(true);
82 | // 【实体】是否为构建者模型(默认 false)
83 | // public User setName(String name) {this.name = name; return this;}
84 | // strategy.setEntityBuliderModel(true);
85 | mpg.setStrategy(strategy);
86 | //4.包配置
87 | PackageConfig pc = new PackageConfig();
88 | pc.setParent("com");
89 | pc.setModuleName("baozi");
90 | pc.setXml("dao");
91 | mpg.setPackageInfo(pc);
92 | // 注入自定义配置,可以在 VM 中使用 cfg.abc 设置的值
93 | InjectionConfig cfg = new InjectionConfig() {
94 | @Override
95 | public void initMap() {
96 | Map map = new HashMap();
97 | map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");
98 | this.setMap(map);
99 | }
100 | };
101 | mpg.setCfg(cfg);
102 | // 自定义模板配置,可以 copy 源码 mybatis-plus/src/main/resources/template 下面内容修改,
103 | // 放置自己项目的 src/main/resources/template 目录下, 默认名称一下可以不配置,也可以自定义模板名称
104 | // TemplateConfig tc = new TemplateConfig();
105 | // tc.setController("...");
106 | // tc.setEntity("...");
107 | // tc.setMapper("...");
108 | // tc.setXml("...");
109 | // tc.setService("...");
110 | // tc.setServiceImpl("...");
111 | // mpg.setTemplate(tc);
112 | // 执行生成
113 | mpg.execute();
114 | // 打印注入设置
115 | System.err.println(mpg.getCfg().getMap().get("abc"));
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/src/test/java/com/baozi/RedisTest.java:
--------------------------------------------------------------------------------
1 | package com.baozi;
2 |
3 | import com.baozi.util.RedisUtil;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 | import org.springframework.test.context.web.WebAppConfiguration;
9 |
10 | /**
11 | * Copyright: 张文君
12 | *
13 | * @author: zhangwenjun
14 | * @version: V1.0
15 | * @Date: 2018-08-08 12:57
16 | */
17 | @RunWith(SpringRunner.class)
18 | @SpringBootTest
19 | @WebAppConfiguration
20 | public class RedisTest {
21 |
22 | @Test
23 | public void centralized(){
24 | RedisUtil.setex("baozi","zhangwnejun",60);
25 | System.out.println(RedisUtil.getStr("baozi"));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------