mirror of https://github.com/layui/layui
laydate quickConfirm改成更容易理解的autoConfirm,table新增cols初始化避免render的时候没有cols参数导致代码执行报错问题
parent
6977b6573b
commit
32961e116f
|
@ -162,7 +162,7 @@
|
||||||
,zIndex: null //控件层叠顺序
|
,zIndex: null //控件层叠顺序
|
||||||
,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发
|
,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发
|
||||||
,change: null //日期时间改变后的回调
|
,change: null //日期时间改变后的回调
|
||||||
,quickConfirm: true //快速确认
|
,autoConfirm: true //是否自动确认(日期|年份|月份选择器非range下是否自动确认)
|
||||||
};
|
};
|
||||||
|
|
||||||
//多语言
|
//多语言
|
||||||
|
@ -580,7 +580,7 @@
|
||||||
|
|
||||||
lay(this).addClass(THIS);
|
lay(this).addClass(THIS);
|
||||||
|
|
||||||
if (options.position !== 'static' && !options.range && options.quickConfirm) {
|
if (options.position !== 'static' && !options.range && options.autoConfirm) {
|
||||||
if (type === 'date') {
|
if (type === 'date') {
|
||||||
that.choose(lay(elem).find('td.layui-this'))
|
that.choose(lay(elem).find('td.layui-this'))
|
||||||
} else if (type === 'year' || type === 'month') {
|
} else if (type === 'year' || type === 'month') {
|
||||||
|
@ -1353,7 +1353,7 @@
|
||||||
//若为月选择器,只有当选择月份时才自动关闭;
|
//若为月选择器,只有当选择月份时才自动关闭;
|
||||||
//若为年选择器,选择年份即自动关闭
|
//若为年选择器,选择年份即自动关闭
|
||||||
//且在范围未开启时
|
//且在范围未开启时
|
||||||
if(!options.range && options.quickConfirm){
|
if(!options.range && options.autoConfirm){
|
||||||
if((options.type === 'month' && type === 'month') || (options.type === 'year' && type === 'year')){
|
if((options.type === 'month' && type === 'month') || (options.type === 'year' && type === 'year')){
|
||||||
that.setValue(that.parse()).remove().done();
|
that.setValue(that.parse()).remove().done();
|
||||||
}
|
}
|
||||||
|
@ -1641,7 +1641,7 @@
|
||||||
} else if(options.position === 'static'){ //直接嵌套的选中
|
} else if(options.position === 'static'){ //直接嵌套的选中
|
||||||
that.calendar().done().done(null, 'change'); //同时执行 done 和 change 回调
|
that.calendar().done().done(null, 'change'); //同时执行 done 和 change 回调
|
||||||
} else if(options.type === 'date'){
|
} else if(options.type === 'date'){
|
||||||
options.quickConfirm ? that.setValue(that.parse()).remove().done() : that.calendar().done(null, 'change');
|
options.autoConfirm ? that.setValue(that.parse()).remove().done() : that.calendar().done(null, 'change');
|
||||||
} else if(options.type === 'datetime'){
|
} else if(options.type === 'datetime'){
|
||||||
that.calendar().done(null, 'change');
|
that.calendar().done(null, 'change');
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,6 +309,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
,text: {
|
,text: {
|
||||||
none: '无数据'
|
none: '无数据'
|
||||||
}
|
}
|
||||||
|
,cols: []
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格渲染
|
// 表格渲染
|
||||||
|
|
Loading…
Reference in New Issue