This commit is contained in:
‘937886381’
2024-06-19 16:25:50 +08:00
parent 41d554f897
commit c8bc54e04b
7 changed files with 812 additions and 400 deletions

View File

@@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-18 13:41:03
* @LastEditTime: 2024-06-19 09:35:25
* @LastEditors: zhp
* @Description:
-->
@@ -21,7 +21,7 @@
</el-form-item>
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="至"
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
start-placeholder="开始日期" value-format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
@@ -34,9 +34,8 @@
</el-date-picker>
</el-form-item>
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime">
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
value-format="yyyy-MM-DD HH:mm:ss" range-separator="" start-placeholder="开始月份" end-placeholder="结束月份"
@change="changeTime">
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
range-separator="" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
</el-date-picker>
</el-form-item>
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime">
@@ -100,9 +99,11 @@ export default {
start: undefined,
end: undefined,
listQuery: {
pageNo: 1,
pageSize: 999,
// size: 10,
// current: 1,
factory: null,
factory: undefined,
// total: 0,
type: 2,
startDate: undefined,
@@ -236,7 +237,7 @@ export default {
mounted() {
// this.getOverView()
const currentMonth = new Date()
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
this.changeTime()
this.getDataList()
},
@@ -294,8 +295,8 @@ export default {
},
onValueChange(picker, k) { // 选中近k周后触发的操作
if (this.start && this.end) {
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
if (numDays > 168) {
console.log(numDays)