修改组件页面
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<div class="mt10 mr10" style="display: flex; justify-content: end">
|
||||
<el-button type="primary" icon="el-icon-Select" @click="saveSystem">保存</el-button>
|
||||
</div>
|
||||
<el-checkbox-group v-model="systemIds" class="md10 system" >
|
||||
<el-checkbox-group v-model="systemIds" class="md10 system">
|
||||
<el-checkbox v-for="item in systemList" :label="item.name" :value="item.id" :key="item.id" />
|
||||
</el-checkbox-group>
|
||||
</el-tab-pane>
|
||||
@@ -46,7 +46,7 @@ import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Tree from '@/components/tree/allocation.vue'
|
||||
import { functionTree } from '@/api/user-boot/function'
|
||||
import { getFunctionsByRoleIndex, updateRoleMenu } from '@/api/user-boot/roleFuction'
|
||||
import { getFunctionsByRoleIndex, updateRoleMenu, getSystemByRoleId, systemAdd } from '@/api/user-boot/roleFuction'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { del } from '@/api/user-boot/role'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@@ -163,6 +163,9 @@ const currentChange = (data: any) => {
|
||||
getFunctionsByRoleIndex({ id: data.row.id }).then((res: any) => {
|
||||
treeRef.value.treeRef.setCheckedKeys(res.data.map((item: any) => item.id))
|
||||
})
|
||||
getSystemByRoleId({ id: data.row.id }).then((res: any) => {
|
||||
systemIds.value = res.data.systemIds || []
|
||||
})
|
||||
}
|
||||
|
||||
const timeout = ref<NodeJS.Timeout>()
|
||||
@@ -185,17 +188,17 @@ const checkChange = (data: any) => {
|
||||
})
|
||||
}
|
||||
const saveSystem = () => {
|
||||
// updateRoleMenu({
|
||||
// id: menuListId.value,
|
||||
// idList: systemIds.value
|
||||
// })
|
||||
// .then(() => {
|
||||
// ElMessage.success('操作成功!')
|
||||
// treeRef.value.loading = false
|
||||
// })
|
||||
// .catch(() => {
|
||||
// treeRef.value.loading = false
|
||||
// })
|
||||
systemAdd({
|
||||
roleId: menuListId.value,
|
||||
systemIds: systemIds.value
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success('操作成功!')
|
||||
treeRef.value.loading = false
|
||||
})
|
||||
.catch(() => {
|
||||
treeRef.value.loading = false
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
@@ -209,11 +212,11 @@ const addRole = () => {
|
||||
:deep(.el-tabs--border-card > .el-tabs__content) {
|
||||
padding: 0px !important;
|
||||
}
|
||||
.system{
|
||||
.system {
|
||||
width: 330px;
|
||||
height: calc(100vh - 225px);
|
||||
border: 1px solid var(--el-border-color);
|
||||
padding: 5px 10px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
padding: 5px 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user