fix: 禁止admin修改菜单分配
This commit is contained in:
@@ -32,8 +32,10 @@ import { hasPermissions } from '@/plugins/auth-user';
|
||||
import { MENU_PATH_INLINE } from '@/constants/menu-constants';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
const { t } = useI18n();
|
||||
const { getDict } = useDictStore();
|
||||
const userStore = useUserStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const routePath = route.path;
|
||||
@@ -144,7 +146,7 @@ let tableColumns: ColumnsType = [
|
||||
title: t('views.system.role.createTime'),
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
width: 200,
|
||||
customRender(opt) {
|
||||
if (+opt.value <= 0) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
@@ -366,7 +368,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
menuTreeSelect().then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
menuTree.checkedKeys = parseTreeKeys(res.data, 'id');
|
||||
menuTree.expandedKeys = parseTreeNodeKeys(res.data, 'id');
|
||||
menuTree.treeData = res.data;
|
||||
@@ -940,7 +942,7 @@ onMounted(() => {
|
||||
v-if="
|
||||
dict.sysNormalDisable.length > 0 &&
|
||||
record.roleId !== '1' &&
|
||||
record.roleKey !== 'admin' &&
|
||||
!userStore.roles?.includes(record.roleKey) &&
|
||||
hasPermissions(['system:role:edit'])
|
||||
"
|
||||
v-model:checked="record.status"
|
||||
@@ -970,7 +972,10 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="record.roleId !== '1' && record.roleKey !== 'admin'"
|
||||
v-if="
|
||||
record.roleId !== '1' &&
|
||||
!userStore.roles?.includes(record.roleKey)
|
||||
"
|
||||
>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
@@ -982,7 +987,10 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="record.roleId !== '1' && record.roleKey !== 'admin'"
|
||||
v-if="
|
||||
record.roleId !== '1' &&
|
||||
!userStore.roles?.includes(record.roleKey)
|
||||
"
|
||||
>
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
|
||||
Reference in New Issue
Block a user