|
|
@ -49,7 +49,7 @@ |
|
|
|
|
|
|
|
<div class="times"> |
|
|
|
<div class="time-item" v-for="(time, index) in times" :key="index" |
|
|
|
:class="{'active': currentTime === time.hour, 'first-hour': time.hour === '00'}"> |
|
|
|
:class="{'active': currentTime === time.date, 'first-hour': time.hour === '00'}"> |
|
|
|
<span class="hour">{{ time.day }}</span> |
|
|
|
<span class="time" @click="onTimeClick(time, index)">{{ time.hour }}</span> |
|
|
|
</div> |
|
|
@ -994,18 +994,12 @@ export default { |
|
|
|
//初始化时间轴 |
|
|
|
const initTimeLine = () => { |
|
|
|
options.times = []; |
|
|
|
options.currentTime = moment(options.date).format('HH'); |
|
|
|
let now = moment(options.date) |
|
|
|
let hour = now.hour(); |
|
|
|
const remainder = hour % 12; |
|
|
|
if (remainder > 0) { |
|
|
|
now.hour(hour + (12 - remainder)); |
|
|
|
} |
|
|
|
now.hour(now.hour() + 12); |
|
|
|
options.currentTime = moment(options.date).add(-1, 'hour').format('YYYY-MM-DD HH'); |
|
|
|
let now = moment(options.date); |
|
|
|
for (let i = 0; i < 24; i++) { |
|
|
|
options.times.push({ |
|
|
|
hour: now.add(-1, 'hour').format('HH'), |
|
|
|
day: now.format('MM/DD'), |
|
|
|
hour: now.add(-1, 'hour').format('HH'), |
|
|
|
date: now.format('YYYY-MM-DD HH'), |
|
|
|
}) |
|
|
|
} |
|
|
@ -1015,7 +1009,7 @@ export default { |
|
|
|
|
|
|
|
//时间选择 |
|
|
|
const onTimeClick = (time, index) => { |
|
|
|
options.currentTime = time.hour; |
|
|
|
options.currentTime = time.date; |
|
|
|
options.date = moment(time.date).format('YYYY-MM-DD HH'); |
|
|
|
reloadChangeData() |
|
|
|
options.index = index; |
|
|
|