|
|
@@ -16,7 +16,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getPublishHistory } from '@/api/platform'
|
|
|
+import {
|
|
|
+ getPublishHistory,
|
|
|
+ cancelPublish
|
|
|
+} from '@/api/platform'
|
|
|
import {
|
|
|
State,
|
|
|
EventPriority,
|
|
|
@@ -30,7 +33,6 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
schema: {
|
|
|
- condition: { status: State.RESOLVED },
|
|
|
list: getPublishHistory,
|
|
|
transform: this.transform,
|
|
|
cols: [
|
|
|
@@ -44,9 +46,22 @@ export default {
|
|
|
} },
|
|
|
{ prop: 'type', label: '类型', width: 100 },
|
|
|
{ prop: 'name', label: '名称', 'min-width': 100 },
|
|
|
- { prop: 'createBy', label: '申请人' },
|
|
|
+ { prop: 'createBy', label: '发布人' },
|
|
|
{ prop: 'createTime', label: '发布时间' },
|
|
|
+ { label: '状态', type: 'tag', render ({ status }) {
|
|
|
+ if (status === State.CANCEL) {
|
|
|
+ return {
|
|
|
+ type: 'danger',
|
|
|
+ label: '已下架'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ type: 'success',
|
|
|
+ label: '正常'
|
|
|
+ }
|
|
|
+ } },
|
|
|
{ type: 'invoke', render: [
|
|
|
+ { label: '下架', render: ({ status }) => status === State.RESOLVED, on: this.onCancel },
|
|
|
{ label: '查看', on: this.onView }
|
|
|
] }
|
|
|
]
|
|
|
@@ -59,8 +74,10 @@ export default {
|
|
|
const diff = this.getDiff(item)
|
|
|
return { ...same, ...diff }
|
|
|
},
|
|
|
- getSame ({ programCalendarName, resolutionRatio, createBy, createByUsername, createTime, calendarReleaseDeviceList }) {
|
|
|
+ getSame ({ id, status, programCalendarName, resolutionRatio, createBy, createByUsername, createTime, calendarReleaseDeviceList }) {
|
|
|
return {
|
|
|
+ id,
|
|
|
+ status,
|
|
|
name: programCalendarName,
|
|
|
resolutionRatio,
|
|
|
createBy: createByUsername || createBy,
|
|
|
@@ -114,6 +131,11 @@ export default {
|
|
|
},
|
|
|
viewSchedule (id) {
|
|
|
this.$refs.scheduleDialog.show(id)
|
|
|
+ },
|
|
|
+ onCancel (publishItem) {
|
|
|
+ cancelPublish(publishItem.id, publishItem.name).then(() => {
|
|
|
+ publishItem.status = State.CANCEL
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|