From fa853e230fc75bccb93854abc24603a6f5965308 Mon Sep 17 00:00:00 2001 From: baiqi Date: Fri, 23 Feb 2024 18:59:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95):=20?= =?UTF-8?q?=2099%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ms-add-attachment/index.vue | 16 +- .../ms-assertion/comp/ResponseBodyTab.vue | 22 +-- frontend/src/models/apiTest/debug.ts | 8 +- .../api-test/components/batchAddKeyVal.vue | 4 +- .../api-test/components/condition/content.vue | 52 +++--- .../api-test/components/condition/index.vue | 8 +- .../views/api-test/components/paramTable.vue | 149 +++++++----------- .../components/requestComposition/body.vue | 13 +- .../components/requestComposition/index.vue | 3 +- .../components/requestComposition/setting.vue | 8 +- 10 files changed, 143 insertions(+), 140 deletions(-) diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index 3f554b7bbe..467e6c459e 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -152,7 +152,7 @@ inputSize?: 'small' | 'medium' | 'large' | 'mini'; tagSize?: Size; fields?: { - id: string; + id: string; // 自定义文件的 id 字段名,用于详情展示,接口返回的字段名 name: string; }; }>(), @@ -193,11 +193,11 @@ inputFiles.value = defaultFiles.map((item) => ({ ...item, // 这里取自定义的字段名,因为存在查看的场景时不会与刚选择的文件信息一样 - value: item?.[props.fields.id] || '', - label: item?.[props.fields.name] || '', + value: item?.[props.fields.id] || item.uid || '', // 取uid是因为有可能是本地上传然后组件卸载然后重新挂载,这时候取自定义 id 会是空的 + label: item?.[props.fields.name] || item?.name || '', })); } else { - inputFileName.value = defaultFiles[0]?.[props.fields.name] || ''; + inputFileName.value = defaultFiles[0]?.[props.fields.name] || defaultFiles[0]?.name || ''; } getListFunParams.value.combine.hiddenIds = defaultFiles .filter((item) => !item?.local) @@ -214,6 +214,7 @@ innerFileList.value = _fileList.map((item) => ({ ...item, local: true })); if (props.multiple) { inputFiles.value = _fileList.map((item) => ({ + ...item, value: item?.uid || '', label: item?.name || '', })); @@ -252,6 +253,7 @@ innerFileList.value.push(...fileResultList); inputFiles.value.push( ...fileResultList.map((item) => ({ + ...item, value: item?.uid || '', label: item?.name || '', })) @@ -278,8 +280,10 @@ function handleClose(data: TagData) { inputFiles.value = inputFiles.value.filter((item) => item.value !== data.value); - innerFileList.value = innerFileList.value.filter((item) => item[props.fields.id] !== data.value); - if (innerFileList.value.length === 0) { + innerFileList.value = innerFileList.value.filter( + (item) => (item[props.fields.id] || item.uid) !== (data[props.fields.id] || data.value) + ); + if (inputFiles.value.length === 0) { inputFilesPopoverVisible.value = false; } emit('deleteFile', data.value); diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue index 8f3d2245e1..22fc16b208 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue @@ -17,7 +17,7 @@ @change="handleChange" @more-action-select="(e,r)=> handleExtractParamMoreActionSelect(e,r as ExpressionConfig)" > -