数据列表修改时间之后查询不改变

newCac1.0
fanluyan 5 months ago
parent b5d7610e9b
commit 15b52f9fed

@ -283,6 +283,10 @@ export default {
// //
chartDataArr: [], // chartDataArr: [], //
chartLoading: false, chartLoading: false,
//
allStartTime: "",
allEndTime: "",
}; };
}, },
@ -315,11 +319,15 @@ export default {
"starttime", "starttime",
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30)) new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
); );
this.allStartTime = new Date(
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30)
);
console.log(this.formdata.starttime); console.log(this.formdata.starttime);
const currentDate = new Date(); // const currentDate = new Date(); //
currentDate.setHours(23); // 23 currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59 currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59 currentDate.setSeconds(59); // 59
this.allEndTime = currentDate;
this.$set(this.formdata, "endtime", currentDate); this.$set(this.formdata, "endtime", currentDate);
console.log("我是开始时间", this.formdata.starttime); console.log("我是开始时间", this.formdata.starttime);
console.log("我是结束时间", currentDate); console.log("我是结束时间", currentDate);
@ -421,7 +429,8 @@ export default {
startDate.setSeconds(0); // 59 startDate.setSeconds(0); // 59
this.formdata.starttime = startDate; this.formdata.starttime = startDate;
} else { } else {
this.formdata.starttime = val; this.allStartTime = val;
this.formdata.starttime = this.allStartTime;
} }
}, },
// //
@ -438,7 +447,8 @@ export default {
val.setHours(23); // 23 val.setHours(23); // 23
val.setMinutes(59); // 59 val.setMinutes(59); // 59
val.setSeconds(59); // 59 val.setSeconds(59); // 59
this.formdata.endtime = val; this.allEndTime = val;
this.formdata.endtime = this.allEndTime;
console.log(val); console.log(val);
} }
}, },
@ -459,6 +469,12 @@ export default {
// "starttime", // "starttime",
// new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30)) // new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
// ); // );
console.log(
"全局开始时间和结束时间为0",
this.allStartTime,
this.allEndTime
);
if (this.allStartTime == "" && this.allEndTime == "") {
const thirtyDaysAgo = new Date(); const thirtyDaysAgo = new Date();
this.$set( this.$set(
this.formdata, this.formdata,
@ -475,6 +491,16 @@ export default {
console.log("我是开始时间", this.formdata.starttime); console.log("我是开始时间", this.formdata.starttime);
console.log("我是结束时间", currentDate); console.log("我是结束时间", currentDate);
} else { } else {
this.$set(this.formdata, "starttime", this.allStartTime);
this.$set(this.formdata, "endtime", this.allEndTime);
}
} else {
console.log(
"全局开始时间和结束时间不为0",
this.allStartTime,
this.allEndTime
);
if (this.allStartTime == "" && this.allEndTime == "") {
console.log(res.data.content[0].acquisitionTime); console.log(res.data.content[0].acquisitionTime);
this.formdata.endtime = res.data.content[0].acquisitionTime; this.formdata.endtime = res.data.content[0].acquisitionTime;
const qet = new Date(this.formdata.endtime); const qet = new Date(this.formdata.endtime);
@ -492,6 +518,10 @@ export default {
"starttime", "starttime",
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30)) new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
); );
} else {
this.$set(this.formdata, "starttime", this.allStartTime);
this.$set(this.formdata, "endtime", this.allEndTime);
}
} }
this.handleSearch(); this.handleSearch();

@ -128,7 +128,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="95" fixed="right"> <el-table-column label="操作" min-width="95">
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
v-if="scope.row.state == 1" v-if="scope.row.state == 1"

Loading…
Cancel
Save