增加默认查询时间

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

@ -160,8 +160,18 @@
}, },
created() { 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: { 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= // rowIndex= columnIndex=
// table + // table +
// 0 // 0
@ -214,7 +224,10 @@
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); 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.queryParams.keyWord=null;
this.handleQuery(); this.handleQuery();
}, },

View File

@ -373,8 +373,18 @@
}, },
created() { 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: { 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= // rowIndex= columnIndex=
// table + // table +
// 0 // 0
@ -432,7 +442,10 @@
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); 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.queryParams.keyWord=null;
this.handleQuery(); this.handleQuery();
}, },

View File

@ -164,8 +164,18 @@
}, },
created() { 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: { 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= // rowIndex= columnIndex=
// table + // table +
// 0 // 0
@ -220,7 +230,10 @@
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); 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.queryParams.keyWord=null;
this.handleQuery(); this.handleQuery();
}, },

View File

@ -164,8 +164,18 @@
}, },
created() { 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: { 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= // rowIndex= columnIndex=
// table + // table +
// 0 // 0
@ -221,7 +231,10 @@
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); 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.queryParams.keyWord=null;
this.handleQuery(); this.handleQuery();
}, },

View File

@ -181,8 +181,18 @@ export default {
}, },
created() { 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: { 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= // rowIndex= columnIndex=
// table + // table +
// 0 // 0
@ -234,7 +244,10 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm') 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.queryParams.keyWord = null
this.handleQuery() this.handleQuery()
}, },

View File

@ -159,9 +159,19 @@
}; };
}, },
created() { 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: { 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= // rowIndex= columnIndex=
// table + // table +
// 0 // 0
@ -216,7 +226,10 @@
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); 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.queryParams.keyWord=null;
this.handleQuery(); this.handleQuery();
}, },