增加默认查询时间

This commit is contained in:
bb_pan 2025-07-17 19:30:57 +08:00
parent 66ab284e13
commit 8c7b7199ac
6 changed files with 89 additions and 11 deletions

View File

@ -159,9 +159,19 @@
};
},
created() {
this.getList();
this.getList();
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
// rowIndex= columnIndex=
// table +
// 0
@ -214,7 +224,10 @@
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();
},

View File

@ -372,9 +372,19 @@
};
},
created() {
this.getList();
this.getList();
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
// rowIndex= columnIndex=
// table +
// 0
@ -432,7 +442,10 @@
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();
},

View File

@ -163,9 +163,19 @@
};
},
created() {
this.getList();
this.getList();
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
// rowIndex= columnIndex=
// table +
// 0
@ -220,7 +230,10 @@
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();
},

View File

@ -163,9 +163,19 @@
};
},
created() {
this.getList();
this.getList();
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
// rowIndex= columnIndex=
// table +
// 0
@ -221,7 +231,10 @@
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();
},

View File

@ -181,8 +181,18 @@ export default {
},
created() {
this.getList()
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
// rowIndex= columnIndex=
// table +
// 0
@ -234,7 +244,10 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.dateRange = []
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord = null
this.handleQuery()
},

View File

@ -159,9 +159,19 @@
};
},
created() {
this.getList();
this.getList()
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
// rowIndex= columnIndex=
// table +
// 0
@ -216,7 +226,10 @@
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.dateRange=[]
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 2)
this.dateRange = [this.format(start), this.format(end)]
this.queryParams.keyWord=null;
this.handleQuery();
},