This commit is contained in:
2026-05-22 14:26:11 +08:00
8 changed files with 332 additions and 266 deletions

View File

@@ -69,7 +69,6 @@ export default {
created() {
const end = new Date();
const start = new Date();
start.setDate(start.getDate() - 7);
this.dateRange = [start, end];
this.handleQuery();
},
@@ -80,6 +79,10 @@ export default {
if (this.dateRange && this.dateRange.length === 2) {
params.startTime = this.dateRange[0];
params.endTime = this.dateRange[1];
} else {
const today = new Date();
params.startTime = this.formatDateTime(today, '00:00:00');
params.endTime = this.formatDateTime(today, '23:59:59');
}
params.lineType = this.activeLine;
getExcoilStatus(params).then(res => {
@@ -89,6 +92,12 @@ export default {
this.loading = false;
});
},
formatDateTime(date, time) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day} ${time}`;
},
},
};
</script>