diff --git a/ui/src/store/modules/app.js b/ui/src/store/modules/app.js
index 33e1180..9cc8d4e 100644
--- a/ui/src/store/modules/app.js
+++ b/ui/src/store/modules/app.js
@@ -14,6 +14,7 @@ import {
const app = {
state: {
+ name: 'cmdb',
sidebar: true,
device: 'desktop',
theme: '',
diff --git a/ui/src/views/cmdb/acl/module/addRoleRelationForm.vue b/ui/src/views/cmdb/acl/module/addRoleRelationForm.vue
index 3b9ea5b..3f8ef04 100644
--- a/ui/src/views/cmdb/acl/module/addRoleRelationForm.vue
+++ b/ui/src/views/cmdb/acl/module/addRoleRelationForm.vue
@@ -65,8 +65,7 @@ export default {
drawerTitle: '角色关联',
drawerVisible: false,
formLayout: 'vertical',
- allRoles: [],
- app_id: 0
+ allRoles: []
}
},
@@ -108,7 +107,6 @@ export default {
handleAddRoleRelation (record) {
this.drawerVisible = true
this.$nextTick(() => {
- this.app_id = record.app_id
this.getAllRoles()
this.form.setFieldsValue({
id: record.id
@@ -132,7 +130,7 @@ export default {
})
},
getAllRoles () {
- searchRole({ page_size: 999, app_id: this.app_id }).then(res => {
+ searchRole({ page_size: 999, app_id: this.$store.state.app.name }).then(res => {
this.allRoles = res.roles
})
},
diff --git a/ui/src/views/cmdb/acl/roles.vue b/ui/src/views/cmdb/acl/roles.vue
index 827bba7..a1ab2d9 100644
--- a/ui/src/views/cmdb/acl/roles.vue
+++ b/ui/src/views/cmdb/acl/roles.vue
@@ -1,21 +1,9 @@
-
-
-
-
-
-
-
-
- {{ app.name }}
-
-
-
-
-
+
+
{{ text }}
-
- {{ text }}
-
-
@@ -117,10 +101,6 @@ export default {
},
data () {
return {
- appList: [{
- id: '1',
- name: '默认应用'
- }],
scroll: { x: 1000, y: 500 },
btnName: '新增角色',
@@ -154,13 +134,6 @@ export default {
}
}
},
- {
- title: '应用',
- dataIndex: 'app_id',
- width: 250,
- sorter: false,
- scopedSlots: { customRender: 'app_id' }
- },
{
title: '管理者',
dataIndex: 'is_app_admin',
@@ -185,6 +158,7 @@ export default {
}
],
loadData: parameter => {
+ parameter.app_id = this.$store.state.app.name
parameter.page = parameter.pageNo
parameter.page_size = parameter.pageSize
delete parameter.pageNo
@@ -231,10 +205,6 @@ export default {
this.form = this.$form.createForm(this)
},
- created () {
- this.queryParam.app_id = this.appList[0].id
- },
-
computed: {
formItemLayout () {
@@ -276,11 +246,6 @@ export default {
this.columnSearchText[column.dataIndex] = ''
this.queryParam[column.dataIndex] = ''
},
- searchRoles (params) {
- searchRole(params).then(res => {
- this.allRoles = res.roles
- })
- },
setScrollY () {
this.scroll.y = window.innerHeight - this.$refs.table.$el.offsetTop - 200