feat: 修改资产授权里的action树

This commit is contained in:
ibuler
2020-06-15 18:32:01 +08:00
parent 1ad59070f2
commit 894bdb708e
2 changed files with 69 additions and 8 deletions

View File

@@ -4,6 +4,7 @@
<script>
import { GenericCreateUpdatePage } from '@/layout/components'
import AssetPermissionFormActionField from './components/AssetPermissionFormActionField'
import AssetSelect from '@/components/AssetSelect'
export default {
@@ -89,14 +90,7 @@ export default {
},
actions: {
label: this.$t('perms.Actions'),
type: 'checkbox-group',
options: [
{ label: 'all', value: this.$t('perms.all') },
{ label: 'connect', value: this.$t('perms.connect') },
{ label: 'updownload', value: this.$t('perms.upDownload') },
{ label: 'upload_file', value: this.$t('perms.uploadFile') },
{ label: 'download_file', value: this.$t('perms.downloadFile') }
]
component: AssetPermissionFormActionField
},
date_start: {
label: this.$t('common.dateStart')

View File

@@ -0,0 +1,67 @@
<template>
<el-tree
:data="data"
show-checkbox
node-key="id"
:default-expand-all="true"
:default-checked-keys="value"
:props="defaultProps"
@check="handleCheckChange"
/>
</template>
<script>
export default {
name: 'AssetPermissionFormActionFiel',
props: {
value: {
type: Array,
default: () => ['all', 'connect', 'upload_file', 'download_file', 'updownload']
}
},
data() {
return {
defaultProps: {
children: 'children',
label: 'label'
},
data: [
{
id: 'all',
label: this.$t('perms.all'),
children: [
{
id: 'connect',
label: this.$t('perms.connect')
},
{
id: 'updownload',
label: this.$t('perms.upDownload'),
children: [
{
id: 'upload_file',
label: this.$t('perms.uploadFile')
},
{
id: 'download_file',
label: this.$t('perms.downloadFile')
}
]
}
]
}
]
}
},
methods: {
handleCheckChange(data, obj) {
const checkedKeys = obj.checkedKeys
this.$emit('input', checkedKeys)
}
}
}
</script>
<style scoped>
</style>