功能优化
This commit is contained in:
parent
2588ce49ca
commit
b7a30186bf
|
|
@ -668,10 +668,23 @@ export default {
|
|||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams.userName=undefined;
|
||||
this.queryParams.leaveTypes=undefined;
|
||||
const now = new Date();
|
||||
const yesterday = new Date(now);
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
const formattedDate = yesterday.toISOString().split('T')[0];
|
||||
|
||||
// 确保dateRange是响应式的,这里直接赋值应该可以
|
||||
this.$set(this, 'dateRange', [formattedDate, formattedDate]);
|
||||
|
||||
// 重置其他查询参数
|
||||
this.queryParams.userName = undefined;
|
||||
this.queryParams.leaveTypes = undefined;
|
||||
|
||||
// 调用重置表单的方法,确保它不会影响dateRange
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
|
||||
// 使用$nextTick确保所有DOM更新完成后再执行查询
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue