|
|
@@ -33,7 +33,9 @@
|
|
|
@change="onChange"
|
|
|
/>
|
|
|
<div class="l-flex__none l-flex--col c-step__column u-width--lg">
|
|
|
- <div class="c-sibling-item--v near u-font-size--sm u-bold">上播类型</div>
|
|
|
+ <div class="c-sibling-item--v near u-font-size--sm u-bold">
|
|
|
+ 上播类型
|
|
|
+ </div>
|
|
|
<el-select
|
|
|
v-model="eventOptions.type"
|
|
|
class="c-sibling-item--v nearer u-width--sm"
|
|
|
@@ -47,7 +49,9 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
<template v-if="!isDefaultPlayback">
|
|
|
- <div class="c-sibling-item--v near u-font-size--sm">优先级</div>
|
|
|
+ <div class="c-sibling-item--v near u-font-size--sm">
|
|
|
+ 优先级
|
|
|
+ </div>
|
|
|
<el-select
|
|
|
v-model="priority"
|
|
|
class="c-sibling-item--v nearer u-width--sm"
|
|
|
@@ -65,7 +69,9 @@
|
|
|
class="l-flex--row inline u-font-size--sm has-active"
|
|
|
@click="onAddEvent"
|
|
|
>
|
|
|
- <span class="c-sibling-item">播放时段</span>
|
|
|
+ <span class="c-sibling-item">
|
|
|
+ 播放时段
|
|
|
+ </span>
|
|
|
<i class="c-sibling-item near el-icon-circle-plus-outline" />
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -130,6 +136,7 @@ import {
|
|
|
import { publish } from '@/api/platform'
|
|
|
import {
|
|
|
getWorkflowsByUser,
|
|
|
+ getWorkflowsBySuperAdmin,
|
|
|
getWorkflowDetail
|
|
|
} from '@/api/workflow'
|
|
|
import WorkflowDialog from '../workflow/components/WorkflowDialog.vue'
|
|
|
@@ -161,7 +168,11 @@ export default {
|
|
|
timeSchema: {
|
|
|
nonPagination: true,
|
|
|
props: {
|
|
|
- size: 'small'
|
|
|
+ size: 'small',
|
|
|
+ 'row-class-name': 'u-pointer'
|
|
|
+ },
|
|
|
+ listeners: {
|
|
|
+ 'row-click': this.onEditEvent
|
|
|
},
|
|
|
list: this.getEvents,
|
|
|
cols: [
|
|
|
@@ -175,13 +186,15 @@ export default {
|
|
|
eventTarget: this.createEventTarget(),
|
|
|
conflicts: [],
|
|
|
workflowSchema: {
|
|
|
- list: getWorkflowsByUser,
|
|
|
+ list: this.$store.getters.isSuperAdmin ? getWorkflowsBySuperAdmin : getWorkflowsByUser,
|
|
|
filters: [
|
|
|
{ key: 'status', type: 'select', placeholder: '流程状态', options: [
|
|
|
{ value: State.SUBMITTED, label: '待审核' },
|
|
|
{ value: State.RESOLVED, label: '通过' },
|
|
|
{ value: State.REJECTED, label: '驳回' }
|
|
|
- ] }
|
|
|
+ ] },
|
|
|
+ { key: 'flowName', type: 'search', placeholder: '上播内容' },
|
|
|
+ { type: 'refresh' }
|
|
|
],
|
|
|
cols: [
|
|
|
{ prop: 'flowDesc', label: '优先级', width: 100, align: 'center' },
|
|
|
@@ -192,6 +205,7 @@ export default {
|
|
|
label: ['', '待审核', '通过', '驳回'][status]
|
|
|
}
|
|
|
} },
|
|
|
+ this.$store.getters.isSuperAdmin && { prop: 'createUser', label: '提交人', width: 100, align: 'center' },
|
|
|
{ prop: 'createTime', label: '提交时间', width: 160, align: 'center' },
|
|
|
{ type: 'invoke', render: [
|
|
|
{ label: '详情', on: this.onViewWorkflow }
|
|
|
@@ -237,21 +251,29 @@ export default {
|
|
|
return Promise.resolve(({ data: this.events }))
|
|
|
},
|
|
|
onAddEvent () {
|
|
|
+ this.$eventProxy = null
|
|
|
this.$refs.eventFrequencyConfigDialog.show()
|
|
|
},
|
|
|
+ onEditEvent (eventProxy) {
|
|
|
+ const { origin } = eventProxy
|
|
|
+ this.$eventProxy = eventProxy
|
|
|
+ this.$refs.eventFrequencyConfigDialog.show(origin)
|
|
|
+ },
|
|
|
onConfirmEventFrequency ({ value, done }) {
|
|
|
const conflicts = new Map()
|
|
|
if (this.events.length) {
|
|
|
this.events.forEach(eventProxy => {
|
|
|
- value.forEach(event => {
|
|
|
- const date = getConflict(event, eventProxy.origin)
|
|
|
- if (date) {
|
|
|
- conflicts.set(eventProxy.key, {
|
|
|
- key: eventProxy.key,
|
|
|
- info: `与 ${eventProxy.time} 有冲突`
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if (!this.$eventProxy || this.$eventProxy.key !== eventProxy.key) {
|
|
|
+ value.forEach(event => {
|
|
|
+ const date = getConflict(event, eventProxy.origin)
|
|
|
+ if (date) {
|
|
|
+ conflicts.set(eventProxy.key, {
|
|
|
+ key: eventProxy.key,
|
|
|
+ info: `与 ${eventProxy.time} 有冲突`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
if (conflicts.size) {
|
|
|
@@ -270,16 +292,21 @@ export default {
|
|
|
this.onAdded(value, done)
|
|
|
},
|
|
|
onAdded (value, done) {
|
|
|
- this.events = [
|
|
|
- ...value.map(event => {
|
|
|
- return {
|
|
|
- key: `${Date.now()}_${Math.random().toString(16).slice(2)}`,
|
|
|
- origin: event,
|
|
|
- time: getEventDescription(event)
|
|
|
- }
|
|
|
- }),
|
|
|
- ...this.events
|
|
|
- ]
|
|
|
+ if (this.$eventProxy) {
|
|
|
+ this.$eventProxy.origin = value[0]
|
|
|
+ this.$eventProxy.time = getEventDescription(value[0])
|
|
|
+ } else {
|
|
|
+ this.events = [
|
|
|
+ ...value.map(event => {
|
|
|
+ return {
|
|
|
+ key: `${Date.now()}_${Math.random().toString(16).slice(2)}`,
|
|
|
+ origin: event,
|
|
|
+ time: getEventDescription(event)
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ ...this.events
|
|
|
+ ]
|
|
|
+ }
|
|
|
this.$refs.timeTable?.pageTo(1)
|
|
|
done()
|
|
|
},
|