fix(接口管理):修复接口管理定义显示问题

--bug=1037871 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037871
--bug=1037475 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037475
--bug=1037517 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037517
This commit is contained in:
guoyuqi 2024-04-02 19:35:25 +08:00 committed by 刘瑞斌
parent 049164c743
commit 71b5d7f484
5 changed files with 27 additions and 11 deletions

View File

@ -288,7 +288,7 @@
@change="() => handleExpressionChange(rowIndex)" @change="() => handleExpressionChange(rowIndex)"
> >
<template #suffix> <template #suffix>
<a-tooltip :disabled="!disabledExpressionSuffix"> <a-tooltip :disabled="disabledExpressionSuffix || props.disabled">
<template #content> <template #content>
<div>{{ t('apiTestDebug.expressionTip1') }}</div> <div>{{ t('apiTestDebug.expressionTip1') }}</div>
<div>{{ t('apiTestDebug.expressionTip2') }}</div> <div>{{ t('apiTestDebug.expressionTip2') }}</div>
@ -297,11 +297,10 @@
<MsIcon <MsIcon
type="icon-icon_flashlamp" type="icon-icon_flashlamp"
:size="15" :size="15"
:disabled="props.disabled"
:class=" :class="
disabledExpressionSuffix || props.disabled disabledExpressionSuffix || props.disabled
? 'ms-params-input-suffix-icon--disabled' ? 'ms-params-input-suffix-icon'
: 'ms-params-input-suffix-icon' : 'ms-params-input-suffix-icon--disabled'
" "
@click.stop="() => showFastExtraction(record, RequestExtractExpressionEnum.REGEX)" @click.stop="() => showFastExtraction(record, RequestExtractExpressionEnum.REGEX)"
/> />
@ -774,7 +773,7 @@
function deleteListItem(id: string | number) {} function deleteListItem(id: string | number) {}
function showFastExtraction(record: ExpressionConfig, type: ExpressionType) { function showFastExtraction(record: ExpressionConfig, type: ExpressionType) {
if (props.disabled) return; if (!props.disabled) return;
activeRecord.value = { ...record, extractType: type }; activeRecord.value = { ...record, extractType: type };
fastExtractionVisible.value = true; fastExtractionVisible.value = true;
} }

View File

@ -48,7 +48,7 @@
" "
allow-clear allow-clear
class="hover:z-10" class="hover:z-10"
:style="isUrlError ? 'border: 1px solid rgb(var(--danger-6);z-index: 10' : ''" :style="isUrlError ? 'border: 1px solid rgb(var(--danger-6));z-index: 10' : ''"
@input="() => (isUrlError = false)" @input="() => (isUrlError = false)"
@change="handleUrlChange" @change="handleUrlChange"
/> />
@ -151,6 +151,9 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="isUrlError" class="url-input-tip">
<span>{{ t('apiTestDebug.apiUrlRequired') }}</span>
</div>
<div class="px-[16px]"> <div class="px-[16px]">
<MsTab <MsTab
v-model:active-key="requestVModel.activeTab" v-model:active-key="requestVModel.activeTab"
@ -1654,4 +1657,16 @@
@apply block; @apply block;
} }
} }
.url-input-tip {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: nowrap;
justify-content: flex-start;
margin-left: 250px;
color: rgb(var(--danger-6));
font-size: 12px;
line-height: 16px;
margin-top: 2px;
}
</style> </style>

View File

@ -188,6 +188,7 @@ export default {
'apiTestDebug.requestNamePlaceholder': 'Please enter a request name', 'apiTestDebug.requestNamePlaceholder': 'Please enter a request name',
'apiTestDebug.requestUrl': 'Request URL', 'apiTestDebug.requestUrl': 'Request URL',
'apiTestDebug.requestUrlRequired': 'Request URL cannot be empty', 'apiTestDebug.requestUrlRequired': 'Request URL cannot be empty',
'apiTestDebug.apiUrlRequired': 'URL cannot be empty',
'apiTestDebug.requestModule': 'Belonging module', 'apiTestDebug.requestModule': 'Belonging module',
'apiTestDebug.closeOther': 'Close other', 'apiTestDebug.closeOther': 'Close other',
'apiTestDebug.importByCURL': 'Import cURL', 'apiTestDebug.importByCURL': 'Import cURL',

View File

@ -177,6 +177,7 @@ export default {
'apiTestDebug.requestNamePlaceholder': '请输入请求名称', 'apiTestDebug.requestNamePlaceholder': '请输入请求名称',
'apiTestDebug.requestUrl': '请求 URL', 'apiTestDebug.requestUrl': '请求 URL',
'apiTestDebug.requestUrlRequired': '请求 URL不能为空', 'apiTestDebug.requestUrlRequired': '请求 URL不能为空',
'apiTestDebug.apiUrlRequired': 'URL 不能为空',
'apiTestDebug.requestModule': '请求所属模块', 'apiTestDebug.requestModule': '请求所属模块',
'apiTestDebug.closeOther': '关闭其他请求', 'apiTestDebug.closeOther': '关闭其他请求',
'apiTestDebug.importByCURL': '导入 cURL', 'apiTestDebug.importByCURL': '导入 cURL',

View File

@ -1,6 +1,6 @@
<template> <template>
<a-collapse v-model:active-key="activeDetailKey" :bordered="false"> <a-collapse v-model:active-key="activeDetailKey" :bordered="false">
<a-collapse-item key="request"> <a-collapse-item v-if="previewDetail.body.bodyType !== RequestBodyFormat.NONE" key="request">
<template #header> <template #header>
<div class="flex items-center gap-[4px]"> <div class="flex items-center gap-[4px]">
<div v-if="activeDetailKey.includes('request')" class="down-icon"> <div v-if="activeDetailKey.includes('request')" class="down-icon">
@ -146,14 +146,14 @@
<a-radio value="code">Code</a-radio> <a-radio value="code">Code</a-radio>
</a-radio-group> --> </a-radio-group> -->
</div> </div>
<div <!-- <div
v-if="previewDetail.body.bodyType === RequestBodyFormat.NONE" v-if="previewDetail.body.bodyType === RequestBodyFormat.NONE"
class="flex h-[100px] items-center justify-center rounded-[var(--border-radius-small)] bg-[var(--color-text-n9)] text-[var(--color-text-4)]" class="flex h-[100px] items-center justify-center rounded-[var(&#45;&#45;border-radius-small)] bg-[var(&#45;&#45;color-text-n9)] text-[var(&#45;&#45;color-text-4)]"
> >
{{ t('apiTestDebug.noneBody') }} {{ t('apiTestDebug.noneBody') }}
</div> </div>-->
<MsFormTable <MsFormTable
v-else-if=" v-if="
previewDetail.body.bodyType === RequestBodyFormat.FORM_DATA || previewDetail.body.bodyType === RequestBodyFormat.FORM_DATA ||
previewDetail.body.bodyType === RequestBodyFormat.WWW_FORM || previewDetail.body.bodyType === RequestBodyFormat.WWW_FORM ||
previewDetail.body.bodyType === RequestBodyFormat.BINARY previewDetail.body.bodyType === RequestBodyFormat.BINARY