mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 20:19:16 +08:00
fix(测试用例): 修复测试用例脑图模式下缺陷项目无缺陷不展示关联缺陷按钮
This commit is contained in:
parent
7288b539a8
commit
6afa63c5eb
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user