This commit is contained in:
sentsin
2017-08-22 10:56:53 +08:00
parent 44724f0760
commit 3dc39c1cfb
32 changed files with 94 additions and 66 deletions

View File

@@ -8,6 +8,9 @@
html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
/* 初始化 */
.layui-laydate *{margin: 0; padding: 0;}
/* 主体结构 */
.layui-laydate, .layui-laydate *{box-sizing: border-box;}
.layui-laydate{position: absolute; z-index: 66666666; margin: 5px 0; border-radius: 2px; font-size: 14px; -webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
@@ -105,7 +108,7 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
.laydate-selected:hover{background-color: #00F7DE !important;}
.layui-laydate-content td:hover,
.layui-laydate-list li:hover{background-color: #eaeaea; color: #333;}
.laydate-time-list li ol{border: 1px solid #e2e2e2; border-left-width: 0;}
.laydate-time-list li ol{margin: 0; padding: 0; border: 1px solid #e2e2e2; border-left-width: 0;}
.laydate-time-list li:first-child ol{border-left-width: 1px;}
.laydate-time-list>li:hover{background: none;}
.layui-laydate-content .laydate-day-prev,

View File

@@ -1,6 +1,6 @@
/**
@Name : layDate 5.0 日期时间控件
@Name : layDate 5.0.1 日期时间控件
@Author: 贤心
@Sitehttp://www.layui.com/laydate/
@LicenseMIT
@@ -55,7 +55,7 @@
}
,laydate = {
v: '5.0'
v: '5.0.1'
,config: {} //全局配置项
,index: (window.laydate && window.laydate.v) ? 100000 : 0
,path: ready.getPath
@@ -705,7 +705,9 @@
Class.thisElem = that.elemID;
typeof options.ready === 'function' && options.ready(options.dateTime);
typeof options.ready === 'function' && options.ready(lay.extend({}, options.dateTime, {
month: options.dateTime.month + 1
}));
};
//控件移除
@@ -866,6 +868,8 @@
checkValid(dateTime)
};
if(fn === 'limit') return checkValid(dateTime), that;
value = value || options.value;
if(typeof value === 'string'){
value = value.replace(/\s+/g, ' ').replace(/^\s|\s$/g, '');
@@ -1212,7 +1216,7 @@
that.list('month', index);
}
} else {
that.calendar();
that.checkDate('limit').calendar();
that.closeList();
}
@@ -1516,12 +1520,15 @@
that.startState = true;
}
lay(that.footer).find(ELEM_CONFIRM)[that.endDate ? 'removeClass' : 'addClass'](DISABLED);
} else if(!(options.type === 'datatime' || options.position === 'static')){
setDateTime(true);
that.setValue(that.parse()).remove().done();
} else {
} else if(options.position === 'static'){ //直接嵌套的选中
setDateTime(true);
that.calendar().done().done(null, 'change');
} else if(options.type === 'date'){
setDateTime(true);
that.setValue(that.parse()).remove().done();
} else if(options.type === 'datetime'){
setDateTime(true);
that.calendar().done(null, 'change');
}
};
@@ -1634,7 +1641,7 @@
prevYear: function(){
if(addSubYeay('sub')) return;
dateTime.year--;
that.calendar();
that.checkDate('limit').calendar();
options.range || that.done(null, 'change');
}
,prevMonth: function(){
@@ -1643,7 +1650,7 @@
year: YM[0]
,month: YM[1]
});
that.calendar();
that.checkDate('limit').calendar();
options.range || that.done(null, 'change');
}
,nextMonth: function(){
@@ -1652,13 +1659,13 @@
year: YM[0]
,month: YM[1]
});
that.calendar();
that.checkDate('limit').calendar();
options.range || that.done(null, 'change');
}
,nextYear: function(){
if(addSubYeay()) return;
dateTime.year++
that.calendar();
that.checkDate('limit').calendar();
options.range || that.done(null, 'change');
}
};

View File

@@ -229,6 +229,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
page: curr
,limit: options.limit
}, options.where)
,dataType: 'json'
,success: function(res){
if(res.code != 0){
return layer.msg(res.msg);
@@ -283,7 +284,10 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
layui.each(data, function(i1, item1){
var tds = [], tds_fixed = [], tds_fixed_r = [];
that.eachCols(function(i3, item3){
var content = item1[item3.field||i3] || (i3 === 0 ? i1+1 : '');
var content = item1[item3.field||i3];
if(content === undefined && content === null){
content = (i3 === 0 ? i1+1 : '');
}
if(item3.colspan > 1) return;
@@ -757,6 +761,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
,event: othis.attr('lay-event')
,tr: tr
,del: function(){
var data = this.data;
delete data[table.config.checkName];
tr.remove();
that.scrollPatch();
}

View File

@@ -193,6 +193,7 @@ layui.define('layer' , function(exports){
,data: formData
,contentType: false
,processData: false
,dataType: 'json'
,success: function(res){
done(index, res);
}
@@ -233,11 +234,13 @@ layui.define('layer' , function(exports){
,done = function(index, res){
that.elemFile.next('.'+ ELEM_CHOOSE).remove();
elemFile.value = '';
try {
res = JSON.parse(res);
} catch(e){
res = {};
return that.msg('请对上传接口返回有效JSON');
if(typeof res !== 'object'){
try {
res = JSON.parse(res);
} catch(e){
res = {};
return that.msg('请对上传接口返回有效JSON');
}
}
typeof options.done === 'function' && options.done(res, index || 0, function(files){
that.upload(files);

View File

@@ -19,7 +19,7 @@
}
,Layui = function(){
this.v = '2.0.0'; //版本号
this.v = '2.0.1'; //版本号
}
//获取layui所在目录
@@ -415,7 +415,7 @@
//如果是数字,按大小排序,如果是非数字,按字典序排序
clone.sort(function(o1, o2){
var isNum = /^\d+\d+\d$/
var isNum = /^\d+$/
,v1 = o1[key]
,v2 = o2[key];