|
@@ -128,7 +128,9 @@ import {
|
|
|
countByDay,
|
|
countByDay,
|
|
|
treeLocation,
|
|
treeLocation,
|
|
|
secondaryTransList,
|
|
secondaryTransList,
|
|
|
- mediaList
|
|
|
|
|
|
|
+ mediaList,
|
|
|
|
|
+ cancelProcess,
|
|
|
|
|
+ cancelAllProcess
|
|
|
} from '@/api/asset.js'
|
|
} from '@/api/asset.js'
|
|
|
import LineChart from './components/LineChart.vue'
|
|
import LineChart from './components/LineChart.vue'
|
|
|
|
|
|
|
@@ -246,8 +248,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
mediaSchema () {
|
|
mediaSchema () {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ buttons: [
|
|
|
|
|
+ { label: '取消全部转码任务', on: this.onCancelAllProcess }
|
|
|
|
|
+ ],
|
|
|
autoRefreshEachPage: true,
|
|
autoRefreshEachPage: true,
|
|
|
- refreshInterval: 30000,
|
|
|
|
|
|
|
+ refreshInterval: 5000, // 转码进度更新
|
|
|
list: mediaList,
|
|
list: mediaList,
|
|
|
filters: [
|
|
filters: [
|
|
|
{ key: 'originalName', type: 'search', placeholder: '资源名称' },
|
|
{ key: 'originalName', type: 'search', placeholder: '资源名称' },
|
|
@@ -257,6 +262,7 @@ export default {
|
|
|
{ type: 'refresh' },
|
|
{ type: 'refresh' },
|
|
|
{ prop: 'originalName', label: '素材名称', 'align': 'center' },
|
|
{ prop: 'originalName', label: '素材名称', 'align': 'center' },
|
|
|
{ label: '类型', 'align': 'center', render: ({ taskType }) => CourseTypeInfo[taskType] },
|
|
{ label: '类型', 'align': 'center', render: ({ taskType }) => CourseTypeInfo[taskType] },
|
|
|
|
|
+ { label: '转码进度', 'align': 'center', render: ({ percent }) => percent === null ? '-' : percent ? `${percent}%` : 0 },
|
|
|
{
|
|
{
|
|
|
label: '执行结果', type: 'tag', render: ({ taskStatus }) => {
|
|
label: '执行结果', type: 'tag', render: ({ taskStatus }) => {
|
|
|
return {
|
|
return {
|
|
@@ -267,7 +273,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
{ prop: 'departmentName', label: '部门名', 'align': 'center' },
|
|
{ prop: 'departmentName', label: '部门名', 'align': 'center' },
|
|
|
{ prop: 'username', label: '用户名', 'align': 'center' },
|
|
{ prop: 'username', label: '用户名', 'align': 'center' },
|
|
|
- { prop: 'createTime', label: '上传时间', 'align': 'center' }
|
|
|
|
|
|
|
+ { prop: 'createTime', label: '上传时间', 'align': 'center' },
|
|
|
|
|
+ { type: 'invoke', render: [{ allow: ({ taskStatus }) => [1, 2].includes(taskStatus), label: '取消转码', on: this.onCancelProcess }] }
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -510,6 +517,16 @@ export default {
|
|
|
},
|
|
},
|
|
|
onUpload () {
|
|
onUpload () {
|
|
|
EventBus.$emit('upload', this.$directoryOption)
|
|
EventBus.$emit('upload', this.$directoryOption)
|
|
|
|
|
+ },
|
|
|
|
|
+ onCancelProcess ({ id }) {
|
|
|
|
|
+ cancelProcess(id).then(() => {
|
|
|
|
|
+ this.$refs.mediaDialog?.getTable()?.refreshCurrentPageOnBackground()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onCancelAllProcess () {
|
|
|
|
|
+ cancelAllProcess().then(() => {
|
|
|
|
|
+ this.$refs.mediaDialog?.getTable()?.refreshCurrentPageOnBackground()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|