Skip to content

Commit

Permalink
VideoCover, Model table options
Browse files Browse the repository at this point in the history
  • Loading branch information
szuprefix committed Feb 29, 2020
1 parent ddf835a commit af3cef1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
25 changes: 25 additions & 0 deletions src/components/media/VideoCover.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<el-image v-bind="[$attrs,$props,field]" :src="url">
</el-image>
</template>
<script>
export default{
props: {
value: String,
field: Object
},
data () {
return {}
},
created () {
// console.log(this.value)
},
components: {},
methods: {},
computed: {
url () {
return this.value[this.field.name]
}
}
}
</script>
2 changes: 1 addition & 1 deletion src/components/model/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
},
getId(){
let id = this.value && this.value.id ||
this.$route.path.includes(this.model.getListUrl()) && this.$route.params.id
this.$route.path.startsWith(this.model.getListUrl()) && this.$route.params.id
|| undefined
return id === 'create' ? undefined : id
},
Expand Down
6 changes: 4 additions & 2 deletions src/components/model/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,18 @@
})
}
let avairableActions = {...this.avairableActions, ...bactions}
let topActions = ['refresh', 'create', ['download'].concat(Object.keys(bactions))]
return {
topActions: ['refresh', 'create', ['download'].concat(Object.keys(bactions))],
topActions,
rowActions: ['edit', [this.parentMultipleRelationField ? 'removeFromParent' : 'delete']],
excelFormat: this.excelFormat,
permissionFunction: this.checkPermission,
dblClickAction: 'edit',
title: this.model.config.verbose_name,
...this.$attrs,
baseQueries: this._baseQueries,
avairableActions
avairableActions,
...get(this.model, 'viewsConfig.list.options.remoteTable')
}
},
_baseQueries () {
Expand Down

0 comments on commit af3cef1

Please sign in to comment.