fix(测试计划): 修改测试计划缺陷徽标展示&缺陷管理字段添加&缺陷管理样式调整

This commit is contained in:
xinxin.wu 2024-05-23 19:10:12 +08:00 committed by Craftsman
parent 15ea1d13a7
commit 1735124242
7 changed files with 37 additions and 44 deletions

View File

@ -19,7 +19,7 @@
</template> </template>
<a-form ref="formRef" :model="form" layout="vertical"> <a-form ref="formRef" :model="form" layout="vertical">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="left mt-[16px] min-w-[732px] grow"> <div class="left mt-[16px] w-[calc(100%-428px)] grow">
<!-- 平台默认模板不展示缺陷名称, 描述 --> <!-- 平台默认模板不展示缺陷名称, 描述 -->
<a-form-item <a-form-item
v-if="!isPlatformDefaultTemplate" v-if="!isPlatformDefaultTemplate"
@ -151,7 +151,7 @@
</MsFileList> </MsFileList>
</div> </div>
<a-divider class="ml-[16px]" direction="vertical" /> <a-divider class="ml-[16px]" direction="vertical" />
<div class="right mt-[16px] max-w-[433px] grow pr-[24px]"> <div class="right mt-[16px] w-[428px] grow pr-[24px]">
<div class="min-w-[250px] overflow-auto"> <div class="min-w-[250px] overflow-auto">
<a-skeleton v-if="isLoading" :loading="isLoading" :animation="true"> <a-skeleton v-if="isLoading" :loading="isLoading" :animation="true">
<a-space direction="vertical" class="w-full" size="large"> <a-space direction="vertical" class="w-full" size="large">

View File

@ -42,7 +42,7 @@
</MsButton> </MsButton>
<span v-if="hasAnyPermission(['PROJECT_BUG:READ+ADD'])">{{ t('caseManagement.featureCase.or') }}</span> <span v-if="hasAnyPermission(['PROJECT_BUG:READ+ADD'])">{{ t('caseManagement.featureCase.or') }}</span>
<MsButton v-permission="['PROJECT_BUG:READ+ADD']" class="ml-[8px]" @click="createDefect"> <MsButton v-permission="['PROJECT_BUG:READ+ADD']" class="ml-[8px]" @click="createDefect">
{{ t('caseManagement.featureCase.createDefect') }} {{ t('testPlan.featureCase.noBugDataNewBug') }}
</MsButton> </MsButton>
</div> </div>
</template> </template>

View File

@ -6,7 +6,7 @@
<template #content> <template #content>
{{ t('caseManagement.featureCase.noAssociatedDefect') }} {{ t('caseManagement.featureCase.noAssociatedDefect') }}
<span v-permission="['PROJECT_BUG:READ+ADD']" class="text-[rgb(var(--primary-4))]" @click="createDefect">{{ <span v-permission="['PROJECT_BUG:READ+ADD']" class="text-[rgb(var(--primary-4))]" @click="createDefect">{{
t('caseManagement.featureCase.createDefect') t('testPlan.featureCase.noBugDataNewBug')
}}</span> }}</span>
</template> </template>
<a-button <a-button
@ -29,7 +29,7 @@
{{ t('caseManagement.featureCase.linkDefect') }} {{ t('caseManagement.featureCase.linkDefect') }}
</a-button> </a-button>
<a-button v-permission="['PROJECT_BUG:READ+ADD']" type="outline" @click="createDefect" <a-button v-permission="['PROJECT_BUG:READ+ADD']" type="outline" @click="createDefect"
>{{ t('caseManagement.featureCase.createDefect') }} >{{ t('testPlan.featureCase.noBugDataNewBug') }}
</a-button> </a-button>
</div> </div>
<div v-else v-permission="['FUNCTIONAL_CASE:READ+UPDATE']" class="font-medium">{{ <div v-else v-permission="['FUNCTIONAL_CASE:READ+UPDATE']" class="font-medium">{{

View File

@ -177,7 +177,7 @@ export default {
'system.orgTemplate.templateCase': '用例', 'system.orgTemplate.templateCase': '用例',
'system.orgTemplate.templateApi': '接口', 'system.orgTemplate.templateApi': '接口',
'system.orgTemplate.templateBug': '缺陷', 'system.orgTemplate.templateBug': '缺陷',
'system.orgTemplate.enableTip': '确认启用项目模吗', 'system.orgTemplate.enableTip': '确认启用项目模吗',
'system.orgTemplate.enableWarningTip': '启用后,不可恢复为组织模版,请谨慎操作!', 'system.orgTemplate.enableWarningTip': '启用后,不可恢复为组织模版,请谨慎操作!',
'system.orgTemplate.typeEmptyTip': '字段类型不能为空', 'system.orgTemplate.typeEmptyTip': '字段类型不能为空',
'system.orgTemplate.searchOrgPlaceholder': '请输入组织名称', 'system.orgTemplate.searchOrgPlaceholder': '请输入组织名称',

View File

@ -102,6 +102,7 @@
(e: 'link'): void; (e: 'link'): void;
(e: 'new'): void; (e: 'new'): void;
(e: 'save', params: TableQueryParams): void; (e: 'save', params: TableQueryParams): void;
(e: 'updateCount'): void;
}>(); }>();
const columns = ref<MsTableColumn>([ const columns = ref<MsTableColumn>([
@ -137,6 +138,14 @@
ellipsis: true, ellipsis: true,
showDrag: false, showDrag: false,
}, },
{
title: 'common.creator',
slotName: 'createUser',
dataIndex: 'createUser',
showInTable: true,
width: 200,
ellipsis: true,
},
{ {
title: 'caseManagement.featureCase.updateUser', title: 'caseManagement.featureCase.updateUser',
slotName: 'handleUserName', slotName: 'handleUserName',
@ -218,6 +227,7 @@
await testPlanCancelBug(id); await testPlanCancelBug(id);
Message.success(t('caseManagement.featureCase.cancelLinkSuccess')); Message.success(t('caseManagement.featureCase.cancelLinkSuccess'));
initData(); initData();
emit('updateCount');
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} finally { } finally {

View File

@ -78,9 +78,9 @@
</div> </div>
<MsTab <MsTab
v-model:active-key="activeTab" v-model:active-key="activeTab"
:show-badge="false"
:content-tab-list="contentTabList" :content-tab-list="contentTabList"
no-content no-content
:get-text-func="getTotal"
class="relative mx-[16px] border-b" class="relative mx-[16px] border-b"
/> />
<div :class="[' flex-1', activeTab !== 'detail' ? 'tab-content' : 'overflow-hidden']"> <div :class="[' flex-1', activeTab !== 'detail' ? 'tab-content' : 'overflow-hidden']">
@ -123,7 +123,7 @@
<MsTag type="danger" theme="light" size="medium" class="ml-4"> <MsTag type="danger" theme="light" size="medium" class="ml-4">
<MsIcon type="icon-icon_defect" class="!text-[14px] text-[rgb(var(--danger-6))]" size="16" /> <MsIcon type="icon-icon_defect" class="!text-[14px] text-[rgb(var(--danger-6))]" size="16" />
<span class="ml-1 text-[rgb(var(--danger-6))]"> {{ t('testPlan.featureCase.bug') }}</span> <span class="ml-1 text-[rgb(var(--danger-6))]"> {{ t('testPlan.featureCase.bug') }}</span>
<span class="ml-1 text-[rgb(var(--danger-6))]">{{ bugCount }}</span> <span class="ml-1 text-[rgb(var(--danger-6))]">{{ caseDetail.bugListCount }}</span>
</MsTag> </MsTag>
<a-dropdown @select="handleSelect"> <a-dropdown @select="handleSelect">
<a-button type="outline" size="mini" class="ml-1"> <a-button type="outline" size="mini" class="ml-1">
@ -174,6 +174,7 @@
:test-plan-case-id="activeId" :test-plan-case-id="activeId"
@link="linkDefect" @link="linkDefect"
@new="addBug" @new="addBug"
@update-count="loadCaseDetail()"
/> />
<ExecutionHistory <ExecutionHistory
v-if="activeTab === 'executionHistory'" v-if="activeTab === 'executionHistory'"
@ -199,7 +200,7 @@
caseId: activeCaseId, caseId: activeCaseId,
testPlanId:route.query.id as string, testPlanId:route.query.id as string,
}" }"
@success="addSuccess" @success="loadCaseDetail()"
/> />
</template> </template>
@ -455,8 +456,6 @@
} }
} }
const bugCount = ref<number>(0);
const showLinkDrawer = ref<boolean>(false); const showLinkDrawer = ref<boolean>(false);
const drawerLoading = ref<boolean>(false); const drawerLoading = ref<boolean>(false);
@ -482,27 +481,21 @@
} }
const bugRef = ref(); const bugRef = ref();
async function getBugTotal() {
try {
const params = {
testPlanCaseId: activeId.value,
caseId: activeCaseId.value,
projectId: appStore.currentProjectId,
current: 1,
pageSize: 10,
};
const res = await associatedBugPage(params);
bugCount.value = res.total;
} catch (error) {
console.log(error);
}
}
function addSuccess() { function addSuccess() {
if (activeTab.value === 'defectList') { if (activeTab.value === 'defectList') {
bugRef.value?.initData(); bugRef.value?.initData();
} else { }
getBugTotal(); }
function getTotal(key: string) {
const { bugListCount, historyCount } = caseDetail.value;
switch (key) {
case 'defectList':
return bugListCount > 99 ? `99+` : `${bugListCount}`;
case 'executionHistory':
return historyCount > 99 ? `99+` : `${historyCount}`;
default:
return '';
} }
} }
@ -518,6 +511,7 @@
Message.success(t('caseManagement.featureCase.associatedSuccess')); Message.success(t('caseManagement.featureCase.associatedSuccess'));
showLinkDrawer.value = false; showLinkDrawer.value = false;
addSuccess(); addSuccess();
loadCaseDetail();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} finally { } finally {
@ -559,9 +553,9 @@
moduleIds, moduleIds,
}; };
} }
if (activeTab.value === 'detail') { // if (activeTab.value === 'detail') {
getBugTotal(); // getBugTotal();
} // }
getPlanDetail(); getPlanDetail();
initBugList(); initBugList();
await loadCase(); await loadCase();
@ -571,16 +565,6 @@
() => { () => {
loadCaseDetail(); loadCaseDetail();
initBugList(); initBugList();
getBugTotal();
}
);
watch(
() => activeTab.value,
(val) => {
if (val === 'detail') {
getBugTotal();
}
} }
); );
</script> </script>

View File

@ -64,8 +64,7 @@ export default {
'testPlan.testPlanIndex.apiScenarioCase': '接口场景用例', 'testPlan.testPlanIndex.apiScenarioCase': '接口场景用例',
'testPlan.testPlanIndex.deleteArchivedPlan': '计划 已归档,删除后数据不可恢复,请谨慎操作!', 'testPlan.testPlanIndex.deleteArchivedPlan': '计划 已归档,删除后数据不可恢复,请谨慎操作!',
'testPlan.testPlanIndex.deletePendingPlan': '计划 未执行,删除后数据不可恢复,请谨慎操作!', 'testPlan.testPlanIndex.deletePendingPlan': '计划 未执行,删除后数据不可恢复,请谨慎操作!',
'testPlan.testPlanIndex.deleteRunningPlan': 'testPlan.testPlanIndex.deleteRunningPlan': '计划 进行中,删除后,终止执行且不可恢复,请谨慎操作!',
'计划 进行中,删除后,终止执行且不可恢复,定时任务停止并删除,请谨慎操作!',
'testPlan.testPlanIndex.deleteCompletedPlan': 'testPlan.testPlanIndex.deleteCompletedPlan':
'建议计划 已完成 ,选择归档,用例信息及执行结果都将被保留;若继续删除,数据将不会恢复,请谨慎操作!', '建议计划 已完成 ,选择归档,用例信息及执行结果都将被保留;若继续删除,数据将不会恢复,请谨慎操作!',
'testPlan.testPlanIndex.confirmArchivePlan': '归档后,执行信息不再更新且不可编辑,数据不可恢复,请谨慎操作!', 'testPlan.testPlanIndex.confirmArchivePlan': '归档后,执行信息不再更新且不可编辑,数据不可恢复,请谨慎操作!',