mirror of https://github.com/veops/cmdb.git
[更新] 去除app_id
This commit is contained in:
parent
6a7bb725cc
commit
224a48a5f3
|
@ -14,6 +14,7 @@ import {
|
|||
|
||||
const app = {
|
||||
state: {
|
||||
name: 'cmdb',
|
||||
sidebar: true,
|
||||
device: 'desktop',
|
||||
theme: '',
|
||||
|
|
|
@ -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
|
||||
})
|
||||
},
|
||||
|
|
|
@ -1,21 +1,9 @@
|
|||
<template>
|
||||
<a-card :bordered="false">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="48">
|
||||
<a-col :md="3" :sm="24">
|
||||
|
||||
<div class="action-btn">
|
||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="应用列表">
|
||||
<a-select placeholder="请选择" v-model="queryParam.app_id">
|
||||
<a-select-option v-for="app in appList" :key="app.id" :label="app.name" :value="app.id">{{ app.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
<s-table
|
||||
:alert="options.alert"
|
||||
|
@ -65,10 +53,6 @@
|
|||
<template v-else>{{ text }}</template>
|
||||
</template>
|
||||
|
||||
<span slot="app_id" slot-scope="text">
|
||||
<template>{{ text }}</template>
|
||||
</span>
|
||||
|
||||
<span slot="is_app_admin" slot-scope="text">
|
||||
<a-icon type="check" v-if="text"/>
|
||||
</span>
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue