|
|
@@ -13,6 +13,14 @@ import {
|
|
|
parseDuration
|
|
|
} from '@/utils'
|
|
|
|
|
|
+function createMap (type) {
|
|
|
+ return {
|
|
|
+ [State.AVAILABLE_ASSET]: createListOptions({ type, status: State.AVAILABLE_ASSET }),
|
|
|
+ [State.RESOLVED]: createListOptions({ type, status: State.RESOLVED, originalName: '' }),
|
|
|
+ [State.REJECTED]: createListOptions({ type, status: State.REJECTED })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
export default {
|
|
|
props: {
|
|
|
type: {
|
|
|
@@ -22,31 +30,12 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- [AssetType.IMAGE]: {
|
|
|
- [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.IMAGE, status: State.AVAILABLE_ASSET }),
|
|
|
- [State.RESOLVED]: createListOptions({ type: AssetType.IMAGE, status: State.RESOLVED, originalName: '' }),
|
|
|
- [State.REJECTED]: createListOptions({ type: AssetType.IMAGE, status: State.REJECTED })
|
|
|
- },
|
|
|
- [AssetType.VIDEO]: {
|
|
|
- [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.VIDEO, status: State.AVAILABLE_ASSET }),
|
|
|
- [State.RESOLVED]: createListOptions({ type: AssetType.VIDEO, status: State.RESOLVED, originalName: '' }),
|
|
|
- [State.REJECTED]: createListOptions({ type: AssetType.VIDEO, status: State.REJECTED })
|
|
|
- },
|
|
|
- [AssetType.AUDIO]: {
|
|
|
- [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.AUDIO, status: State.AVAILABLE_ASSET }),
|
|
|
- [State.RESOLVED]: createListOptions({ type: AssetType.AUDIO, status: State.RESOLVED, originalName: '' }),
|
|
|
- [State.REJECTED]: createListOptions({ type: AssetType.AUDIO, status: State.REJECTED })
|
|
|
- },
|
|
|
- [AssetType.PPT]: {
|
|
|
- [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.PPT, status: State.AVAILABLE_ASSET }),
|
|
|
- [State.RESOLVED]: createListOptions({ type: AssetType.PPT, status: State.RESOLVED, originalName: '' }),
|
|
|
- [State.REJECTED]: createListOptions({ type: AssetType.PPT, status: State.REJECTED })
|
|
|
- },
|
|
|
- [AssetType.PDF]: {
|
|
|
- [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.PDF, status: State.AVAILABLE_ASSET }),
|
|
|
- [State.RESOLVED]: createListOptions({ type: AssetType.PDF, status: State.RESOLVED, originalName: '' }),
|
|
|
- [State.REJECTED]: createListOptions({ type: AssetType.PDF, status: State.REJECTED })
|
|
|
- }
|
|
|
+ [AssetType.IMAGE]: createMap(AssetType.IMAGE),
|
|
|
+ [AssetType.VIDEO]: createMap(AssetType.VIDEO),
|
|
|
+ [AssetType.AUDIO]: createMap(AssetType.AUDIO),
|
|
|
+ [AssetType.PPT]: createMap(AssetType.PPT),
|
|
|
+ [AssetType.PDF]: createMap(AssetType.PDF),
|
|
|
+ [AssetType.DOC]: createMap(AssetType.DOC)
|
|
|
}
|
|
|
},
|
|
|
computed: {
|