diff --git a/api-test/frontend/src/business/definition/components/body/ApiBody.vue b/api-test/frontend/src/business/definition/components/body/ApiBody.vue
index 804c059691..967b765227 100644
--- a/api-test/frontend/src/business/definition/components/body/ApiBody.vue
+++ b/api-test/frontend/src/business/definition/components/body/ApiBody.vue
@@ -107,7 +107,7 @@ import BatchAddParameter from '../basis/BatchAddParameter';
import Convert from '@/business/commons/json-schema/convert/convert';
import { getApiParamsConfigFields } from 'metersphere-frontend/src/utils/custom_field';
import ApiParamsConfig from '@/business/definition/components/request/components/ApiParamsConfig';
-import { parse } from 'lossless-json'
+import { parse } from 'lossless-json';
import CustomNum from '../../../commons/json-schema/convert/customNum';
export default {
@@ -177,18 +177,8 @@ export default {
// 展开动画大概是 300ms 左右,使视觉效果更流畅
if (this.body.format === 'JSON-SCHEMA') {
this.$refs.jsonCodeEdit?.$el.querySelector('.ace_text-input')?.focus();
- this.$refs.jsonCodeEdit?.$parent?.$parent?.$parent?.$parent?.$parent.$el.scrollIntoView({
- behavior: 'smooth',
- block: 'start',
- inline: 'center',
- });
} else if (this.codeEditActive) {
this.$refs.codeEdit?.$el.querySelector('.ace_text-input')?.focus();
- this.$refs.codeEdit?.$parent?.$parent?.$parent?.$parent?.$parent?.$el.scrollIntoView({
- behavior: 'smooth',
- block: 'start',
- inline: 'center',
- });
}
}, 300);
},
@@ -287,8 +277,8 @@ export default {
if (this.body.format === 'JSON-SCHEMA') {
if (this.body.raw) {
try {
- const jsonObj = parse(this.body.raw)
- this.body.jsonSchema = MsConvert.format(jsonObj);
+ const jsonObj = parse(this.body.raw);
+ this.body.jsonSchema = MsConvert.format(jsonObj);
} catch (e) {
this.body.format = 'JSON';
this.$message.error(this.$t('api_definition.body.json_format_error'));
diff --git a/api-test/frontend/src/business/definition/components/response/ResponseResult.vue b/api-test/frontend/src/business/definition/components/response/ResponseResult.vue
index 1dda201546..c37b6571bc 100644
--- a/api-test/frontend/src/business/definition/components/response/ResponseResult.vue
+++ b/api-test/frontend/src/business/definition/components/response/ResponseResult.vue
@@ -2,8 +2,9 @@
-
+
+ ref="codeEdit" />
-
+
-
@@ -26,7 +26,7 @@
:read-only="true"
:data.sync="responseResult.headers"
ref="codeEdit"
- v-if="activeName === 'headers'"/>
+ v-if="activeName === 'headers'" />
@@ -36,7 +36,7 @@
:data.sync="responseResult.console"
ref="codeEdit"
v-if="activeName === 'console'"
- height="calc(100vh - 300px)"/>
+ height="calc(100vh - 300px)" />
@@ -45,11 +45,11 @@
:read-only="true"
:data.sync="responseResult.console"
ref="codeEdit"
- v-if="activeName === 'console'"/>
+ v-if="activeName === 'console'" />
-
+
@@ -58,7 +58,7 @@
:read-only="true"
:data.sync="responseResult.vars"
v-if="activeName === 'label'"
- ref="codeEdit"/>
+ ref="codeEdit" />
@@ -67,7 +67,7 @@
:read-only="true"
:data.sync="reqMessages"
v-if="activeName === 'request_body'"
- ref="codeEdit"/>
+ ref="codeEdit" />
@@ -76,8 +76,8 @@
v-if="currentProtocol === 'SQL'"
:commands="sqlModes"
:default-command="mode"
- @command="sqlModeChange"/>
-
+ @command="sqlModeChange" />
+
@@ -88,9 +88,9 @@
import MsAssertionResults from './AssertionResults';
import MsCodeEdit from '../MsCodeEdit';
import MsDropdown from '../../../../business/commons/MsDropdown';
-import {BODY_FORMAT} from '../../model/ApiTestModel';
+import { BODY_FORMAT } from '../../model/ApiTestModel';
import MsSqlResultTable from './SqlResultTable';
-import {downloadByURL} from "fit2cloud-ui/src/tools/utils";
+import { downloadByURL } from 'fit2cloud-ui/src/tools/utils';
export default {
name: 'MsResponseResult',
@@ -122,7 +122,16 @@ export default {
mode: BODY_FORMAT.TEXT,
isMsCodeEditShow: true,
reqMessages: '',
- contentType: ['image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/webp', 'image/svg+xml', 'image/apng', 'image/avif'],
+ contentType: [
+ 'image/png',
+ 'image/jpeg',
+ 'image/gif',
+ 'image/bmp',
+ 'image/webp',
+ 'image/svg+xml',
+ 'image/apng',
+ 'image/avif',
+ ],
srcUrl: '',
};
},
@@ -137,11 +146,6 @@ export default {
setTimeout(() => {
// 展开动画大概是 300ms 左右,使视觉效果更流畅
this.$refs.codeEdit?.$el.querySelector('.ace_text-input')?.focus();
- this.$refs.codeEdit?.$parent?.$parent?.$parent?.$parent?.$parent?.$el.scrollIntoView({
- behavior: 'smooth',
- block: 'center',
- inline: 'center',
- });
}, 300);
},
immediate: true,
@@ -156,7 +160,7 @@ export default {
},
showPicture() {
if (this.responseResult.contentType && this.contentType.includes(this.responseResult.contentType)) {
- this.modes.push('picture')
+ this.modes.push('picture');
this.srcUrl = 'data:' + this.responseResult.contentType + ';base64,' + this.responseResult.imageUrl;
}
},
@@ -239,7 +243,11 @@ export default {
return this.response && this.response.responseResult ? this.response.responseResult : {};
},
isPicture() {
- return this.responseResult.contentType && this.contentType.includes(this.responseResult.contentType) && this.mode === 'picture';
+ return (
+ this.responseResult.contentType &&
+ this.contentType.includes(this.responseResult.contentType) &&
+ this.mode === 'picture'
+ );
},
},
};
diff --git a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue
index 9c89b54a0a..f0c6258ac2 100644
--- a/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue
+++ b/framework/sdk-parent/frontend/src/components/environment/assertion/ApiJsonpathSuggest.vue
@@ -83,7 +83,7 @@ export default {
this.data = {};
try {
let stringedJSON = objStr.replace(
- /(?<=[:\[,])\s*(-?\d+(\.\d+)?)(?=\s*([,\]}]))/g,
+ /(?:[:\[,])\s*(-?\d+(\.\d+)?)(?=\s*([,\]}]))/g,
'"$1"'
);
let param;
diff --git a/performance-test/frontend/src/business/report/components/samples/compnent/ResponseResult.vue b/performance-test/frontend/src/business/report/components/samples/compnent/ResponseResult.vue
index 3bb4d12d4e..47507aa36d 100644
--- a/performance-test/frontend/src/business/report/components/samples/compnent/ResponseResult.vue
+++ b/performance-test/frontend/src/business/report/components/samples/compnent/ResponseResult.vue
@@ -1,67 +1,114 @@
-
-
+
+
+ v-if="!isSqlType && isMsCodeEditShow && activeName === 'body'"
+ :mode="mode"
+ :read-only="true"
+ :modes="modes"
+ :data.sync="responseResult.body"
+ height="250px"
+ ref="codeEdit"
+ />
-
+
+ :mode="'text'"
+ :read-only="true"
+ :data.sync="responseResult.headers"
+ ref="codeEdit"
+ v-if="activeName === 'headers'"
+ />
-
+
+ :mode="'text'"
+ :read-only="true"
+ :data.sync="responseResult.console"
+ ref="codeEdit"
+ v-if="activeName === 'console'"
+ />
-
-
+
+
-
+
+ :mode="'text'"
+ :read-only="true"
+ :data.sync="responseResult.vars"
+ v-if="activeName === 'label'"
+ ref="codeEdit"
+ />
-
+
+ :mode="'text'"
+ :read-only="true"
+ :data.sync="reqMessages"
+ v-if="activeName === 'request_body'"
+ ref="codeEdit"
+ />
-
+
-
+ v-if="currentProtocol === 'SQL'"
+ :commands="sqlModes"
+ :default-command="mode"
+ @command="sqlModeChange"
+ />
+
@@ -69,13 +116,13 @@