fix(测试计划): 修改一系列调整的问题和部分bug

This commit is contained in:
xinxin.wu 2024-05-24 13:37:07 +08:00 committed by 刘瑞斌
parent 6980ca0b53
commit 829ec6f298
16 changed files with 173 additions and 90 deletions

View File

@ -490,29 +490,30 @@
getCaseLevelColumn();
});
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setTableSelected } = useTable(
props.getTableFunc,
{
columns,
scroll: { x: '100%' },
showSetting: false,
selectable: true,
showSelectAll: true,
heightUsed: 310,
showSelectorAll: !props.selectorAll,
},
(record) => {
return {
...record,
tags: (record.tags || []).map((item: string, i: number) => {
return {
id: `${record.id}-${i}`,
name: item,
};
}),
};
}
);
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setTableSelected, resetFilterParams } =
useTable(
props.getTableFunc,
{
columns,
scroll: { x: '100%' },
showSetting: false,
selectable: true,
showSelectAll: true,
heightUsed: 310,
showSelectorAll: !props.selectorAll,
},
(record) => {
return {
...record,
tags: (record.tags || []).map((item: string, i: number) => {
return {
id: `${record.id}-${i}`,
name: item,
};
}),
};
}
);
//
// TODO:
@ -740,6 +741,7 @@
() => props.visible,
(val) => {
if (val) {
resetFilterParams();
if (!props.hideProjectSelect) {
initProjectList(true);
} else {
@ -761,6 +763,7 @@
if (!props.hideProjectSelect) {
initProjectList(true);
}
resetFilterParams();
initModules(true);
searchCase();
initFilter();
@ -771,6 +774,7 @@
(val) => {
if (val) {
resetSelector();
resetFilterParams();
initModules(true);
searchCase();
initFilter();

View File

@ -2,7 +2,7 @@
<a-input-password
v-model="inputValue"
:placeholder="placeholder"
:default-visibility="false"
:default-visibility="true"
allow-clear
@clear="clearHandler"
@input="inputHandler"

View File

@ -76,6 +76,14 @@ export const defaultReportDetail: PlanReportDetail = {
};
export const statusConfig: StatusListType[] = [
{
label: 'common.unExecute',
value: 'pending',
color: '#D4D4D8',
class: 'bg-[var(--color-text-input-border)]',
rateKey: 'requestPendingRate',
key: 'PENDING',
},
{
label: 'common.success',
value: 'success',
@ -93,22 +101,7 @@ export const statusConfig: StatusListType[] = [
// rateKey: 'requestFakeErrorRate',
// key: 'FAKE_ERROR',
// },
{
label: 'common.fail',
value: 'error',
color: '#ED0303',
class: 'bg-[rgb(var(--danger-6))]',
rateKey: 'requestErrorRate',
key: 'ERROR',
},
{
label: 'common.unExecute',
value: 'pending',
color: '#D4D4D8',
class: 'bg-[var(--color-text-input-border)]',
rateKey: 'requestPendingRate',
key: 'PENDING',
},
{
label: 'common.block',
value: 'block',
@ -117,6 +110,14 @@ export const statusConfig: StatusListType[] = [
rateKey: 'requestPendingRate',
key: 'BLOCK',
},
{
label: 'common.fail',
value: 'error',
color: '#ED0303',
class: 'bg-[rgb(var(--danger-6))]',
rateKey: 'requestErrorRate',
key: 'ERROR',
},
];
export default {};

View File

@ -40,8 +40,10 @@
<div class="mb-[2px] mr-[4px] h-[6px] w-[6px] rounded-full" :class="item.class"></div>
<div class="text-[var(--color-text-4)]">{{ item.label }}</div>
</div>
<div class="text-center">{{ item.count || 0 }}</div>
<div class="text-right">{{ item.rote || 0 }} <span v-if="String(item.rote) !== 'Calculating'"></span></div>
<div class="text-center font-medium text-[var(--color-text-1)]">{{ item.count || 0 }}</div>
<div class="text-right font-medium text-[var(--color-text-1)]"
>{{ item.rote || 0 }} <span v-if="String(item.rote) !== 'Calculating'"></span
></div>
</div>
</div>
</div>

View File

@ -258,12 +258,24 @@
series: {
name: '',
type: 'pie',
radius: ['65%', '80%'],
radius: ['62%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center',
},
itemStyle: {
normal: {
borderWidth: 2,
borderColor: '#ffffff',
},
emphasis: {
borderWidth: 0,
shadowBlur: 0,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
emphasis: {
label: {
show: false,

View File

@ -264,12 +264,24 @@
series: {
name: '',
type: 'pie',
radius: ['65%', '80%'],
radius: ['62%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center',
},
itemStyle: {
normal: {
borderWidth: 2,
borderColor: '#ffffff',
},
emphasis: {
borderWidth: 0,
shadowBlur: 0,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
emphasis: {
label: {
show: false,

View File

@ -850,10 +850,12 @@
currentSelectCount: 0,
});
const conditionParams = ref({
keyword: '',
filter: {},
combine: {},
const conditionParams = computed(() => {
return {
keyword: keyword.value,
filter: propsRes.value.filter,
combine: batchParams.value.condition,
};
});
async function initTableParams() {
@ -865,11 +867,6 @@
moduleIds = [...featureCaseStore.moduleId, ...props.offspringIds];
}
}
conditionParams.value = {
keyword: keyword.value,
filter: propsRes.value.filter,
combine: batchParams.value.condition,
};
return {
moduleIds,

View File

@ -222,6 +222,15 @@
ellipsis: true,
showDrag: false,
},
{
title: 'common.creator',
slotName: 'createUserName',
dataIndex: 'createUserName',
showInTable: true,
showTooltip: true,
width: 200,
ellipsis: true,
},
{
title: 'caseManagement.featureCase.updateUser',
slotName: 'handleUserName',

View File

@ -18,8 +18,16 @@
<a-switch v-model="isEnable" :disabled="isDisabled" size="small" type="line" />
<a-tooltip>
<template #content>
<div class="text-sm">{{ t('organization.service.statusEnableTip') }}</div>
<div class="text-sm">{{ t('organization.service.statusDisableTip') }}</div>
<div class="text-sm">{{
pluginId === 'jira'
? t('organization.service.statusJiraEnableTip')
: t('organization.service.statusEnableTip')
}}</div>
<div class="text-sm">{{
pluginId === 'jira'
? t('organization.service.statusJiraDisableTip')
: t('organization.service.statusDisableTip')
}}</div>
</template>
<icon-question-circle class="ml-2 text-[--color-text-4]" />
</a-tooltip>

View File

@ -1,7 +1,11 @@
export default {
'organization.service.searchPlugin': 'Search by plug-in name',
'system.service.statusEnableTip': 'Open: Projects can be integrated with the platform',
'system.service.statusDisableTip': 'Shutdown: Projects cannot integrate with the platform',
'organization.service.statusJiraEnableTip':
'Open: can integrate with the platform and generate default templates for the platform',
'system.service.statusDisableTip': 'Off: Projects cannot integrate with the platform',
'organization.service.statusJiraDisableTip':
'Off: The project cannot be integrated with the platform and the platform default template is not available',
'organization.service.headerTip': 'Service integration usage guidelines',
'organization.service.integrationList': 'Integration of List',
'organization.service.packUp': 'Pack Up',

View File

@ -1,7 +1,9 @@
export default {
'organization.service.searchPlugin': '通过插件名称搜索',
'organization.service.statusEnableTip': '开启:项目可以与该平台集成',
'organization.service.statusJiraEnableTip': '开启:项目可以与该平台集成并生成该平台的默认模板',
'organization.service.statusDisableTip': '关闭:项目无法与该平台集成',
'organization.service.statusJiraDisableTip': '关闭:项目无法与该平台集成且该平台默认模板不可用',
'organization.service.headerTip': '服务集成 使用指引',
'organization.service.integrationList': '集成列表',
'organization.service.packUp': '收起',

View File

@ -93,7 +93,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { Message } from '@arco-design/web-vue';
import dayjs from 'dayjs';
@ -126,6 +126,7 @@
const { t } = useI18n();
const keyword = ref<string>('');
const router = useRouter();
const route = useRoute();
type ReportShowType = 'All' | 'INDEPENDENT' | 'INTEGRATED';
const showType = ref<ReportShowType>('All');
@ -402,10 +403,6 @@
});
};
onBeforeMount(() => {
initData();
});
function changeShowType(val: string | number | boolean) {
showType.value = val as ReportShowType;
resetFilterParams();
@ -431,6 +428,13 @@
},
});
}
onBeforeMount(() => {
if (route.query.id) {
showReportDetail(route.query.id as string);
}
initData();
});
</script>
<style lang="less" scoped>

View File

@ -19,7 +19,7 @@
{{ props.detail.caseTotal || 0 }}
</td>
</tr>
<tr class="popover-tr">
<tr v-if="props.status === 'pending'" class="popover-tr">
<td class="popover-label-td">
<div class="mb-[2px] mr-[4px] h-[6px] w-[6px] rounded-full bg-[var(--color-text-input-border)]"></div>
<div>{{ t('common.unExecute') }}</div>
@ -31,7 +31,7 @@
{{ statusExecuteRate.pendingRateResult }}
</td>
</tr>
<tr class="popover-tr">
<tr v-if="props.status === 'success'" class="popover-tr">
<td class="popover-label-td">
<div class="mb-[2px] mr-[4px] h-[6px] w-[6px] rounded-full bg-[rgb(var(--success-6))]"></div>
<div>{{ t('common.success') }}</div>
@ -53,7 +53,7 @@
{{ detailCount.fakeErrorCount }}
</td>
</tr> -->
<tr class="popover-tr">
<tr v-if="props.status === 'block'" class="popover-tr">
<td class="popover-label-td">
<div class="mb-[2px] mr-[4px] h-[6px] w-[6px] rounded-full bg-[var(--color-fill-p-3)]"></div>
<div>{{ t('common.block') }}</div>
@ -65,7 +65,7 @@
{{ statusExecuteRate.blockRateResult }}
</td>
</tr>
<tr class="popover-tr">
<tr v-if="props.status === 'error'" class="popover-tr">
<td class="popover-label-td">
<div class="mb-[2px] mr-[4px] h-[6px] w-[6px] rounded-full bg-[rgb(var(--danger-6))]"></div>
<div>{{ t('common.fail') }}</div>

View File

@ -1,8 +1,7 @@
<template>
<MsCard class="mb-[16px]" hide-back hide-footer auto-height no-content-padding hide-divider>
<template #headerLeft>
<div class="flex items-center font-medium"
>{{ t('report.name') }}
<div class="flex items-center font-medium">
<a-tooltip :content="detail.name" :mouse-enter-delay="300"
><div class="one-line-text max-w-[300px]">{{ detail.name }}</div>
</a-tooltip>
@ -87,7 +86,7 @@
<div class="analysis min-w-[410px]">
<div class="block-title">{{ t('report.detail.executionAnalysis') }}</div>
<SetReportChart
size="150px"
size="160px"
:legend-data="legendData"
:options="charOptions"
:request-total="getIndicators(detail.caseTotal) || 0"
@ -104,17 +103,15 @@
</div>
<div class="relative w-[30%] min-w-[150px]">
<div class="charts absolute w-full text-center">
<div class="text-[12px] !text-[var(--color-text-4)]">{{ t('report.detail.api.total') }}</div>
<div class="text-[12px] !text-[var(--color-text-4)]">{{ t('report.passRate') }}</div>
<a-popover position="bottom" content-class="response-popover-content">
<div class="flex justify-center text-[18px] font-medium">
<div class="one-line-text max-w-[80px] text-[var(--color-text-1)]">{{ functionCaseTotal }} </div>
<div class="one-line-text max-w-[80px] text-[var(--color-text-1)]">{{ functionCasePassRate }} </div>
</div>
<template #content>
<div class="min-w-[95px] max-w-[400px] p-4 text-[14px]">
<div class="text-[12px] font-medium text-[var(--color-text-4)]">{{
t('report.detail.api.total')
}}</div>
<div class="mt-2 text-[18px] font-medium text-[var(--color-text-1)]">{{ functionCaseTotal }}</div>
<div class="text-[12px] font-medium text-[var(--color-text-4)]">{{ t('report.passRate') }}</div>
<div class="mt-2 text-[18px] font-medium text-[var(--color-text-1)]">{{ functionCasePassRate }}</div>
</div>
</template>
</a-popover>
@ -273,8 +270,9 @@
series: {
name: '',
type: 'pie',
radius: ['65%', '80%'],
radius: ['62%', '80%'],
avoidLabelOverlap: false,
padAngle: 10,
label: {
show: false,
position: 'center',
@ -289,6 +287,18 @@
labelLine: {
show: false,
},
itemStyle: {
normal: {
borderWidth: 2,
borderColor: '#ffffff',
},
emphasis: {
borderWidth: 0,
shadowBlur: 0,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
data: [
{
value: 0,
@ -340,7 +350,7 @@
series: {
name: '',
type: 'pie',
radius: ['65%', '80%'],
radius: ['62%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
@ -356,6 +366,18 @@
labelLine: {
show: false,
},
itemStyle: {
normal: {
borderWidth: 2,
borderColor: '#ffffff',
},
emphasis: {
borderWidth: 0,
shadowBlur: 0,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
data: [
{
value: 0,
@ -389,12 +411,17 @@
};
}) as unknown as LegendData[];
functionCaseOptions.value.series.data = statusConfig.map((item: StatusListType) => {
const passRateData = statusConfig.filter((item) => ['success'].includes(item.value));
const { functionalCount } = detail.value;
const { success } = functionalCount;
const valueList = success ? statusConfig : passRateData;
functionCaseOptions.value.series.data = valueList.map((item: StatusListType) => {
return {
value: detail.value.functionalCount[item.value] || 0,
name: t(item.label),
itemStyle: {
color: item.color,
color: success ? item.color : '#D4D4D8',
},
};
});
@ -452,10 +479,11 @@
showButton.value = false;
}
const functionCaseTotal = computed(() => {
const functionCasePassRate = computed(() => {
const { functionalCount } = detail.value;
const { success, error, pending, block } = functionalCount;
return success + error + pending + block;
const successRate = (success / (success + error + pending + block)) * 100;
return `${Number.isNaN(successRate) ? 0 : successRate.toFixed(2)}%`;
});
const activeTab = ref('bug');
@ -508,11 +536,13 @@
@apply flex items-center;
}
.report-analysis-item-number {
font-size: 16px;
@apply font-medium;
}
.report-analysis-item-unit {
font-size: 12px;
color: var(--color-text-4);
@apply ml-1;
@apply ml-1 font-medium;
}
}
}

View File

@ -140,9 +140,10 @@
},
{
title: 'common.creator',
slotName: 'createUser',
dataIndex: 'createUser',
slotName: 'createUserName',
dataIndex: 'createUserName',
showInTable: true,
showTooltip: true,
width: 200,
ellipsis: true,
},

View File

@ -489,12 +489,12 @@
}
function getTotal(key: string) {
const { bugListCount, historyCount } = caseDetail.value;
const { bugListCount, runListCount } = caseDetail.value;
switch (key) {
case 'defectList':
return bugListCount > 99 ? `99+` : `${bugListCount}`;
return bugListCount > 99 ? `99+` : `${bugListCount || 0}`;
case 'executionHistory':
return historyCount > 99 ? `99+` : `${historyCount}`;
return runListCount > 99 ? `99+` : `${runListCount || 0}`;
default:
return '';
}
@ -554,9 +554,6 @@
moduleIds,
};
}
// if (activeTab.value === 'detail') {
// getBugTotal();
// }
getPlanDetail();
initBugList();
await loadCase();