|
|
@@ -7,12 +7,14 @@
|
|
|
background
|
|
|
>
|
|
|
<device-tree-single
|
|
|
+ class="c-sibling-item"
|
|
|
size="mini"
|
|
|
@change="onChange"
|
|
|
/>
|
|
|
<schema-table
|
|
|
v-if="device"
|
|
|
ref="table"
|
|
|
+ class="c-sibling-item far"
|
|
|
row-key="id"
|
|
|
:schema="schema"
|
|
|
/>
|
|
|
@@ -137,6 +139,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
+ Access,
|
|
|
TimeType,
|
|
|
SCREEN_TIME_KEY,
|
|
|
TaskFromType,
|
|
|
@@ -173,20 +176,14 @@ export default {
|
|
|
list: this.getContentAssets,
|
|
|
cols: [
|
|
|
{ prop: 'tagType', label: '文件', width: 100, align: 'center' },
|
|
|
- { prop: 'fileType', label: '', width: 60 },
|
|
|
+ { prop: 'fileType', label: '', width: 80 },
|
|
|
{ prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
|
|
|
{ prop: 'adDuration', label: '上播时长', align: 'center' },
|
|
|
{ type: 'invoke', render: [
|
|
|
- { label: '查看', allow: ({ file }) => !!file, on: this.onViewAssetItem }
|
|
|
+ { label: '查看', allow: ({ file }) => !!file, on: this.onViewAsset }
|
|
|
] }
|
|
|
]
|
|
|
},
|
|
|
- taskDataSelectOptions: {
|
|
|
- options: [
|
|
|
- { value: TaskFromType.ASSET, label: TaskFromTypeInfo[TaskFromType.ASSET] },
|
|
|
- { value: TaskFromType.CONTRACT, label: TaskFromTypeInfo[TaskFromType.CONTRACT] }
|
|
|
- ]
|
|
|
- },
|
|
|
taskTimeTypeSelectSchema: {
|
|
|
options: [
|
|
|
{ value: TimeType.SCREEN, label: '开机期间' },
|
|
|
@@ -205,18 +202,23 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
schema () {
|
|
|
+ const canEditt = this.accessSet.has(Access.MANAGE_CALENDAR)
|
|
|
+ const canAudit = this.accessSet.has(Access.MANAGE_GROUP)
|
|
|
+
|
|
|
return {
|
|
|
- buttons: [
|
|
|
- { type: 'add', label: '素材任务', on: this.onAddAssetTask },
|
|
|
- { type: 'add', label: '合同任务', on: this.onAddContractTask }
|
|
|
- ],
|
|
|
+ buttons: canEditt
|
|
|
+ ? [
|
|
|
+ { type: 'add', label: '素材任务', on: this.onAddAssetTask },
|
|
|
+ { type: 'add', label: '合同任务', on: this.onAddContractTask }
|
|
|
+ ]
|
|
|
+ : null,
|
|
|
condition: { deviceId: this.device.id },
|
|
|
list: getTasks,
|
|
|
transform: this.transform,
|
|
|
cols: [
|
|
|
{ prop: 'type', type: 'refresh', width: 80 },
|
|
|
{ prop: 'name' },
|
|
|
- { label: '上刊日期', 'min-width': 220, render: (data, h) => data.allowed && data.from === TaskFromType.ASSET
|
|
|
+ { label: '上刊日期', 'min-width': 220, render: (data, h) => canEditt && data.allowed && data.from === TaskFromType.ASSET
|
|
|
? h('el-date-picker', {
|
|
|
staticClass: 'o-date-picker',
|
|
|
props: {
|
|
|
@@ -232,7 +234,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
: `${data.startDate} 至 ${data.endDate}`, align: 'center' },
|
|
|
- { label: '上播时间', render: (data, h) => data.allowed && data.from === TaskFromType.ASSET
|
|
|
+ { label: '上播时间', render: (data, h) => canEditt && data.allowed && data.from === TaskFromType.ASSET
|
|
|
? h('div', {
|
|
|
staticClass: 'o-date-picker jc',
|
|
|
on: {
|
|
|
@@ -240,7 +242,7 @@ export default {
|
|
|
}
|
|
|
}, data.range)
|
|
|
: data.range, 'min-width': 120, align: 'center' },
|
|
|
- { label: '上播时长(s)', render: (data, h) => this.canEditDuration(data)
|
|
|
+ { label: '上播时长(s)', render: (data, h) => canEditt && this.canEditDuration(data)
|
|
|
? h('edit-input', {
|
|
|
staticClass: 'border',
|
|
|
props: {
|
|
|
@@ -252,7 +254,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
: data.duration, 'min-width': 100, align: 'center' },
|
|
|
- { label: '上播次数', render: (data, h) => data.allowed && data.from === TaskFromType.ASSET
|
|
|
+ { label: '上播次数', render: (data, h) => canEditt && data.allowed && data.from === TaskFromType.ASSET
|
|
|
? h('edit-input', {
|
|
|
staticClass: 'border',
|
|
|
props: {
|
|
|
@@ -264,7 +266,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
: data.count, align: 'center' },
|
|
|
- { label: '审核次数', render: (data, h) => data.allowed
|
|
|
+ { label: '审核次数', render: (data, h) => canAudit && data.allowed
|
|
|
? h('edit-input', {
|
|
|
staticClass: 'border',
|
|
|
props: {
|
|
|
@@ -276,7 +278,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
: '-', align: 'center' },
|
|
|
- { prop: 'tag', type: 'tag', on: this.onAudit },
|
|
|
+ { prop: 'tag', type: 'tag', on: canAudit && this.onAudit },
|
|
|
{ type: 'invoke', render: [
|
|
|
{ label: '查看', allow: ({ allowed }) => allowed, on: this.onViewTask },
|
|
|
{ label: '删除', allow: ({ from }) => from !== TaskFromType.ORDER, on: this.onDel }
|
|
|
@@ -288,7 +290,7 @@ export default {
|
|
|
if (this.taskData) {
|
|
|
switch (this.taskData.from) {
|
|
|
case TaskFromType.ASSET:
|
|
|
- return AssetTypeInfo[this.taskData.type]
|
|
|
+ return AssetTypeInfo[this.taskData.info.type]
|
|
|
default:
|
|
|
return TaskFromTypeInfo[this.taskData.from]
|
|
|
}
|
|
|
@@ -302,7 +304,7 @@ export default {
|
|
|
return this.taskDataFrom === TaskFromType.CONTRACT
|
|
|
},
|
|
|
disableTaskDuration () {
|
|
|
- return !this.disableTask && this.taskData ? this.taskData.type === AssetType.VIDEO : this.disableTask
|
|
|
+ return !this.disableTask && this.taskData ? this.taskData.info.type === AssetType.VIDEO : this.disableTask
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -378,8 +380,10 @@ export default {
|
|
|
break
|
|
|
case TaskFromType.ASSET:
|
|
|
this.onViewAsset({
|
|
|
- type: task.fromInfo.type,
|
|
|
- url: task.fromId
|
|
|
+ file: {
|
|
|
+ type: task.fromInfo.type,
|
|
|
+ url: task.fromId
|
|
|
+ }
|
|
|
})
|
|
|
break
|
|
|
case TaskFromType.CONTRACT:
|
|
|
@@ -443,11 +447,8 @@ export default {
|
|
|
adDuration: parseDuration(duration)
|
|
|
}
|
|
|
},
|
|
|
- onViewAssetItem ({ file }) {
|
|
|
- this.onViewAsset(file)
|
|
|
- },
|
|
|
- onViewAsset (asset) {
|
|
|
- this.$refs.previewDialog.show(asset)
|
|
|
+ onViewAsset ({ file }) {
|
|
|
+ this.$refs.previewDialog.show(file)
|
|
|
},
|
|
|
onDel ({ id, type, name }) {
|
|
|
deleteTask(id, `${type} ${name}`).then(() => {
|
|
|
@@ -492,22 +493,18 @@ export default {
|
|
|
onChooseTaskTarget () {
|
|
|
this.$refs.taskTargetDialog.show(this.taskDataFrom)
|
|
|
},
|
|
|
- onChoosenTaskTarget ({ value: { info, ...taskTarget }, done }) {
|
|
|
- switch (taskTarget.from) {
|
|
|
+ onChoosenTaskTarget ({ value, done }) {
|
|
|
+ switch (value.from) {
|
|
|
case TaskFromType.ASSET:
|
|
|
- if (info?.duration) {
|
|
|
- this.taskDuration = info.duration
|
|
|
- } else if (this.taskData && this.taskData.type !== taskTarget.type) {
|
|
|
- this.taskDuration = 5
|
|
|
- }
|
|
|
- this.taskData = taskTarget
|
|
|
+ this.taskDuration = value.info.duration
|
|
|
+ this.taskData = value
|
|
|
done()
|
|
|
break
|
|
|
case TaskFromType.CONTRACT:
|
|
|
this.addTask({
|
|
|
- from: taskTarget.from,
|
|
|
- fromId: taskTarget.fromId,
|
|
|
- ...info
|
|
|
+ from: value.from,
|
|
|
+ fromId: value.fromId,
|
|
|
+ ...value.info
|
|
|
}).then(done)
|
|
|
break
|
|
|
default:
|