refactor(接口测试): 单接口执行页面优化

This commit is contained in:
chenjianxing 2020-08-26 10:48:00 +08:00
parent 5424f9b505
commit 3882914c6b
8 changed files with 10 additions and 5 deletions

View File

@ -29,7 +29,8 @@
"mockjs": "^1.1.0",
"md5": "^2.3.0",
"sha.js": "^2.4.11",
"js-base64": "^3.4.4"
"js-base64": "^3.4.4",
"json-bigint": "^1.0.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",

View File

@ -11,7 +11,7 @@
</el-select>
</el-form-item>
<el-button :disabled="!request.enable || !scenario.enable || isReadOnly" class="debug-button" size="small" type="primary" @click="runDebug">{{$t('load_test.save_and_run')}}</el-button>
<el-button :disabled="!request.enable || !scenario.enable || isReadOnly" class="debug-button" size="small" type="primary" @click="runDebug">{{$t('api_test.request.debug')}}</el-button>
<el-tabs v-model="activeName">
<el-tab-pane label="Interface" name="interface">

View File

@ -40,7 +40,7 @@
</el-switch>
</el-form-item>
<el-button :disabled="!request.enable || !scenario.enable || isReadOnly" class="debug-button" size="small" type="primary" @click="runDebug">{{ $t('load_test.save_and_run') }}</el-button>
<el-button :disabled="!request.enable || !scenario.enable || isReadOnly" class="debug-button" size="small" type="primary" @click="runDebug">{{ $t('api_test.request.debug') }}</el-button>
<el-tabs v-model="activeName">
<el-tab-pane :label="$t('api_test.request.parameters')" name="parameters">

View File

@ -1,6 +1,7 @@
<template>
<div class="request-form">
<component @runDebug="runDebug" :is="component" :is-read-only="isReadOnly" :request="request" :scenario="scenario"/>
<el-divider v-if="isCompleted"></el-divider>
<ms-request-result-tail v-loading="debugReportLoading" v-if="isCompleted" :request="request.debugRequestResult ? request.debugRequestResult : {responseResult: {}, subRequestResults: []}"
:scenario-name="request.debugScenario ? request.debugScenario.name : ''" ref="msDebugResult"/>
</div>

View File

@ -72,8 +72,8 @@
format() {
if (this.mode === 'json') {
try {
var JSONbigString = require('json-bigint')({"storeAsString": true});
this.formatData = JSON.stringify(JSONbigString.parse(this.data), null, '\t');
var JSONbig = require('json-bigint')({"storeAsString": false});
this.formatData = JSON.stringify(JSONbig.parse(this.data), null, '\t');
} catch (e) {
if (this.data) {
this.formatData = this.data;

View File

@ -406,6 +406,7 @@ export default {
enable: "Enable"
},
request: {
debug: "Debug",
copy: "Copy request",
delete: "Delete request",
input_name: "Please enter the request name",

View File

@ -406,6 +406,7 @@ export default {
enable: "启用"
},
request: {
debug: "调试",
copy: "复制请求",
delete: "删除请求",
input_name: "请输入请求名称",

View File

@ -405,6 +405,7 @@ export default {
enable: "啟用"
},
request: {
debug: "調試",
copy: "複製請求",
delete: "删除請求",
input_name: "請輸入請求名稱",