From afd9c7c97b2c097eaad4799a826325b4074b6a61 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Sat, 29 Jan 2022 15:16:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9E=E4=BC=81=E4=B8=9A=E7=89=88=E5=9C=A8?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E8=AE=BE=E7=BD=AE=E4=B8=AD=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=80=E5=90=AF=E8=AF=AF=E6=8A=A5=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复非企业版在环境设置中会显示开启误报按钮的错误 --- .../components/assertion/GlobalAssertions.vue | 95 ++++++++++--------- .../environment/EnvironmentEdit.vue | 14 ++- .../detail/component/ApiCaseFailureResult.vue | 1 + .../component/ApiScenarioFailureResult.vue | 2 +- 4 files changed, 61 insertions(+), 51 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue b/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue index 82f20e056d..3a9d01e4cd 100644 --- a/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue +++ b/frontend/src/business/components/api/definition/components/assertion/GlobalAssertions.vue @@ -16,48 +16,48 @@ {{ $t('api_test.request.assertions.add') }} @@ -67,22 +67,23 @@ + v-if="isShowJsonPathSuggest" + :open-tip="$t('api_test.request.assertions.json_path_suggest')" + :clear-tip="$t('api_test.request.assertions.json_path_clear')" + @open="suggestJsonOpen" + @clear="clearJson"/> + :is-read-only="isReadOnly" + :assertions="assertions" + :apiId="apiId" + :reloadData="reloadData" + style="margin-bottom: 20px"/> + :tip="$t('api_test.request.extract.suggest_tip')" + @addSuggest="addJsonPathSuggest" + ref="jsonpathSuggest"/> @@ -144,6 +145,10 @@ export default { isReadOnly: { type: Boolean, default: false + }, + isShowJsonPathSuggest: { + type: Boolean, + default: true } }, data() { @@ -197,9 +202,9 @@ export default { let expect = jsonItem.expect; if (expect) { expect = expect.replaceAll('\\', "\\\\").replaceAll('(', "\\(").replaceAll(')', "\\)") - .replaceAll('+', "\\+").replaceAll('.', "\\.").replaceAll('[', "\\[").replaceAll(']', "\\]") - .replaceAll('?', "\\?").replaceAll('/', "\\/").replaceAll('*', "\\*") - .replaceAll('^', "\\^").replaceAll('{', "\\{").replaceAll('}', "\\}").replaceAll('$', "\\$"); + .replaceAll('+', "\\+").replaceAll('.', "\\.").replaceAll('[', "\\[").replaceAll(']', "\\]") + .replaceAll('?', "\\?").replaceAll('/', "\\/").replaceAll('*', "\\*") + .replaceAll('^', "\\^").replaceAll('{', "\\{").replaceAll('}', "\\}").replaceAll('$', "\\$"); } jsonItem.expect = expect; this.assertions.jsonPath.push(jsonItem); diff --git a/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue b/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue index 75907ac22c..164f462d2e 100644 --- a/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue +++ b/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue @@ -63,7 +63,7 @@ - + - - +