|
|
@@ -63,6 +63,7 @@
|
|
|
/>
|
|
|
</el-tabs>
|
|
|
<schema-table
|
|
|
+ v-if="type"
|
|
|
ref="table"
|
|
|
class="has-padding"
|
|
|
:schema="schema"
|
|
|
@@ -118,28 +119,30 @@ export default {
|
|
|
[State.SUBMITTED]: createListOptions({ type: AssetType.AUDIO, status: State.SUBMITTED }),
|
|
|
[State.REJECTED]: createListOptions({ type: AssetType.AUDIO, status: State.REJECTED })
|
|
|
},
|
|
|
- mediaAsset: null,
|
|
|
- schema: {
|
|
|
+ mediaAsset: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ schema () {
|
|
|
+ return {
|
|
|
list: getAssets,
|
|
|
transform: this.transform,
|
|
|
cols: [
|
|
|
- { prop: 'file', label: '缩略图', type: 'asset', on: this.onViewAsset },
|
|
|
+ this.isAudio ? null : { prop: 'file', label: '缩略图', type: 'asset', on: this.onViewAsset },
|
|
|
{ prop: 'name', label: '文件名' },
|
|
|
- { prop: 'duration', label: '时长' },
|
|
|
+ this.isImage ? null : { prop: 'duration', label: '时长' },
|
|
|
{ prop: 'size', label: '文件大小' },
|
|
|
{ prop: 'createTime', label: '上传时间' },
|
|
|
{
|
|
|
type: 'invoke', render: [
|
|
|
{ label: '查看', on: this.onView },
|
|
|
- { label: '提交', render: this.canSubmit, on: this.onSubmit },
|
|
|
+ { label: '提交', render ({ status }) { return status === State.READY }, on: this.onSubmit },
|
|
|
{ label: '删除', on: this.onDel }
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
+ },
|
|
|
currOptions: {
|
|
|
get () {
|
|
|
return this[this.type][this.active]
|
|
|
@@ -173,12 +176,12 @@ export default {
|
|
|
this.$refs.table.pageTo(1)
|
|
|
}
|
|
|
},
|
|
|
- canSubmit () {
|
|
|
- return this.status === State.READY
|
|
|
- },
|
|
|
to (type) {
|
|
|
if (this.type !== AssetType[type]) {
|
|
|
- this.type = AssetType[type]
|
|
|
+ this.type = null
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.type = AssetType[type]
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
transform (asset) {
|