|
@@ -191,11 +191,7 @@ import {
|
|
|
getDevices,
|
|
getDevices,
|
|
|
getTimeline
|
|
getTimeline
|
|
|
} from '@/api/device'
|
|
} from '@/api/device'
|
|
|
-import {
|
|
|
|
|
- EventFreq,
|
|
|
|
|
- EventTarget
|
|
|
|
|
-} from '@/constant'
|
|
|
|
|
-import { createListOptions } from '@/utils'
|
|
|
|
|
|
|
+import { EventTarget } from '@/constant'
|
|
|
import {
|
|
import {
|
|
|
toDate,
|
|
toDate,
|
|
|
toDateStr,
|
|
toDateStr,
|
|
@@ -205,9 +201,11 @@ import {
|
|
|
getStartDate,
|
|
getStartDate,
|
|
|
getFinishDate,
|
|
getFinishDate,
|
|
|
pickMin,
|
|
pickMin,
|
|
|
- pickMax
|
|
|
|
|
|
|
+ pickMax,
|
|
|
|
|
+ getEventDescription
|
|
|
} from '@/utils/event'
|
|
} from '@/utils/event'
|
|
|
import { EventCache } from '@/utils/cache'
|
|
import { EventCache } from '@/utils/cache'
|
|
|
|
|
+import { createListOptions } from '@/utils'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'ScheduleTimeline',
|
|
name: 'ScheduleTimeline',
|
|
@@ -329,7 +327,7 @@ export default {
|
|
|
transformEvent (event) {
|
|
transformEvent (event) {
|
|
|
return {
|
|
return {
|
|
|
...event,
|
|
...event,
|
|
|
- time: this.getTime(event),
|
|
|
|
|
|
|
+ time: getEventDescription(event),
|
|
|
startDateTime: toDate(event.start),
|
|
startDateTime: toDate(event.start),
|
|
|
endDateTime: toDate(event.until),
|
|
endDateTime: toDate(event.until),
|
|
|
style: null,
|
|
style: null,
|
|
@@ -359,15 +357,6 @@ export default {
|
|
|
.sort((a, b) => a > b ? -1 : 1)
|
|
.sort((a, b) => a > b ? -1 : 1)
|
|
|
.map(key => map[key].sort((a, b) => toDate(a.start) - toDate(b.start)))
|
|
.map(key => map[key].sort((a, b) => toDate(a.start) - toDate(b.start)))
|
|
|
},
|
|
},
|
|
|
- getTime (event) {
|
|
|
|
|
- const { freq, start, until, byDay, startTime, endTime } = event
|
|
|
|
|
- switch (freq) {
|
|
|
|
|
- case EventFreq.WEEKLY:
|
|
|
|
|
- return `自${start.split(' ')[0]}开始${until ? `至${until.split(' ')[0]}前` : ''} 每周${byDay.split(',').map(val => ['日', '一', '二', '三', '四', '五', '六'][val]).join('、')} ${startTime} - ${endTime}`
|
|
|
|
|
- default:
|
|
|
|
|
- return until ? `${start} - ${until}` : `自${start}开始`
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
isDisableDate (date) {
|
|
isDisableDate (date) {
|
|
|
const now = new Date()
|
|
const now = new Date()
|
|
|
const min = new Date(now.getFullYear(), now.getMonth(), now.getDate())
|
|
const min = new Date(now.getFullYear(), now.getMonth(), now.getDate())
|