fix(用例管理): 修复用例管理模块树按钮依据权限显示问题

--bug=1039850 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001039850
This commit is contained in:
guoyuqi 2024-04-22 17:12:41 +08:00 committed by 刘瑞斌
parent db79a9bfb6
commit 27c1f177dc
3 changed files with 5 additions and 6 deletions

View File

@ -35,7 +35,6 @@ import io.metersphere.system.mapper.UserRoleRelationMapper;
import io.metersphere.system.notice.constants.NoticeConstants;
import io.metersphere.system.service.BaseCustomFieldOptionService;
import io.metersphere.system.service.BaseCustomFieldService;
import io.metersphere.system.service.UserLoginService;
import io.metersphere.system.uid.IDGenerator;
import io.metersphere.system.utils.ServiceUtils;
import jakarta.annotation.Resource;
@ -111,8 +110,6 @@ public class CaseReviewFunctionalCaseService {
private BaseCustomFieldService baseCustomFieldService;
@Resource
private BaseCustomFieldOptionService baseCustomFieldOptionService;
@Resource
private UserLoginService userLoginService;
private static final String CASE_MODULE_COUNT_ALL = "all";

View File

@ -41,6 +41,7 @@
</template>
<template v-if="!props.isModal" #extra="nodeData">
<MsPopConfirm
v-if="hasAnyPermission(['FUNCTIONAL_CASE:READ+ADD'])"
:visible="addSubVisible"
:is-delete="false"
:all-names="[]"
@ -58,6 +59,7 @@
</MsButton>
</MsPopConfirm>
<MsPopConfirm
v-if="hasAnyPermission(['FUNCTIONAL_CASE:READ+UPDATE'])"
:title="t('caseManagement.featureCase.rename')"
:all-names="[]"
:is-delete="false"
@ -93,12 +95,12 @@
moveCaseModuleTree,
updateCaseModuleTree,
} from '@/api/modules/case-management/featureCase';
import { ProjectMemberOptions } from '@/api/requrls/project-management/projectMember';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import useAppStore from '@/store/modules/app';
import useFeatureCaseStore from '@/store/modules/case/featureCase';
import { mapTree } from '@/utils';
import { hasAnyPermission } from '@/utils/permission';
import type { CreateOrUpdateModule, UpdateModule } from '@/models/caseManagement/featureCase';
import { ModuleTreeNode } from '@/models/common';

View File

@ -19,7 +19,7 @@
<MsIcon :type="isExpandAll ? 'icon-icon_folder_collapse1' : 'icon-icon_folder_expansion1'" />
</MsButton>
</a-tooltip>
<popConfirm mode="add" :all-names="rootModulesName" parent-id="NONE" @add-finish="() => initModules()">
<popConfirm v-if="hasAnyPermission(['CASE_REVIEW:READ+UPDATE'])" mode="add" :all-names="rootModulesName" parent-id="NONE" @add-finish="() => initModules()">
<MsButton type="icon" class="!mr-0 p-[2px]">
<MsIcon
type="icon-icon_create_planarity"
@ -67,7 +67,7 @@
<template v-if="!props.isModal" #extra="nodeData">
<!-- 默认模块的 id 是root默认模块不可编辑不可添加子模块 -->
<popConfirm
v-if="nodeData.id !== 'root' && hasAnyPermission(['CASE_REVIEW:READ+DELETE'])"
v-if="nodeData.id !== 'root' && hasAnyPermission(['CASE_REVIEW:READ+ADD'])"
mode="add"
:all-names="(nodeData.children || []).map((e: ModuleTreeNode) => e.name || '')"
:parent-id="nodeData.id"