From 8af9a73d9a2eda71bbe5d56a41d4fae2bcd6ed63 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 5 Jun 2020 10:59:53 +0800 Subject: [PATCH] =?UTF-8?q?api=E6=B5=8B=E8=AF=95=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E4=B8=80=E8=A1=8C=E5=8F=AA=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/test/ApiTestConfig.vue | 23 +++++++++++-------- .../components/api/test/ApiTestList.vue | 7 +++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue index 8310c10ff..0d0f7d907 100644 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ b/frontend/src/business/components/api/test/ApiTestConfig.vue @@ -5,27 +5,27 @@ - - - + {{$t('commons.save')}} - + {{$t('load_test.save_and_run')}} - + {{$t('api_test.run')}} - {{$t('commons.cancel')}} + {{$t('commons.cancel')}} @@ -33,7 +33,7 @@ {{$t('api_report.title')}} - + {{$t('api_test.create_performance_test')}} @@ -42,7 +42,7 @@ - + @@ -69,7 +69,8 @@ result: {}, projects: [], change: false, - test: new Test() + test: new Test(), + isReadOnly: false } }, @@ -86,6 +87,10 @@ methods: { init() { let projectId; + this.isReadOnly = false; + if (this.$route.path.indexOf('/api/test/view') >= 0) { + this.isReadOnly = true; + } if (this.id) { this.create = false; this.getTest(this.id); diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue index b232428c1..eac8067f2 100644 --- a/frontend/src/business/components/api/test/ApiTestList.vue +++ b/frontend/src/business/components/api/test/ApiTestList.vue @@ -7,7 +7,7 @@ :title="$t('commons.test')" @create="create" :createTip="$t('load_test.create')"/> - @@ -124,6 +124,11 @@ path: '/api/test/edit?id=' + test.id, }) }, + handleView(test) { + this.$router.push({ + path: '/api/test/view?id=' + test.id, + }) + }, handleDelete(test) { this.$alert(this.$t('load_test.delete_confirm') + test.name + "?", '', { confirmButtonText: this.$t('commons.confirm'), -- GitLab