修改问题
This commit is contained in:
@@ -27,7 +27,7 @@ export default (options = {}) => {
|
||||
}
|
||||
uni.request({
|
||||
url,
|
||||
timeout: 1000 *10,
|
||||
timeout: 1000 *30,
|
||||
data: {
|
||||
...options.data,
|
||||
},
|
||||
|
||||
@@ -113,6 +113,21 @@ function getToday() {
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
// 获取当天日期 往前推30天
|
||||
function getBeforeDays(days = 30) {
|
||||
const today = new Date();
|
||||
// 计算往前推N天的时间戳(1天=86400000毫秒)
|
||||
const beforeDate = new Date(today.getTime() - days * 24 * 60 * 60 * 1000);
|
||||
return formatDate(beforeDate);
|
||||
}
|
||||
function formatDate(date) {
|
||||
const year = date.getFullYear();
|
||||
// 月份从0开始,补零到2位
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
// 日期补零到2位
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
// 获取3个月前的日期
|
||||
function getThreeMonthsAgo() {
|
||||
@@ -317,5 +332,6 @@ export default {
|
||||
refreshPrePage,
|
||||
getDictData,
|
||||
getToday,
|
||||
getBeforeDays,
|
||||
getThreeMonthsAgo
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
"target" : "https://pqmcn.com:8092/api",
|
||||
// "target" : "http://192.168.1.62:10215",
|
||||
// "target" : "http://192.168.1.103:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
@@ -112,7 +112,7 @@ export default {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = this.type
|
||||
this.store.params.deviceId = this.deviceId
|
||||
this.store.params.startTime = this.$util.getThreeMonthsAgo()
|
||||
this.store.params.startTime = this.$util.getBeforeDays()
|
||||
this.store.params.endTime = this.$util.getToday()
|
||||
this.store.loadedCallback = () => {
|
||||
this.store.data.forEach((item) => {
|
||||
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
console.log(dictData)
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = this.type
|
||||
this.store.params.startTime = this.$util.getThreeMonthsAgo()
|
||||
this.store.params.startTime = this.$util.getBeforeDays()
|
||||
this.store.params.endTime = this.$util.getToday()
|
||||
this.store.loadedCallback = () => {
|
||||
console.log(111, this.store.data)
|
||||
|
||||
Reference in New Issue
Block a user