|
|
@@ -2,14 +2,13 @@
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { getProgram } from '@/api/program'
|
|
|
import { Access } from '@/constant'
|
|
|
+import { removeRejectedAssets } from './core/utils'
|
|
|
import Designer from './Designer'
|
|
|
-import Viewer from './Viewer'
|
|
|
|
|
|
export default {
|
|
|
name: 'ProgramAst',
|
|
|
components: {
|
|
|
- Designer,
|
|
|
- Viewer
|
|
|
+ Designer
|
|
|
},
|
|
|
beforeRouteLeave (to, from, next) {
|
|
|
next(false)
|
|
|
@@ -17,15 +16,14 @@ export default {
|
|
|
props: {
|
|
|
id: {
|
|
|
type: String,
|
|
|
- default: null
|
|
|
+ required: true
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
loading: true,
|
|
|
error: null,
|
|
|
- program: null,
|
|
|
- activeComponent: null
|
|
|
+ program: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -46,16 +44,14 @@ export default {
|
|
|
getProgram(this.id, { custom: true }).then(
|
|
|
({ data }) => {
|
|
|
try {
|
|
|
- const { tenant, createBy, id, status, name, resolutionRatio, itemJsonStr } = data
|
|
|
+ const { tenant, createBy, id, status, name, resolutionRatio, itemJsonStr, rejectIds } = data
|
|
|
if (!this.isSuperAdmin && tenant !== this.tenant) {
|
|
|
this.showMessage('warning', '无权限')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.accessSet.has(Access.MANAGE_CALENDAR) && (this.isSuperAdmin || createBy === this.userId)) {
|
|
|
- this.activeComponent = 'Designer'
|
|
|
- } else {
|
|
|
- this.showMessage('warning', '暂无编辑权限,请联系管理员')
|
|
|
+ if (!(this.accessSet.has(Access.MANAGE_CALENDAR) && (this.isSuperAdmin || createBy === this.userId))) {
|
|
|
+ this.showMessage('warning', '无编辑权限,请联系管理员')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -65,12 +61,21 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ const widget = JSON.parse(itemJsonStr)
|
|
|
+ if (widget && rejectIds?.length) {
|
|
|
+ removeRejectedAssets(widget, rejectIds)
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '被驳回的媒资已移除'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
this.program = {
|
|
|
id, status, name, resolutionRatio,
|
|
|
detail: {
|
|
|
width: Number(width),
|
|
|
height: Number(height),
|
|
|
- ...JSON.parse(itemJsonStr)
|
|
|
+ ...widget
|
|
|
}
|
|
|
}
|
|
|
} catch (e) {
|
|
|
@@ -125,7 +130,7 @@ export default {
|
|
|
])
|
|
|
}
|
|
|
|
|
|
- return h(this.activeComponent, {
|
|
|
+ return h('Designer', {
|
|
|
props: {
|
|
|
program: this.program
|
|
|
}
|