添加日期范围支持重复添加多组日期范围

pull/99/head
RuoYi 3 years ago
parent 67df97d5a7
commit e87a818706

@ -55,16 +55,15 @@ export function resetForm(refName) {
// 添加日期范围 // 添加日期范围
export function addDateRange(params, dateRange, propName) { export function addDateRange(params, dateRange, propName) {
var search = params; let search = params;
search.params = {}; search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
if (null != dateRange && '' != dateRange) { dateRange = Array.isArray(dateRange) ? dateRange : [];
if (typeof (propName) === "undefined") { if (typeof (propName) === 'undefined') {
search.params["beginTime"] = dateRange[0]; search.params['beginTime'] = dateRange[0];
search.params["endTime"] = dateRange[1]; search.params['endTime'] = dateRange[1];
} else { } else {
search.params["begin" + propName] = dateRange[0]; search.params['begin' + propName] = dateRange[0];
search.params["end" + propName] = dateRange[1]; search.params['end' + propName] = dateRange[1];
}
} }
return search; return search;
} }

Loading…
Cancel
Save