fix(接口测试): 响应表格样式修复&

This commit is contained in:
baiqi 2024-08-12 19:11:11 +08:00 committed by Craftsman
parent 42b0850ed0
commit 6444e3f9da
5 changed files with 25 additions and 10 deletions

View File

@ -174,13 +174,13 @@
@change="() => handleFormChange(record, rowIndex, item)"
>
</MsQuickInput>
<template v-else-if="item.inputType === 'text'">
<div v-else-if="item.inputType === 'text'" class="pl-[8px]">
{{
typeof item.valueFormat === 'function'
? item.valueFormat(record)
: record[item.dataIndex as string] || '-'
}}
</template>
</div>
<template v-else-if="item.dataIndex === 'action'">
<div
:key="item.dataIndex"

View File

@ -174,7 +174,7 @@
/>
<a-tooltip
v-else
position="top"
position="tl"
content-class="max-w-[400px]"
:content="String(record[item.dataIndex as string])"
:disabled="record[item.dataIndex as string] === '' || record[item.dataIndex as string] === undefined || record[item.dataIndex as string] === null"

View File

@ -20,11 +20,13 @@
</a-tooltip>
</template>
<template #condition="{ record }">
{{
record.assertionType === FullResponseAssertionType.RESPONSE_TIME
? t('advanceFilter.operator.le')
: t(statusCodeOptions.find((item) => item.value === record.condition)?.label || '-')
}}
<div class="pl-[8px]">
{{
record.assertionType === FullResponseAssertionType.RESPONSE_TIME
? t('advanceFilter.operator.le')
: t(statusCodeOptions.find((item) => item.value === record.condition)?.label || '-')
}}
</div>
</template>
<template #status="{ record }">
<MsTag :type="record.pass === true ? 'success' : 'danger'" theme="light">
@ -69,7 +71,9 @@
{
title: 'apiTestDebug.actualValue',
dataIndex: 'actualValue',
slotName: 'actualValue',
showTooltip: true,
inputType: 'text',
width: 200,
},
{
@ -81,7 +85,9 @@
{
title: 'apiTestDebug.expectedValue',
dataIndex: 'expectedValue',
slotName: 'expectedValue',
showTooltip: true,
inputType: 'text',
width: 200,
},
{
@ -93,7 +99,9 @@
{
title: 'apiTestDebug.reason',
dataIndex: 'message',
slotName: 'message',
showTooltip: true,
inputType: 'text',
width: 300,
},
];

View File

@ -7,7 +7,7 @@
:scroll="props.scroll"
>
<template #type="{ record }">
{{ t(extractTypeOptions.find((item) => item.value === record.type)?.label || '') }}
<div class="pl-[8px]">{{ t(extractTypeOptions.find((item) => item.value === record.type)?.label || '') }}</div>
</template>
</MsFormTable>
</a-scrollbar>
@ -38,25 +38,32 @@
{
title: 'apiTestDebug.paramName',
dataIndex: 'name',
slotName: 'name',
showTooltip: true,
inputType: 'text',
width: 200,
},
{
title: 'apiTestDebug.extractValue',
dataIndex: 'value',
slotName: 'value',
showTooltip: true,
inputType: 'text',
width: 200,
},
{
title: 'apiTestDebug.paramType',
dataIndex: 'type',
slotName: 'type',
inputType: 'text',
width: 120,
},
{
title: 'apiTestDebug.expression',
dataIndex: 'expression',
slotName: 'expression',
showTooltip: true,
inputType: 'text',
width: 200,
},
];

View File

@ -247,7 +247,7 @@ export function filterAssertions(assertionConfig: ExecuteAssertionConfig, isExec
return assertionConfig.assertions.map((assertItem: any) => {
const lastItem =
assertItem?.jsonPathAssertion?.assertions[(assertItem?.jsonPathAssertion?.assertions.length || 1) - 1];
if (lastItem.expression === '' && lastItem.expectedValue === '' && lastItem.enable === true) {
if (lastItem && lastItem.expression === '' && lastItem.expectedValue === '' && lastItem.enable === true) {
// 最后一行是空行,将其删除
assertItem.jsonPathAssertion.assertions.splice(-1, 1);
}