fix(接口测试): 断言条件选择不校验时禁止输入期望值
--bug=1037622 --user=王孝刚 【接口测试】接口断言-状态码,条件选择不校验时应该禁止输入期望值 https://www.tapd.cn/55049933/s/1480572
This commit is contained in:
parent
4e8eec98ad
commit
30f47a7f5b
|
@ -2,16 +2,7 @@
|
||||||
<div class="flex h-[62px] flex-row items-end gap-[8px] text-[var(--color-text-1)]">
|
<div class="flex h-[62px] flex-row items-end gap-[8px] text-[var(--color-text-1)]">
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-[8px]">{{ t('ms.assertion.statusCode') }}</div>
|
<div class="mb-[8px]">{{ t('ms.assertion.statusCode') }}</div>
|
||||||
<a-select
|
<a-select v-model="condition.condition" :disabled="props.disabled" class="w-[157px]" @change="clearExpectedValue">
|
||||||
v-model="condition.condition"
|
|
||||||
:disabled="props.disabled"
|
|
||||||
class="w-[157px]"
|
|
||||||
@change="
|
|
||||||
emit('change', {
|
|
||||||
...condition,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<a-option v-for="item in statusCodeOptions" :key="item.value" :value="item.value">
|
<a-option v-for="item in statusCodeOptions" :key="item.value" :value="item.value">
|
||||||
{{ t(item.label) }}
|
{{ t(item.label) }}
|
||||||
</a-option>
|
</a-option>
|
||||||
|
@ -20,7 +11,12 @@
|
||||||
<a-input
|
<a-input
|
||||||
v-if="showInput"
|
v-if="showInput"
|
||||||
v-model="condition.expectedValue"
|
v-model="condition.expectedValue"
|
||||||
:disabled="props.disabled"
|
:disabled="
|
||||||
|
props.disabled ||
|
||||||
|
condition.condition === 'UNCHECK' ||
|
||||||
|
condition.condition === 'NOT_EMPTY' ||
|
||||||
|
condition.condition === 'EMPTY'
|
||||||
|
"
|
||||||
hide-button
|
hide-button
|
||||||
class="w-[157px]"
|
class="w-[157px]"
|
||||||
@change="
|
@change="
|
||||||
|
@ -59,6 +55,18 @@
|
||||||
}>();
|
}>();
|
||||||
const condition = useVModel(props, 'data', emit);
|
const condition = useVModel(props, 'data', emit);
|
||||||
const showInput = computed(() => condition.value.condition !== 'none' && condition.value.condition !== '');
|
const showInput = computed(() => condition.value.condition !== 'none' && condition.value.condition !== '');
|
||||||
|
function clearExpectedValue() {
|
||||||
|
if (
|
||||||
|
condition.value.condition === 'UNCHECK' ||
|
||||||
|
condition.value.condition === 'NOT_EMPTY' ||
|
||||||
|
condition.value.condition === 'EMPTY'
|
||||||
|
) {
|
||||||
|
condition.value.expectedValue = '';
|
||||||
|
}
|
||||||
|
emit('change', {
|
||||||
|
...condition.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -21,7 +21,6 @@ const EMPTY = { label: 'advanceFilter.operator.empty', value: 'EMPTY' };
|
||||||
const NOT_EMPTY = { label: 'advanceFilter.operator.not_empty', value: 'NOT_EMPTY' };
|
const NOT_EMPTY = { label: 'advanceFilter.operator.not_empty', value: 'NOT_EMPTY' };
|
||||||
const REGEX = { label: 'advanceFilter.operator.regexp', value: 'REGEX' };
|
const REGEX = { label: 'advanceFilter.operator.regexp', value: 'REGEX' };
|
||||||
const LENGTH_EQUAL = { label: 'advanceFilter.operator.length.equal', value: 'LENGTH_EQUALS' };
|
const LENGTH_EQUAL = { label: 'advanceFilter.operator.length.equal', value: 'LENGTH_EQUALS' };
|
||||||
const LENGTH_NOT_EQUAL = { label: 'advanceFilter.operator.length.not_equal', value: 'LENGTH_NOT_EQUALS' };
|
|
||||||
const LENGTH_GT = { label: 'advanceFilter.operator.length.gt', value: 'LENGTH_GT' };
|
const LENGTH_GT = { label: 'advanceFilter.operator.length.gt', value: 'LENGTH_GT' };
|
||||||
const LENGTH_GE = { label: 'advanceFilter.operator.length.ge', value: 'LENGTH_GT_OR_EQUALS' };
|
const LENGTH_GE = { label: 'advanceFilter.operator.length.ge', value: 'LENGTH_GT_OR_EQUALS' };
|
||||||
const LENGTH_LT = { label: 'advanceFilter.operator.length.lt', value: 'LENGTH_LT' };
|
const LENGTH_LT = { label: 'advanceFilter.operator.length.lt', value: 'LENGTH_LT' };
|
||||||
|
|
Loading…
Reference in New Issue