diff --git a/src/views/deviceManage/syncRecord.vue b/src/views/deviceManage/syncRecord.vue index 82f0d0a..ba97c98 100644 --- a/src/views/deviceManage/syncRecord.vue +++ b/src/views/deviceManage/syncRecord.vue @@ -6,6 +6,7 @@ v-model="timeRange" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" + value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" size="small" class="my-datepick" @@ -79,6 +80,7 @@ }, watch: { timeRange(val) { + console.log('timeRange', val) if (val && val.length > 0) { if (typeof val[0] !== 'string') { val[0] = val[0].format('YYYY-MM-DD HH:mm:ss') @@ -104,12 +106,14 @@ if (end.valueOf() - s.valueOf() > (7 * 24 * 60 * 60 * 1000)) { this.$message.warning('日期范围不能大于7天') end = moment(s).add(7, 'days').format('YYYY-MM-DD 23:59:59') - s = s.format('yyyy-MM-DD 00:00:00') + s = s.format('YYYY-MM-DD 00:00:00') + console.log('end', end, 's', s) } if (s.valueOf() - end.valueOf() > (7 * 24 * 60 * 60 * 1000)) { this.$message.warning('日期范围不能大于7天') end = moment(s).subtract(7, 'days').format('YYYY-MM-DD 00:00:00') s = s.format('YYYY-MM-DD 23:59:59') + console.log('end', end, 's', s) } this.timeRange = [s, end] }