|
@@ -135,6 +135,7 @@ import {
|
|
|
parseTime,
|
|
parseTime,
|
|
|
getAssetDuration
|
|
getAssetDuration
|
|
|
} from '@/utils'
|
|
} from '@/utils'
|
|
|
|
|
+import { toDate } from '@/utils/event'
|
|
|
import { publish } from '@/api/platform'
|
|
import { publish } from '@/api/platform'
|
|
|
import { assetTableMixin } from '@/mixins/asset-table'
|
|
import { assetTableMixin } from '@/mixins/asset-table'
|
|
|
import Draggable from 'vuedraggable'
|
|
import Draggable from 'vuedraggable'
|
|
@@ -250,6 +251,12 @@ export default {
|
|
|
if (this.startDate === this.endDate) {
|
|
if (this.startDate === this.endDate) {
|
|
|
return this.onError('开始时间与结束时间不能一样')
|
|
return this.onError('开始时间与结束时间不能一样')
|
|
|
}
|
|
}
|
|
|
|
|
+ const sources = this.assets.map(({ tag, type, keyName, duration, size, md5 }) => {
|
|
|
|
|
+ return { tag, type, keyName, duration, size, md5 }
|
|
|
|
|
+ })
|
|
|
|
|
+ if (sources.length === 1) {
|
|
|
|
|
+ sources.duration = Math.floor((toDate(this.endDate) - toDate(this.startDate)) / 1000)
|
|
|
|
|
+ }
|
|
|
return Promise.resolve({
|
|
return Promise.resolve({
|
|
|
type: PublishTargetType.EVENT,
|
|
type: PublishTargetType.EVENT,
|
|
|
detail: {
|
|
detail: {
|
|
@@ -259,9 +266,7 @@ export default {
|
|
|
priority: this.priority,
|
|
priority: this.priority,
|
|
|
target: {
|
|
target: {
|
|
|
type: EventTarget.ASSETS,
|
|
type: EventTarget.ASSETS,
|
|
|
- sources: this.assets.map(({ tag, type, keyName, duration, size, md5 }) => {
|
|
|
|
|
- return { tag, type, keyName, duration, size, md5 }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ sources
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|