mirror of
https://github.com/veops/cmdb.git
synced 2025-08-09 11:38:55 +08:00
feat(ui):批量导入模型根据create权限过滤&&模型配置页面权限 (#323)
This commit is contained in:
@@ -77,7 +77,7 @@ const genCmdbRoutes = async () => {
|
||||
path: '/cmdb/ci_types',
|
||||
name: 'ci_type',
|
||||
component: () => import('../views/ci_types/index'),
|
||||
meta: { title: '模型配置', icon: 'ops-cmdb-citype', selectedIcon: 'ops-cmdb-citype-selected', keepAlive: false }
|
||||
meta: { title: '模型配置', icon: 'ops-cmdb-citype', selectedIcon: 'ops-cmdb-citype-selected', keepAlive: false, permission: ['cmdb_admin', 'admin'] }
|
||||
},
|
||||
{
|
||||
path: '/cmdb/disabled3',
|
||||
|
@@ -89,10 +89,12 @@
|
||||
|
||||
<script>
|
||||
import _ from 'lodash'
|
||||
import { mapState } from 'vuex'
|
||||
import { downloadExcel } from '../../../utils/helper'
|
||||
import { getCITypes } from '@/modules/cmdb/api/CIType'
|
||||
import { getCITypeAttributesById } from '@/modules/cmdb/api/CITypeAttr'
|
||||
import { getCITypeParent, getCanEditByParentIdChildId } from '@/modules/cmdb/api/CITypeRelation'
|
||||
import { searchPermResourceByRoleId } from '@/modules/acl/api/permission'
|
||||
|
||||
export default {
|
||||
name: 'CiTypeChoice',
|
||||
@@ -112,9 +114,21 @@ export default {
|
||||
canEdit: {},
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
computed: {
|
||||
...mapState({
|
||||
rid: (state) => state.user.rid,
|
||||
}),
|
||||
},
|
||||
async created() {
|
||||
const { resources } = await searchPermResourceByRoleId(this.rid, {
|
||||
resource_type_id: 'CIType',
|
||||
app_id: 'cmdb',
|
||||
})
|
||||
getCITypes().then((res) => {
|
||||
this.ciTypeList = res.ci_types
|
||||
this.ciTypeList = res.ci_types.filter((type) => {
|
||||
const _findRe = resources.find((re) => re.name === type.name)
|
||||
return _findRe?.permissions.includes('create') ?? false
|
||||
})
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
|
Reference in New Issue
Block a user