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

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,39 +469,59 @@ export default {
// "starttime", // "starttime",
// new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30)) // new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
// ); // );
const thirtyDaysAgo = new Date(); console.log(
this.$set( "全局开始时间和结束时间为0",
this.formdata, this.allStartTime,
"starttime", this.allEndTime
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
); );
console.log(this.formdata.starttime); if (this.allStartTime == "" && this.allEndTime == "") {
const currentDate = new Date(); // const thirtyDaysAgo = new Date();
console.log("asddddadadadadadasd", currentDate); this.$set(
currentDate.setHours(23); // 23 this.formdata,
currentDate.setMinutes(59); // 59 "starttime",
currentDate.setSeconds(59); // 59 new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
this.$set(this.formdata, "endtime", currentDate); );
console.log("我是开始时间", this.formdata.starttime); console.log(this.formdata.starttime);
console.log("我是结束时间", currentDate); const currentDate = new Date(); //
console.log("asddddadadadadadasd", currentDate);
currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.$set(this.formdata, "endtime", currentDate);
console.log("我是开始时间", this.formdata.starttime);
console.log("我是结束时间", currentDate);
} else {
this.$set(this.formdata, "starttime", this.allStartTime);
this.$set(this.formdata, "endtime", this.allEndTime);
}
} else { } else {
console.log(res.data.content[0].acquisitionTime); console.log(
this.formdata.endtime = res.data.content[0].acquisitionTime; "全局开始时间和结束时间不为0",
const qet = new Date(this.formdata.endtime); this.allStartTime,
qet.setHours(23); // 23 this.allEndTime
qet.setMinutes(59); // 59
qet.setSeconds(59); // 59
this.$set(this.formdata, "endtime", qet);
const thirtyDaysAgo = new Date(this.formdata.endtime);
thirtyDaysAgo.setHours(0); // 23
thirtyDaysAgo.setMinutes(0); // 59
thirtyDaysAgo.setSeconds(0); // 59
this.$set(
this.formdata,
"starttime",
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
); );
if (this.allStartTime == "" && this.allEndTime == "") {
console.log(res.data.content[0].acquisitionTime);
this.formdata.endtime = res.data.content[0].acquisitionTime;
const qet = new Date(this.formdata.endtime);
qet.setHours(23); // 23
qet.setMinutes(59); // 59
qet.setSeconds(59); // 59
this.$set(this.formdata, "endtime", qet);
const thirtyDaysAgo = new Date(this.formdata.endtime);
thirtyDaysAgo.setHours(0); // 23
thirtyDaysAgo.setMinutes(0); // 59
thirtyDaysAgo.setSeconds(0); // 59
this.$set(
this.formdata,
"starttime",
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