';
+
+ // 计算分页数据
+ var _limit = limit, // 每页显示数量
+ _pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1), // 总计多少页
+ _id = PAGE_ID;
+
+ // 图标列表
+ var icons = [];
+
+ for (var i = 0; i < l; i++) {
+ var obj = d[i];
+
+ // 判断是否模糊查询
+ if (text && obj.indexOf(text) === -1) {
+ continue;
+ }
+
+ // 每个图标dom
+ var icon = '
';
+
+ icons.push(icon);
+ }
+
+ // 查询出图标后再分页
+ l = icons.length;
+ _pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1);
+ for (var i = 0; i < _pages; i++) {
+ // 按limit分块
+ var lm = $('
');
+
+ for (var j = i * _limit; j < (i+1) * _limit && j < l; j++) {
+ lm.append(icons[j]);
+ }
+
+ listHtml.append(lm);
+ }
+
+ // 无数据
+ if (l === 0) {
+ listHtml.append('
无数据
');
+ }
+
+ // 判断是否分页
+ if (page){
+ $('#' + PICKER_BODY).addClass('layui-iconpicker-body-page');
+ pageHtml = '
' +
+ '
' +
+ '1/' +
+ ''+ _pages +'' +
+ ' ('+ l +')' +
+ '
' +
+ '
' +
+ ' ' +
+ ' ' +
+ '
' +
+ '
';
+ }
+
+
+ $('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
+ return a;
+ },
+ // 分页
+ page: function () {
+ var icon = '#' + PAGE_ID + ' .layui-iconpicker-page-operate .layui-icon';
+
+ $(icon).unbind('click');
+ a.event('click', icon, function (e) {
+ var elem = e.currentTarget,
+ total = parseInt($('#' +PAGE_ID + '-pages').html()),
+ isPrev = $(elem).attr('prev') !== undefined,
+ // 按钮上标的页码
+ index = parseInt($(elem).attr('data-index')),
+ $cur = $('#' +PAGE_ID + '-current'),
+ // 点击时正在显示的页码
+ current = parseInt($cur.html());
+
+ // 分页数据
+ if (isPrev && current > 1) {
+ current=current-1;
+ $(icon + '[prev]').attr('data-index', current);
+ } else if (!isPrev && current < total){
+ current=current+1;
+ $(icon + '[next]').attr('data-index', current);
+ }
+ $cur.html(current);
+
+ // 图标数据
+ $('.layui-iconpicker-icon-limit').hide();
+ $('#layui-iconpicker-icon-limit-' + current).show();
+ e.stopPropagation();
+ });
+ return a;
+ },
+ /**
+ * 搜索
+ */
+ search: function () {
+ var item = '#' + PICKER_BODY + ' .layui-iconpicker-search .layui-input';
+ a.event('input propertychange', item, function (e) {
+ var elem = e.target,
+ t = $(elem).val();
+ a.createList(t);
+ });
+ a.event('click', item, function (e) {
+ e.stopPropagation();
+ });
+ return a;
+ },
+ /**
+ * 点击选中图标
+ */
+ check: function () {
+ var item = '#' + PICKER_BODY + ' .layui-iconpicker-icon-item';
+ a.event('click', item, function (e) {
+ var el = $(e.currentTarget).find('.layui-icon'),
+ icon = '';
+ if (isFontClass) {
+ var clsArr = el.attr('class').split(/[\s\n]/),
+ cls = clsArr[1],
+ icon = cls;
+ $('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html('').attr('class', clsArr.join(' '));
+ } else {
+ var cls = el.html(),
+ icon = cls;
+ $('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html(icon);
+ }
+
+ $('#' + ICON_BODY).removeClass(selected).addClass(unselect);
+ $(elem).attr('value', icon);
+ // 回调
+ if (click) {
+ click({
+ icon: icon
+ });
+ }
+
+ });
+ return a;
+ },
+ event: function (evt, el, fn) {
+ $(BODY).on(evt, el, fn);
+ }
+ };
+
+ var common = {
+ /**
+ * 加载样式表
+ */
+ loadCss: function () {
+ var css = '.layui-iconpicker {max-width: 280px;}.layui-iconpicker .layui-anim{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box;}.layui-iconpicker-item{border:1px solid #e6e6e6;width:90px;height:38px;border-radius:4px;cursor:pointer;position:relative;}.layui-iconpicker-icon{border-right:1px solid #e6e6e6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:60px;height:100%;float:left;text-align:center;background:#fff;transition:all .3s;}.layui-iconpicker-icon i{line-height:38px;font-size:18px;}.layui-iconpicker-item > .layui-edge{left:70px;}.layui-iconpicker-item:hover{border-color:#D2D2D2!important;}.layui-iconpicker-item:hover .layui-iconpicker-icon{border-color:#D2D2D2!important;}.layui-iconpicker.layui-form-selected .layui-anim{display:block;}.layui-iconpicker-body{padding:6px;}.layui-iconpicker .layui-iconpicker-list{background-color:#fff;border:1px solid #ccc;border-radius:4px;}.layui-iconpicker .layui-iconpicker-icon-item{display:inline-block;width:21.1%;line-height:36px;text-align:center;cursor:pointer;vertical-align:top;height:36px;margin:4px;border:1px solid #ddd;border-radius:2px;transition:300ms;}.layui-iconpicker .layui-iconpicker-icon-item i.layui-icon{font-size:17px;}.layui-iconpicker .layui-iconpicker-icon-item:hover{background-color:#eee;border-color:#ccc;-webkit-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;-moz-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;box-shadow:0 0 2px #aaa,0 0 2px #fff inset;text-shadow:0 0 1px #fff;}.layui-iconpicker-search{position:relative;margin:0 0 6px 0;border:1px solid #e6e6e6;border-radius:2px;transition:300ms;}.layui-iconpicker-search:hover{border-color:#D2D2D2!important;}.layui-iconpicker-search .layui-input{cursor:text;display:inline-block;width:86%;border:none;padding-right:0;margin-top:1px;}.layui-iconpicker-search .layui-icon{position:absolute;top:11px;right:4%;}.layui-iconpicker-tips{text-align:center;padding:8px 0;cursor:not-allowed;}.layui-iconpicker-page{margin-top:6px;margin-bottom:-6px;font-size:12px;padding:0 2px;}.layui-iconpicker-page-count{display:inline-block;}.layui-iconpicker-page-operate{display:inline-block;float:right;cursor:default;}.layui-iconpicker-page-operate .layui-icon{font-size:12px;cursor:pointer;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit{display:none;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit:first-child{display:block;}';
+ $('head').append('');
+ },
+ /**
+ * 获取数据
+ */
+ getData: {
+ fontClass: function () {
+ var arr = ["layui-icon-rate-half","layui-icon-rate","layui-icon-rate-solid","layui-icon-cellphone","layui-icon-vercode","layui-icon-login-wechat","layui-icon-login-qq","layui-icon-login-weibo","layui-icon-password","layui-icon-username","layui-icon-refresh-3","layui-icon-auz","layui-icon-spread-left","layui-icon-shrink-right","layui-icon-snowflake","layui-icon-tips","layui-icon-note","layui-icon-home","layui-icon-senior","layui-icon-refresh","layui-icon-refresh-1","layui-icon-flag","layui-icon-theme","layui-icon-notice","layui-icon-website","layui-icon-console","layui-icon-face-surprised","layui-icon-set","layui-icon-template-1","layui-icon-app","layui-icon-template","layui-icon-praise","layui-icon-tread","layui-icon-male","layui-icon-female","layui-icon-camera","layui-icon-camera-fill","layui-icon-more","layui-icon-more-vertical","layui-icon-rmb","layui-icon-dollar","layui-icon-diamond","layui-icon-fire","layui-icon-return","layui-icon-location","layui-icon-read","layui-icon-survey","layui-icon-face-smile","layui-icon-face-cry","layui-icon-cart-simple","layui-icon-cart","layui-icon-next","layui-icon-prev","layui-icon-upload-drag","layui-icon-upload","layui-icon-download-circle","layui-icon-component","layui-icon-file-b","layui-icon-user","layui-icon-find-fill","layui-icon-loading","layui-icon-loading-1","layui-icon-add-1","layui-icon-play","layui-icon-pause","layui-icon-headset","layui-icon-video","layui-icon-voice","layui-icon-speaker","layui-icon-fonts-del","layui-icon-fonts-code","layui-icon-fonts-html","layui-icon-fonts-strong","layui-icon-unlink","layui-icon-picture","layui-icon-link","layui-icon-face-smile-b","layui-icon-align-left","layui-icon-align-right","layui-icon-align-center","layui-icon-fonts-u","layui-icon-fonts-i","layui-icon-tabs","layui-icon-radio","layui-icon-circle","layui-icon-edit","layui-icon-share","layui-icon-delete","layui-icon-form","layui-icon-cellphone-fine","layui-icon-dialogue","layui-icon-fonts-clear","layui-icon-layer","layui-icon-date","layui-icon-water","layui-icon-code-circle","layui-icon-carousel","layui-icon-prev-circle","layui-icon-layouts","layui-icon-util","layui-icon-templeate-1","layui-icon-upload-circle","layui-icon-tree","layui-icon-table","layui-icon-chart","layui-icon-chart-screen","layui-icon-engine","layui-icon-triangle-d","layui-icon-triangle-r","layui-icon-file","layui-icon-set-sm","layui-icon-add-circle","layui-icon-404","layui-icon-about","layui-icon-up","layui-icon-down","layui-icon-left","layui-icon-right","layui-icon-circle-dot","layui-icon-search","layui-icon-set-fill","layui-icon-group","layui-icon-friends","layui-icon-reply-fill","layui-icon-menu-fill","layui-icon-log","layui-icon-picture-fine","layui-icon-face-smile-fine","layui-icon-list","layui-icon-release","layui-icon-ok","layui-icon-help","layui-icon-chat","layui-icon-top","layui-icon-star","layui-icon-star-fill","layui-icon-close-fill","layui-icon-close","layui-icon-ok-circle","layui-icon-add-circle-fine"];
+ return arr;
+ },
+ unicode: function () {
+ return ["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","ဇ","ဆ","စ",""];
+ }
+ }
+ };
+
+ a.init();
+ return new IconPicker();
+ };
+
+ /**
+ * 选中图标
+ * @param filter lay-filter
+ * @param iconName 图标名称,自动识别fontClass/unicode
+ */
+ IconPicker.prototype.checkIcon = function (filter, iconName){
+ var p = $('*[lay-filter='+ filter +']').next().find('.layui-iconpicker-item .layui-icon'),
+ c = iconName;
+
+ if (c.indexOf('#xe') > 0){
+ p.html(c);
+ } else {
+ p.html('').attr('class', 'layui-icon ' + c);
+ }
+ };
+
+ var iconPicker = new IconPicker();
+ exports(_MOD, iconPicker);
+});
\ No newline at end of file
diff --git a/admin-console/src/main/resources/static/js/admin/menu/index.js b/admin-console/src/main/resources/static/js/admin/menu/index.js
index dd5c0f3c2e0014e3e4047bcb595077663ce27cfd..f834a7f426305125b58e84280b54a84b108e4f3a 100644
--- a/admin-console/src/main/resources/static/js/admin/menu/index.js
+++ b/admin-console/src/main/resources/static/js/admin/menu/index.js
@@ -18,7 +18,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
initTable:function(){
menuTable = table.render({
elem : '#menuTable',
- height : 'full-280',
+ height : 'full-250',
method : 'post',
url : Common.ctxPath + '/admin/menu/list.json' //数据接口
,page : {"layout":['count','prev', 'page', 'next']} //开启分页
diff --git a/admin-console/src/main/resources/static/js/admin/user/changePassword.js b/admin-console/src/main/resources/static/js/admin/user/changePassword.js
index 55a799954a174a2afd0ced4a093ac072c5751736..5914879f4a8c886083d5999a8e1ad7a45259f7e2 100644
--- a/admin-console/src/main/resources/static/js/admin/user/changePassword.js
+++ b/admin-console/src/main/resources/static/js/admin/user/changePassword.js
@@ -9,6 +9,20 @@ layui.define([ 'form', 'table','userApi'], function(exports) {
},
initSubmit:function(){
$("#savePassword").click(function(){
+ var password = $("#password").val();
+ if(password==""){
+ Common.info("密码不能为空");
+ return false;
+ }
+ var password2 = $("#password2").val();
+ if(password2==""){
+ Common.info("确认密码不能为空");
+ return false;
+ }
+ if(password!=password2){
+ Common.info("密码和确认密码不一致");
+ return false;
+ }
userApi.changePassword($('#changePasswordForm'),function(){
Common.info("密码更改成功");
Lib.closeFrame();
diff --git a/admin-console/src/main/resources/static/js/admin/user/index.js b/admin-console/src/main/resources/static/js/admin/user/index.js
index d3e9769a8b85f9ef37724ee09d8fd9b7843b457b..f833b0937f14d44f5ee967bd863e8bbe15f6b339 100644
--- a/admin-console/src/main/resources/static/js/admin/user/index.js
+++ b/admin-console/src/main/resources/static/js/admin/user/index.js
@@ -61,12 +61,7 @@ layui.define([ 'form', 'laydate', 'table','userApi' ], function(exports) {
width : 120,
sort : true
},
- {
- field : 'jobType1Text',
- title : '职位明细',
- width : 80,
- sort : true
- },
+
{
field : 'createTime',
title : '创建时间',
diff --git a/admin-console/src/main/resources/static/js/quartz/timetask/add.js b/admin-console/src/main/resources/static/js/quartz/timetask/add.js
new file mode 100644
index 0000000000000000000000000000000000000000..f383e398dd738045715d9746e41c58dd62541f5e
--- /dev/null
+++ b/admin-console/src/main/resources/static/js/quartz/timetask/add.js
@@ -0,0 +1,28 @@
+layui.define([ 'form', 'laydate', 'table','timetaskApi'], function(exports) {
+ var form = layui.form;
+ var timetaskApi = layui.timetaskApi;
+ var index = layui.index;
+ var view = {
+ init:function(){
+ Lib.initGenrealForm($("#addForm"),form);
+ this.initSubmit();
+ },
+ initSubmit:function(){
+ $("#addButton").click(function(){
+ form.on('submit(form)', function(){
+ timetaskApi.addTimetask($('#addForm'),function(){
+ parent.window.dataReload();
+ Common.info("添加成功");
+ Lib.closeFrame();
+ });
+ });
+ });
+
+ $("#addButton-cancel").click(function(){
+ Lib.closeFrame();
+ });
+ }
+
+ }
+ exports('add',view);
+});
\ No newline at end of file
diff --git a/admin-console/src/main/resources/static/js/quartz/timetask/del.js b/admin-console/src/main/resources/static/js/quartz/timetask/del.js
new file mode 100644
index 0000000000000000000000000000000000000000..a6d44a7f635a614d35a48c57cfc9fb149439667d
--- /dev/null
+++ b/admin-console/src/main/resources/static/js/quartz/timetask/del.js
@@ -0,0 +1,23 @@
+layui.define(['table', 'timetaskApi'], function(exports) {
+ var timetaskApi = layui.timetaskApi;
+ var table=layui.table;
+ var view = {
+ init:function(){
+ },
+ delBatch:function(){
+ var data = Common.getMoreDataFromTable(table,"timetaskTable");
+ if(data==null){
+ return ;
+ }
+ Common.openConfirm("确认要删除这些Timetask?",function(){
+ var ids =Common.concatBatchId(data,"id");
+ timetaskApi.del(ids,function(){
+ Common.info("删除成功");
+ dataReload();
+ })
+ })
+ }
+ }
+ exports('del',view);
+
+});
\ No newline at end of file
diff --git a/admin-console/src/main/resources/static/js/quartz/timetask/edit.js b/admin-console/src/main/resources/static/js/quartz/timetask/edit.js
new file mode 100644
index 0000000000000000000000000000000000000000..35b7fad2dcb643bf99f50428354179cf73f62806
--- /dev/null
+++ b/admin-console/src/main/resources/static/js/quartz/timetask/edit.js
@@ -0,0 +1,28 @@
+layui.define([ 'form', 'laydate', 'table','timetaskApi'], function(exports) {
+ var form = layui.form;
+ var timetaskApi = layui.timetaskApi;
+ var index = layui.index;
+ var view = {
+ init:function(){
+ Lib.initGenrealForm($("#updateForm"),form);
+ this.initSubmit();
+ },
+ initSubmit:function(){
+ $("#updateButton").click(function(){
+ form.on('submit(form)', function(){
+ timetaskApi.updateTimetask($('#updateForm'),function(){
+ parent.window.dataReload();
+ Common.info("更新成功");
+ Lib.closeFrame();
+ });
+ });
+ });
+ $("#updateButton-cancel").click(function(){
+ Lib.closeFrame();
+ });
+ }
+
+ }
+ exports('edit',view);
+
+});
\ No newline at end of file
diff --git a/admin-console/src/main/resources/static/js/quartz/timetask/index.js b/admin-console/src/main/resources/static/js/quartz/timetask/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..fc3a2fd8cf9e906351c02fb16dfbaaa40157893c
--- /dev/null
+++ b/admin-console/src/main/resources/static/js/quartz/timetask/index.js
@@ -0,0 +1,146 @@
+layui.define([ 'form', 'laydate', 'table' ], function(exports) {
+ var form = layui.form;
+ var laydate = layui.laydate;
+ var table = layui.table;
+ var timetaskTable = null;
+ var view ={
+ init:function(){
+ this.initTable();
+ this.initSearchForm();
+ this.initToolBar();
+ window.dataReload = function(){
+ Lib.doSearchForm($("#searchForm"),timetaskTable)
+ }
+ },
+ initTable:function(){
+ timetaskTable = table.render({
+ elem : '#timetaskTable',
+ height : Lib.getTableHeight(1),
+ cellMinWidth: 100,
+ method : 'post',
+ url : Common.ctxPath + '/quartz/timetask/list.json' // 数据接口
+ ,page : Lib.tablePage // 开启分页
+ ,limit : 10,
+ cols : [ [ // 表头
+ {
+ type : 'checkbox',
+ fixed:'left',
+ },
+ {
+
+ field : 'taskId',
+ title : '任务ID',
+ width: 100,
+ },
+ {
+
+ field : 'className',
+ title : '任务类名',
+ },
+ {
+
+ field : 'cronExpression',
+ title : 'cron表达式',
+ },
+ {
+
+ field : 'taskDescribe',
+ title : '任务描述',
+ },
+
+ {
+ field : 'runServerIp',
+ title : '服务器',
+ width: 100,
+ },
+ {
+ field : 'runServer',
+ title : '远程主机',
+ width: 100,
+ },
+ {
+ field : 'isEffect',
+ title : '是否生效',
+ width: 100,
+ templet: '#isEffect',
+ },
+ {
+ field : 'isStart',
+ title : '运行状态',
+ width: 100,
+ templet: '#isStart',
+ },
+ {title : '操作',fixed: 'right', width: 165, align:'center', toolbar: '#barDemo'}
+
+ ] ]
+
+ });
+
+ table.on('checkbox(timetaskTable)', function(obj){
+ var timetask = obj.data;
+ if(obj.checked){
+ //按钮逻辑Lib.buttonEnable()
+ }else{
+
+ }
+ });
+
+ table.on('tool(timetaskTable)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
+ var data = obj.data //获得当前行数据
+ , layEvent = obj.event; //获得 lay-event 对应的值
+ if (layEvent === 'detail') {
+ layer.msg('查看操作');
+ } else if (layEvent === 'start') {
+ Common.openConfirm("确认要启动此任务?",function(){
+ Common.post("/quartz/timetask/start.json",{"id":data.id},function(){
+ Common.info("任务启动成功");
+ dataReload();
+ })
+
+ });
+ } else if (layEvent === 'stop') {
+ Common.openConfirm("确认要暂停此任务?",function(){
+ Common.post("/quartz/timetask/stop.json",{"id":data.id},function(){
+ Common.info("任务暂停成功");
+ dataReload();
+ })
+
+ })
+ }
+ });
+
+ },
+
+ initSearchForm:function(){
+ Lib.initSearchForm( $("#searchForm"),timetaskTable,form);
+ },
+ initToolBar:function(){
+ toolbar = {
+ add : function() { // 获取选中数据
+ var url = "/quartz/timetask/add.do";
+ Common.openMinDlg(url,"定时任务管理>新增");
+ },
+ edit : function() { // 获取选中数目
+ var data = Common.getOneFromTable(table,"timetaskTable");
+ if(data==null){
+ return ;
+ }
+ var url = "/quartz/timetask/edit.do?id="+data.id;
+ Common.openMinDlg(url,"定时任务管理>编辑");
+ },
+ del : function() {
+ layui.use(['del'], function(){
+ var delView = layui.del
+ delView.delBatch();
+ });
+ }
+ };
+ $('.ext-toolbar').on('click', function() {
+ var type = $(this).data('type');
+ toolbar[type] ? toolbar[type].call(this) : '';
+ });
+ }
+ }
+ exports('index',view);
+
+});
\ No newline at end of file
diff --git a/admin-console/src/main/resources/static/js/quartz/timetask/timetaskApi.js b/admin-console/src/main/resources/static/js/quartz/timetask/timetaskApi.js
new file mode 100644
index 0000000000000000000000000000000000000000..cee7733fb045e20a734fcd3e171b48212c36119e
--- /dev/null
+++ b/admin-console/src/main/resources/static/js/quartz/timetask/timetaskApi.js
@@ -0,0 +1,18 @@
+/*访问后台的代码*/
+layui.define([], function(exports) {
+ var api={
+ updateTimetask:function(form,callback){
+ Lib.submitForm("/quartz/timetask/update.json",form,{},callback)
+ },
+ addTimetask:function(form,callback){
+ Lib.submitForm("/quartz/timetask/add.json",form,{},callback)
+ },
+ del:function(ids,callback){
+ Common.post("/quartz/timetask/delete.json",{"ids":ids},function(){
+ callback();
+ })
+ }
+
+ };
+ exports('timetaskApi',api);
+});
\ No newline at end of file
diff --git a/admin-console/src/main/resources/templates/admin/menu/add.html b/admin-console/src/main/resources/templates/admin/menu/add.html
index 89ecb492ecbe684cc3d500bd805c47006a50f36e..106ce98040084c76e41f81c43253b7b41a8d4a04 100644
--- a/admin-console/src/main/resources/templates/admin/menu/add.html
+++ b/admin-console/src/main/resources/templates/admin/menu/add.html
@@ -5,8 +5,8 @@
+
-
-
-
-
+
+
+
+
-
-
diff --git a/admin-console/src/main/resources/templates/admin/user/changePassword.html b/admin-console/src/main/resources/templates/admin/user/changePassword.html
index 286b278bd5d960160acc9059d696976dabe7174e..329ab66f777e2efc3d513b572f798b0cdb3f6b27 100644
--- a/admin-console/src/main/resources/templates/admin/user/changePassword.html
+++ b/admin-console/src/main/resources/templates/admin/user/changePassword.html
@@ -23,14 +23,14 @@