|
|
@@ -9,7 +9,7 @@
|
|
|
<template #prefix>
|
|
|
<SvgIcon name="i-ri:user-3-fill" />
|
|
|
</template>
|
|
|
- <template #append >
|
|
|
+ <template #append>
|
|
|
<el-button :icon="Search" class="ElInputSearch" @click="rolequery" v-auth="'role.view'" />
|
|
|
</template>
|
|
|
</ElInput>
|
|
|
@@ -64,7 +64,7 @@
|
|
|
@check="handleCheckChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-empty v-else image="../../../src/assets/images/empty.png" />
|
|
|
+ <el-empty v-else image="../../../src/assets/images/empty.png" />
|
|
|
</ElCol>
|
|
|
</ElRow>
|
|
|
|
|
|
@@ -194,7 +194,7 @@ function roleDelClick() {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'error',
|
|
|
draggable: true,
|
|
|
- center:true,
|
|
|
+ center: true,
|
|
|
}
|
|
|
)
|
|
|
.then(async () => {
|
|
|
@@ -218,7 +218,10 @@ function roleDelClick() {
|
|
|
|
|
|
}
|
|
|
async function roleitemClick(item: { id: string }) {
|
|
|
- await api.roleApi.roleGet({ roleId: item.id }).then((res: any) => {
|
|
|
+ if (treeRef.value) {
|
|
|
+ treeRef.value.setCheckedKeys([]);
|
|
|
+ }
|
|
|
+ await api.roleApi.roleGet({ roleId: item.id }).then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
|
checkedKeys.value = res.data.perms.map((val: Perm) => val.id);
|
|
|
roleInfo.permsId = res.data.perms.map((val: Perm) => val.id);
|
|
|
@@ -229,10 +232,9 @@ async function roleitemClick(item: { id: string }) {
|
|
|
roleId.value = res.data.id;
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
async function rolequery() {
|
|
|
- await api.roleApi.roleList({ name: roleName.value }).then((res: any) => {
|
|
|
+ await api.roleApi.roleList({ name: roleName.value }).then((res: any) => {
|
|
|
roleList.value = res.data;
|
|
|
})
|
|
|
}
|
|
|
@@ -244,9 +246,9 @@ function resetForm() {
|
|
|
roleInfo.permsId = [];
|
|
|
roleInfo.perms = [];
|
|
|
roleInfo.id = '';
|
|
|
- roleId.value='';
|
|
|
+ roleId.value = '';
|
|
|
if (treeRef.value) {
|
|
|
- treeRef.value.setCheckedKeys([]);
|
|
|
+ treeRef.value.setCheckedKeys([]);//清空菜单勾选回显
|
|
|
}
|
|
|
}
|
|
|
|