Commit 93f9dc32 by crushh

update: dist

parent 469becaa
......@@ -21,19 +21,19 @@ export default {
start = new Date(`${start.getFullYear()}-${start.getMonth() + 1}-${start.getDate()}`);
let start2 = new Date(pickerMinDate);
let end = new Date();
end = new Date(`${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate() + 1}`);
end = new Date(`${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate()} 23:59:59`);
let end2 = new Date(pickerMinDate);
if (pickerMinDate) {
start = start.setFullYear(start.getFullYear() - 2);
start2 = start2.setMonth(start2.getMonth() - 6);
start2 = start2.setDate(start2.getDate() - 60);
start = start > start2 ? start : start2;
end2 = end2.setMonth(end2.getMonth() + 6);
end2 = end2.setDate(end2.getDate() + 60);
end = end.getTime() > end2 ? end2 : end.getTime();
} else {
start = start.setFullYear(start.getFullYear() - 2);
end = end.getTime();
}
return time.getTime() <= start || time.getTime() >= end;
return time.getTime() < start || time.getTime() > end;
}
};
}
......@@ -60,9 +60,9 @@ export default {
return [getDate(start), getDate(end)];
},
btnChange(index) {
//把index值赋给active,点击改变样式
this.dateKey = index;
this.dateDefault = [];
let that = this;
that.dateKey = index;
that.dateDefault = [];
let setDate;
if (index == 0) {
// 近7天
......@@ -80,14 +80,15 @@ export default {
// 近三个月
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 3);
endDate.setDate(endDate.getDate() + 1);
endDate.setDate(1);
return new Date(endDate);
};
} else if (index == 3) {
// 近半年
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 6);
endDate.setDate(endDate.getDate() + 1);
endDate.setDate(1); // 以1号为开端
// endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
} else {
......@@ -99,10 +100,10 @@ export default {
return new Date(endDate);
};
}
const [start, end] = this.getDateRange(setDate);
this.dateDefault.push(end);
this.dateDefault.push(start);
this.getTableList();
const [start, end] = that.getDateRange(setDate);
that.dateDefault.push(end);
that.dateDefault.push(start);
that.getChartList();
}
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment