fix(用例管理): 修复项目应用未开启关联需求,功能用例关联需求页面显示关联需求按钮问题

--bug=1036126 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036126
This commit is contained in:
guoyuqi 2024-04-23 20:06:18 +08:00 committed by 刘瑞斌
parent cbab810c8f
commit 55871dfd9d
2 changed files with 21 additions and 4 deletions

View File

@ -24,7 +24,11 @@
<div class="flex w-full items-center justify-center text-[var(--color-text-4)]">
<span
v-if="
hasAnyPermission(['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+UPDATE', 'FUNCTIONAL_CASE:READ+DELETE'])
hasAnyPermission([
'FUNCTIONAL_CASE:READ+ADD',
'FUNCTIONAL_CASE:READ+UPDATE',
'FUNCTIONAL_CASE:READ+DELETE',
]) && caseEnable
"
>
{{ t('caseManagement.caseReview.tableNoData') }}
@ -32,7 +36,11 @@
<span v-else> {{ t('caseManagement.featureCase.tableNoData') }} </span>
<MsButton
v-if="
hasAnyPermission(['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+UPDATE', 'FUNCTIONAL_CASE:READ+DELETE'])
hasAnyPermission([
'FUNCTIONAL_CASE:READ+ADD',
'FUNCTIONAL_CASE:READ+UPDATE',
'FUNCTIONAL_CASE:READ+DELETE',
]) && caseEnable
"
class="ml-[8px]"
@click="emit('associate')"
@ -41,7 +49,11 @@
</MsButton>
<span
v-if="
hasAnyPermission(['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+UPDATE', 'FUNCTIONAL_CASE:READ+DELETE'])
hasAnyPermission([
'FUNCTIONAL_CASE:READ+ADD',
'FUNCTIONAL_CASE:READ+UPDATE',
'FUNCTIONAL_CASE:READ+DELETE',
]) && caseEnable
"
>
{{ t('caseManagement.featureCase.or') }}
@ -92,6 +104,7 @@
isShowOperation?: boolean; //
highlightName?: boolean; //
showEmpty?: boolean; //
caseEnable?: boolean; //
}>(),
{
isShowOperation: true,

View File

@ -3,7 +3,7 @@
<div class="mb-4 flex items-center justify-between">
<div>
<a-button
v-if="platformInfo.platform_key"
v-if="caseEnable"
v-permission="['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+UPDATE', 'FUNCTIONAL_CASE:READ+DELETE']"
type="primary"
@click="associatedDemand"
@ -34,6 +34,7 @@
ref="demandRef"
:fun-params="{ caseId: props.caseId, keyword, projectId: currentProjectId }"
:show-empty="true"
:case-enable="caseEnable"
@update="updateDemand"
@create="addDemand"
@cancel="cancelLink"
@ -141,6 +142,8 @@
const showAddModel = ref<boolean>(false);
const caseEnable = ref<boolean>(false);
const initModelForm: DemandItem = {
id: '',
caseId: '', // ID
@ -350,6 +353,7 @@
const result = await getCaseRelatedInfo(currentProjectId.value);
if (result && result.platform_key) {
platformInfo.value = { ...result };
caseEnable.value = platformInfo.value.case_enable !== 'false';
}
} catch (error) {
console.log(error);