Commit 59e6416d authored by 李家智's avatar 李家智
Browse files

toobar button enable

parent 163be433
package com.ibeetl.admin.core.util; package com.ibeetl.admin.core.util;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
public class DateUtil { public class DateUtil {
public static Date MAX_DATE = maxDate();
public static String now() { public static String now() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(new Date()); return sdf.format(new Date());
...@@ -13,4 +19,13 @@ public class DateUtil { ...@@ -13,4 +19,13 @@ public class DateUtil {
SimpleDateFormat sdf = new SimpleDateFormat(format); SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(new Date()); return sdf.format(new Date());
} }
private static Date maxDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
return sdf.parse("9999-12-31 23:59:59");
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
} }
...@@ -44,6 +44,15 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { ...@@ -44,6 +44,15 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
] ] ] ]
}); });
table.on('checkbox(${entity.code}Table)', function(obj){
var ${entity.code} = obj.data;
if(obj.checked){
//按钮逻辑Lib.buttonEnable()
}else{
}
})
}, },
initSearchForm:function(){ initSearchForm:function(){
......
...@@ -265,6 +265,18 @@ var Lib = { ...@@ -265,6 +265,18 @@ var Lib = {
} }
Common.post(url, formPara, callBack); Common.post(url, formPara, callBack);
}, },
buttonEnable:function(buttonCode,enable){
var btn = $("#table-button-"+buttonCode);
debugger;
if(enable){
btn.attr('disabled',"false");
btn.removeClass("button-disabled")
}else{
btn.attr('disabled',"true");
btn.addClass('button-disabled');
}
},
getTableHeight : function(queryLine) { getTableHeight : function(queryLine) {
// 表格相对高度 // 表格相对高度
if (queryLine == 1) { if (queryLine == 1) {
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
.input-readonly{ .input-readonly{
background-color: #efefef;
cursor:not-allowed;
}
.button-disabled{
background-color: #efefef; background-color: #efefef;
cursor:not-allowed; cursor:not-allowed;
} }
......
<!--#if(canAccess(function)){ /*功能*/ --> <!--#if(canAccess(function)){ /*功能*/ -->
<button class="layui-btn layui-btn-primary ext-toolbar" data-type="${action}">${tagBody}</button> <button id="table-button-${action}" class="layui-btn layui-btn-primary ext-toolbar " data-type="${action}">${tagBody}</button>
<!--#} --> <!--#} -->
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment