|
|
@@ -10,8 +10,7 @@
|
|
|
:schema="schema"
|
|
|
@row-click="onToggle"
|
|
|
/>
|
|
|
- <program-dialog ref="programDialog" />
|
|
|
- <schedule-dialog ref="scheduleDialog" />
|
|
|
+ <materail-dialog ref="materailDialog" />
|
|
|
</wrapper>
|
|
|
</template>
|
|
|
|
|
|
@@ -20,14 +19,8 @@ import {
|
|
|
getPublishHistory,
|
|
|
cancelPublish
|
|
|
} from '@/api/platform'
|
|
|
-import {
|
|
|
- State,
|
|
|
- EventPriority,
|
|
|
- EventPriorityDescription,
|
|
|
- EventTarget,
|
|
|
- PublishType
|
|
|
-} from '@/constant'
|
|
|
-import { getEventDescription } from '@/utils/event'
|
|
|
+import { State } from '@/constant'
|
|
|
+import { transformCalendarRelease } from '@/views/screen/review/utils'
|
|
|
|
|
|
export default {
|
|
|
name: 'ScheduleDeployHistory',
|
|
|
@@ -42,7 +35,7 @@ export default {
|
|
|
staticClass: 'o-info'
|
|
|
}, [
|
|
|
h('div', null, `发布人:${data.createBy}`),
|
|
|
- h('div', null, `发布时间${data.createTime}`),
|
|
|
+ h('div', null, `发布时间:${data.createTime}`),
|
|
|
h('div', null, `设备:${data.device}`)
|
|
|
])
|
|
|
} },
|
|
|
@@ -71,67 +64,16 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
transform (item) {
|
|
|
- const same = this.getSame(item)
|
|
|
- const diff = this.getDiff(item)
|
|
|
- return { ...same, ...diff }
|
|
|
- },
|
|
|
- getSame ({ id, status, programCalendarName, resolutionRatio, createBy, createByUsername, createTime, calendarReleaseDeviceList }) {
|
|
|
- return {
|
|
|
- id,
|
|
|
- status,
|
|
|
- name: programCalendarName,
|
|
|
- resolutionRatio,
|
|
|
- createBy: createByUsername || createBy,
|
|
|
- createTime,
|
|
|
- device: calendarReleaseDeviceList?.map(item => item.deviceName).join(',')
|
|
|
- }
|
|
|
- },
|
|
|
- getDiff (item) {
|
|
|
- const target = JSON.parse(item.target)
|
|
|
- let type = ''
|
|
|
- switch (target.type) {
|
|
|
- case PublishType.CALENDAR:
|
|
|
- type = EventPriorityDescription[EventPriority.NORMAL]
|
|
|
- break
|
|
|
- case PublishType.EVENT:
|
|
|
- type = EventPriorityDescription[target.detail.priority]
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
return {
|
|
|
- type,
|
|
|
- target,
|
|
|
- desc: this.getDesc(target)
|
|
|
- }
|
|
|
- },
|
|
|
- getDesc (target) {
|
|
|
- if (target.type === PublishType.EVENT) {
|
|
|
- return getEventDescription(target.detail)
|
|
|
+ status: item.status,
|
|
|
+ ...transformCalendarRelease(item)
|
|
|
}
|
|
|
- return ''
|
|
|
},
|
|
|
onToggle (row) {
|
|
|
this.$refs.table.getInst().toggleRowExpansion(row)
|
|
|
},
|
|
|
- onView ({ target: { type, detail } }) {
|
|
|
- switch (type) {
|
|
|
- case PublishType.CALENDAR:
|
|
|
- this.viewSchedule(detail)
|
|
|
- break
|
|
|
- case PublishType.EVENT:
|
|
|
- if (detail.target.type === EventTarget.RECUR) {
|
|
|
- this.viewSchedule(detail.target.id)
|
|
|
- } else {
|
|
|
- this.$refs.programDialog.show(detail.target.id)
|
|
|
- }
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
- viewSchedule (id) {
|
|
|
- this.$refs.scheduleDialog.show(id)
|
|
|
+ onView ({ target }) {
|
|
|
+ this.$refs.materailDialog.showPublishTarget(target)
|
|
|
},
|
|
|
onCancel (publishItem) {
|
|
|
cancelPublish(publishItem.id, publishItem.name).then(() => {
|