|
|
@@ -156,12 +156,30 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ // 初始化为当天日期
|
|
|
+ this.initTodayDate();
|
|
|
+
|
|
|
courseList().then(res => this.courseLists = res.list);
|
|
|
this.getDicts("sys_course_project").then(res => this.projectOptions = res.data);
|
|
|
this.getAllCompany();
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 初始化为前一天(昨天)日期
|
|
|
+ initTodayDate() {
|
|
|
+ const yesterday = new Date();
|
|
|
+ yesterday.setDate(yesterday.getDate() - 1); // 减去1天,得到昨天
|
|
|
+
|
|
|
+ const year = yesterday.getFullYear();
|
|
|
+ const month = String(yesterday.getMonth() + 1).padStart(2, '0');
|
|
|
+ const day = String(yesterday.getDate()).padStart(2, '0');
|
|
|
+ const yesterdayStr = `${year}-${month}-${day}`;
|
|
|
+
|
|
|
+ this.timeRange = [yesterdayStr, yesterdayStr];
|
|
|
+ this.queryParams.startDate = yesterdayStr;
|
|
|
+ this.queryParams.endDate = yesterdayStr;
|
|
|
+ },
|
|
|
+
|
|
|
handleTabClick(tab) {
|
|
|
this.queryParams.tabType = tab.name;
|
|
|
this.queryParams.pageNum = 1;
|