fix(测试用例): 修复测试用例脑图模式下缺陷项目无缺陷不展示关联缺陷按钮

This commit is contained in:
xinxin.wu 2024-09-23 16:07:36 +08:00 committed by 刘瑞斌
parent 7288b539a8
commit 6afa63c5eb
2 changed files with 33 additions and 14 deletions

View File

@ -16,9 +16,17 @@
</a-radio>
</a-radio-group>
<div v-if="showType === 'link'" class="flex items-center justify-between">
<a-button v-if="hasEditPermission" class="mr-3" type="primary" @click="linkBug">
<a-tooltip :disabled="!!bugTotal">
<template #content>
{{ t('caseManagement.featureCase.noAssociatedDefect') }}
<span v-permission="['PROJECT_BUG:READ+ADD']" class="text-[rgb(var(--primary-4))]" @click="createBug">
{{ t('testPlan.featureCase.noBugDataNewBug') }}
</span>
</template>
<a-button v-if="hasEditPermission" :disabled="!bugTotal" class="mr-3" type="primary" @click="linkBug">
{{ t('caseManagement.featureCase.linkDefect') }}
</a-button>
</a-tooltip>
<a-button v-permission="['PROJECT_BUG:READ+ADD']" type="outline" @click="createBug">
{{ t('caseManagement.featureCase.createDefect') }}
</a-button>
@ -75,6 +83,7 @@
import MsButton from '@/components/pure/ms-button/index.vue';
import MsList from '@/components/pure/ms-list/index.vue';
import { getBugList } from '@/api/modules/bug-management';
import {
associatedDebug,
cancelAssociatedDebug,
@ -203,8 +212,27 @@
}
}
const bugTotal = ref<number>(0);
async function initBugList() {
if (!hasAnyPermission(['PROJECT_BUG:READ'])) {
return;
}
const res = await getBugList({
current: 1,
pageSize: 10,
sort: {},
filter: {},
keyword: '',
combine: {},
searchMode: 'AND',
projectId: appStore.currentProjectId,
});
bugTotal.value = res.total;
}
onBeforeMount(() => {
loadBugList();
initBugList();
});
</script>

View File

@ -18,7 +18,7 @@
></a-input-search>
</div>
<div v-if="showType === 'link'" class="flex items-center">
<a-tooltip v-if="!total">
<a-tooltip :disabled="!!total">
<template #content>
{{ t('caseManagement.featureCase.noAssociatedDefect') }}
<span v-permission="['PROJECT_BUG:READ+ADD']" class="text-[rgb(var(--primary-4))]" @click="createDefect">{{
@ -27,7 +27,7 @@
</template>
<a-button
v-permission="['FUNCTIONAL_CASE:READ+UPDATE']"
:disabled="total ? false : true"
:disabled="!total"
class="mr-3"
type="primary"
@click="linkDefect"
@ -35,15 +35,6 @@
{{ t('caseManagement.featureCase.linkDefect') }}
</a-button>
</a-tooltip>
<a-button
v-if="hasAnyPermission(['FUNCTIONAL_CASE:READ+UPDATE']) && total"
:disabled="total ? false : true"
class="mr-3"
type="primary"
@click="linkDefect"
>
{{ t('caseManagement.featureCase.linkDefect') }}
</a-button>
<a-button v-permission="['PROJECT_BUG:READ+ADD']" type="outline" @click="createDefect"
>{{ t('testPlan.featureCase.noBugDataNewBug') }}
</a-button>