Merge branch 'main' into 2.x

pull/1523/head
贤心 2023-12-31 23:42:20 +08:00
commit 4294b53eb1
2 changed files with 17 additions and 11 deletions

View File

@ -1802,7 +1802,6 @@
// 重新选择或者第一次选择
index = 0;
that.endState = false;
that.endDate = {};
} else {
index = 1;
that.endState = true;
@ -1860,18 +1859,22 @@
if (that.endState && that.autoCalendarModel.auto) {
isChange = that.autoCalendarModel();
}
if ((isChange || that.rangeLinked && that.endState) && that.newDate(that.startDate) > that.newDate(that.endDate)) {
// 判断是否反选
var needSwapDate = (isChange || that.rangeLinked && that.endState) && that.newDate(that.startDate) > that.newDate(that.endDate);
if (needSwapDate){
var isSameDate = that.startDate.year === that.endDate.year && that.startDate.month === that.endDate.month && that.startDate.date === that.endDate.date;
// 判断是否反选
var startDate = that.startDate;
that.startDate = lay.extend({}, that.endDate, isSameDate ? {} : that.startTime);
var startDate;
// 如果是同一天并且出现了反选证明是时分秒出现开始时间大于结束时间的现象
if(isSameDate){
startDate = that.startTime;
that.startTime = that.endTime;
that.endTime = startDate;
}
// 当出现反向选择时(即“后点击”的日期比“先点击”的日期小),重新提取区间
startDate = that.startDate;
that.startDate = lay.extend({}, that.endDate, that.startTime);
options.dateTime = lay.extend({}, that.startDate);
that.endDate = lay.extend({}, startDate, isSameDate ? {} : that.endTime);
isSameDate && ( // 如果是同一天并且出现了反选证明是时分秒出现开始时间大于结束时间的现象
startDate = that.startTime,
that.startTime = that.endTime,
that.endTime = startDate
)
that.endDate = lay.extend({}, startDate, that.endTime);
}
isChange && (options.dateTime = lay.extend({}, that.startDate));
}

View File

@ -2967,6 +2967,9 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
// 插入内容
vals.push(content);
}else if(item3.field && item3.type !== 'normal'){
// https://gitee.com/layui/layui/issues/I8PHCR
if(i1 == 0) fieldsIsHide[item3.field] = true;
}
});
}