+
@@ -14,7 +14,7 @@
:columns="jsonPathColumns"
:scroll="{ minWidth: '700px' }"
:default-param-item="jsonPathDefaultParamItem"
- @change="handleJsonPathChange"
+ @change="handleChange"
@more-action-select="(e,r)=> handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"
>
@@ -86,7 +86,7 @@
{{ t('ms.assertion.responseContentType') }}
@@ -95,12 +95,11 @@
handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"
>
@@ -168,15 +167,130 @@
+
+
handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
handleExtractParamMoreActionSelect(e,r as ExpressionConfig)"
+ >
+
+
+
+
+ {{ t('apiTestDebug.expression') }}
+
+
+ {{ record.expression }}
+
+
+
+
+
+
+ {{ t('apiTestDebug.expressionTip1') }}
+ {{ t('apiTestDebug.expressionTip2') }}
+ {{ t('apiTestDebug.expressionTip3') }}
+
+ showFastExtraction(record, RequestExtractExpressionEnum.JSON_PATH)"
+ />
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('common.cancel') }}
+
+
applyMoreSetting(record)">
+ {{ t('common.confirm') }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/business/ms-assertion/locale/zh-CN.ts b/frontend/src/components/business/ms-assertion/locale/zh-CN.ts
index d494efe46d..f90a710ea3 100644
--- a/frontend/src/components/business/ms-assertion/locale/zh-CN.ts
+++ b/frontend/src/components/business/ms-assertion/locale/zh-CN.ts
@@ -16,4 +16,9 @@ export default {
'ms.assertion.script': '脚本',
'ms.assertion.expression': '表达式',
'ms.assertion.responseContentType': '响应内容类型',
+ 'ms.assertion.paramsName': '参数名',
+ 'ms.assertion.mustInclude': '必含',
+ 'ms.assertion.typeChecking': '类型校验',
+ 'ms.assertion.addChild': '添加子字段',
+ 'ms.assertion.validateChild': '添加子校验',
};
diff --git a/frontend/src/models/bug-management.ts b/frontend/src/models/bug-management.ts
index 722d50caa6..6742d1a7b5 100644
--- a/frontend/src/models/bug-management.ts
+++ b/frontend/src/models/bug-management.ts
@@ -63,6 +63,11 @@ export interface CreateOrUpdateComment {
content: string;
event: string; // 任务事件(仅评论: ’COMMENT‘; 评论并@: ’AT‘; 回复评论/回复并@: ’REPLAY‘;)
}
+export interface CustomFieldItemOptionItem {
+ fieldId: string;
+ value: string;
+ text: string;
+}
export interface CustomFieldItem {
fieldId: string;
fieldName: string;
@@ -71,7 +76,7 @@ export interface CustomFieldItem {
apiFieldId: string;
defaultValue: string;
type: string;
- options: string;
+ options: CustomFieldItemOptionItem[];
platformOptionJson: string;
supportSearch: boolean;
optionMethod: string;
diff --git a/frontend/src/models/projectManagement/environmental.ts b/frontend/src/models/projectManagement/environmental.ts
index 326878c37e..82f87a5f9e 100644
--- a/frontend/src/models/projectManagement/environmental.ts
+++ b/frontend/src/models/projectManagement/environmental.ts
@@ -36,7 +36,7 @@ export interface EnvConfig {
commmonVariables?: EnvConfigItem[];
httpConfig?: EnvConfigItem[];
dataSource?: DataSourceItem[];
- hostConfig?: EnvConfigItem;
+ hostConfig?: EnvConfigItem[];
authConfig?: EnvConfigItem;
preScript?: EnvConfigItem[];
postScript?: EnvConfigItem[];
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index 8ba03eb68e..8b4ed31986 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -2,9 +2,10 @@ import JSEncrypt from 'jsencrypt';
import { BatchActionQueryParams, MsTableColumnData } from '@/components/pure/ms-table/type';
-import { CustomFieldItem } from '@/models/bug-management';
+import { BugEditCustomField, CustomFieldItem } from '@/models/bug-management';
import { isObject } from './is';
+import { json } from 'stream/consumers';
type TargetContext = '_self' | '_parent' | '_blank' | '_top';
@@ -574,10 +575,31 @@ export function parseQueryParams(url: string): QueryParam[] {
/**
* 将表格数据里的自定义字段转换为表格数据二维变一维
*/
-export function customFieldDataToTableData(customFieldData: Record
[]) {
+export function customFieldDataToTableData(customFieldData: Record[], customFields: BugEditCustomField[]) {
+ if (!customFieldData || !customFields) return {};
const tableData: Record = {};
customFieldData.forEach((field) => {
- tableData[field.id] = field.value;
+ const customField = customFields.find((item) => item.fieldId === field.id);
+ if (!customField) return;
+ if (customField.platformOptionJson) {
+ // 对jira模板字段做特殊处理
+ field.options = JSON.parse(customField.platformOptionJson);
+ } else if (customField.options && customField.options.length > 0) {
+ field.options = customField.options;
+ }
+ // 后端返回来的数据这个字段没值
+ field.type = customField.type;
+ if (['SELECT', 'RADIO'].includes(field.type) && Array.isArray(field.options)) {
+ tableData[field.id] = field.options.find((option) => option.value === field.value)?.text;
+ } else if (['MUTIPLE_SELECT', 'CHECKBOX'].includes(field.type) && Array.isArray(field.options)) {
+ // 多值的类型后端返回的是json字符串
+ field.value = JSON.parse(field.value);
+ tableData[field.id] = field.value
+ .map((val: string) => field.options.find((option: { value: string }) => option.value === val)?.text)
+ .join(',');
+ } else {
+ tableData[field.id] = field.value;
+ }
});
return tableData;
}
diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue
index 042cd6c566..f9c188e6a4 100644
--- a/frontend/src/views/api-test/components/paramTable.vue
+++ b/frontend/src/views/api-test/components/paramTable.vue
@@ -27,6 +27,26 @@