Browse Source

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

tags/v3.2.0
RuoYi 3 years ago
parent
commit
e87a818706
  1. 19
      ruoyi-ui/src/utils/ruoyi.js

19
ruoyi-ui/src/utils/ruoyi.js

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

Loading…
Cancel
Save