Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/views/operate-log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function changeFilterHandle(val: string) {
function changeDayHandle(val: number | string) {
if (val !== 'other') {
daterange.value.start_time = beforeDay(val)
daterange.value.end_time = nowDate
daterange.value.end_time = ''
getList()
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks mostly correct but has a small issue. The nowDate variable is not defined in this snippet, so the line where it's assigned to daterange.value.end_time will result in an error.

To fix this:

  1. Define the nowDate Variable: Ensure that nowDate is properly initialized or imported before this code block executes, and contains a valid date value.
function nowDate() { return new Date(); }

Alternatively, ensure that there might be context around where nowDate is provided elsewhere in your application.

After making sure nowDate is correctly defined or accessible within your scope:

function changeFilterHandle(val: string) {
  // existing logic

}

function changeDayHandle(val: number | string) {
  if (val !== 'other') {
    daterange.value.start_time = beforeDay(val);
    daterange.value.end_time = ''; // Changed from nowDate to ''
    getList();
  }
}

If nowDate should actually represent new Date() at different times of execution, you may need additional logic to manage its state.

Expand Down