mirror of https://gitee.com/y_project/RuoYi.git
表单重置开始/结束时间控件
parent
1bbf7b8a03
commit
08fc4740d5
|
@ -2,6 +2,9 @@
|
|||
* 通用方法封装处理
|
||||
* Copyright (c) 2019 ruoyi
|
||||
*/
|
||||
|
||||
var startLayDate;
|
||||
var endLayDate;
|
||||
$(function() {
|
||||
|
||||
// layer扩展皮肤
|
||||
|
@ -48,7 +51,7 @@ $(function() {
|
|||
if ($(".select-time").length > 0) {
|
||||
layui.use('laydate', function() {
|
||||
var laydate = layui.laydate;
|
||||
var startDate = laydate.render({
|
||||
startLayDate = laydate.render({
|
||||
elem: '#startTime',
|
||||
max: $('#endTime').val(),
|
||||
theme: 'molv',
|
||||
|
@ -57,17 +60,17 @@ $(function() {
|
|||
done: function(value, date) {
|
||||
// 结束时间大于开始时间
|
||||
if (value !== '') {
|
||||
endDate.config.min.year = date.year;
|
||||
endDate.config.min.month = date.month - 1;
|
||||
endDate.config.min.date = date.date;
|
||||
endLayDate.config.min.year = date.year;
|
||||
endLayDate.config.min.month = date.month - 1;
|
||||
endLayDate.config.min.date = date.date;
|
||||
} else {
|
||||
endDate.config.min.year = '';
|
||||
endDate.config.min.month = '';
|
||||
endDate.config.min.date = '';
|
||||
endLayDate.config.min.year = '';
|
||||
endLayDate.config.min.month = '';
|
||||
endLayDate.config.min.date = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
var endDate = laydate.render({
|
||||
endLayDate = laydate.render({
|
||||
elem: '#endTime',
|
||||
min: $('#startTime').val(),
|
||||
theme: 'molv',
|
||||
|
@ -76,13 +79,13 @@ $(function() {
|
|||
done: function(value, date) {
|
||||
// 开始时间小于结束时间
|
||||
if (value !== '') {
|
||||
startDate.config.max.year = date.year;
|
||||
startDate.config.max.month = date.month - 1;
|
||||
startDate.config.max.date = date.date;
|
||||
startLayDate.config.max.year = date.year;
|
||||
startLayDate.config.max.month = date.month - 1;
|
||||
startLayDate.config.max.date = date.date;
|
||||
} else {
|
||||
startDate.config.max.year = '2099';
|
||||
startDate.config.max.month = '12';
|
||||
startDate.config.max.date = '31';
|
||||
startLayDate.config.max.year = '2099';
|
||||
startLayDate.config.max.month = '12';
|
||||
startLayDate.config.max.date = '31';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -680,6 +680,14 @@ var table = {
|
|||
} else if (table.options.type == table_type.bootstrapTreeTable) {
|
||||
$("#" + tableId).bootstrapTreeTable('refresh', []);
|
||||
}
|
||||
if ($.common.isNotEmpty(startLayDate) && $.common.isNotEmpty(endLayDate)) {
|
||||
endLayDate.config.min.year = '';
|
||||
endLayDate.config.min.month = '';
|
||||
endLayDate.config.min.date = '';
|
||||
startLayDate.config.max.year = '2099';
|
||||
startLayDate.config.max.month = '12';
|
||||
startLayDate.config.max.date = '31';
|
||||
}
|
||||
},
|
||||
// 获取选中复选框项
|
||||
selectCheckeds: function(name) {
|
||||
|
@ -877,6 +885,7 @@ var table = {
|
|||
content: _url,
|
||||
shadeClose: $.common.isEmpty(options.shadeClose) ? true : options.shadeClose,
|
||||
skin: options.skin,
|
||||
// options.btn设置为0表示不显示按钮
|
||||
btn: $.common.isEmpty(options.btn) ? _btn : options.btn,
|
||||
yes: options.yes,
|
||||
cancel: function () {
|
||||
|
|
Loading…
Reference in New Issue