From 0c29c9160ad24d169ed2b55903ff92c0c26aa819 Mon Sep 17 00:00:00 2001 From: kdyq007 Date: Mon, 18 Nov 2019 22:22:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=20=E5=8E=BB=E9=99=A4app=5F?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/store/modules/app.js | 1 + .../cmdb/acl/module/addRoleRelationForm.vue | 6 +-- ui/src/views/cmdb/acl/roles.vue | 45 +++---------------- 3 files changed, 8 insertions(+), 44 deletions(-) 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 @@ - - - - @@ -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