Compare commits

..

No commits in common. "e802674196d5c19b92d7f36c1b40e6b29fbb7fc0" and "ec5e47a4160db7b7868ef5d4b3b06c1747380864" have entirely different histories.

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-07-24 14:48:25 * @LastEditTime: 2024-07-23 18:00:55
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -39,7 +39,7 @@
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year" <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year"
placeholder="开始时间" @change="getYear"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
~ ~
<el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" placeholder="结束时间" <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" placeholder="结束时间"
@ -265,8 +265,6 @@ export default {
this.listQuery.endDate = null this.listQuery.endDate = null
this.listQuery.startDate = null this.listQuery.startDate = null
this.listQuery.reportTime = null this.listQuery.reportTime = null
this.listQuery.start = null
this.listQuery.end = null
}, },
otherMethods(val) { otherMethods(val) {
this.detailOrUpdateVisible = true; this.detailOrUpdateVisible = true;
@ -284,14 +282,20 @@ export default {
this.listQuery.reportTime = [] this.listQuery.reportTime = []
this.listQuery.start = undefined this.listQuery.start = undefined
this.listQuery.end = undefined this.listQuery.end = undefined
// console.log();
} else { } else {
this.listQuery.startDate = this.listQuery.start this.listQuery.startDate = this.listQuery.start
this.listQuery.endDate = this.listQuery.end this.listQuery.endDate = this.listQuery.end
} }
if (!this.listQuery.start && !this.listQuery.end) {
this.listQuery.startDate = undefined
this.listQuery.endDate = undefined
}
// console.log(e);
}, },
onValueChange(picker, k) { // k onValueChange(picker, k) { // k
if (this.listQuery.start && this.listQuery.end) { if (this.listQuery.start && this.listQuery.end) {
// console.log(this.listQuery.start, this.listQuery.end - this.listQuery.start) console.log(this.listQuery.reportTime)
this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000); const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
@ -305,15 +309,11 @@ export default {
this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
} }
console.log(this.listQuery.startDate, this.listQuery.endDate) }
} else { if (!this.listQuery.start && !this.listQuery.end) {
this.listQuery.startDate = undefined this.listQuery.startDate = undefined
this.listQuery.endDate = undefined this.listQuery.endDate = undefined
} }
// if (!this.listQuery.start && !this.listQuery.end) {
// this.listQuery.startDate = undefined
// this.listQuery.endDate = undefined
// }
}, },
changeDayTime() { changeDayTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
@ -359,7 +359,7 @@ export default {
this.$message.warning('请选择时间维度!') this.$message.warning('请选择时间维度!')
return return
} }
if (!this.listQuery.startDate || !this.listQuery.endDate) { if (!this.listQuery.startDate) {
this.$message.warning('请选择时间范围!') this.$message.warning('请选择时间范围!')
} else { } else {
await getProduceDataPage(this.listQuery).then(res => { await getProduceDataPage(this.listQuery).then(res => {