From 097397e3000ed2b6bf70d72b24424fdd19240a29 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 8 Jul 2022 11:34:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=81=97=E7=95=99=E7=9A=84=E4=B8=BB=E9=A2=98=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/schedule/ScheduleMaintain.vue | 25 +- .../components/assertion/ApiAssertions.vue | 303 +++++++++--------- .../components/case/ApiCaseItem.vue | 2 +- .../complete/EditCompleteDubboApi.vue | 16 +- .../complete/EditCompleteHTTPApi.vue | 4 +- .../complete/EditCompleteSQLApi.vue | 20 +- .../complete/EditCompleteTCPApi.vue | 16 +- .../components/document/ApiDocumentAnchor.vue | 3 +- .../document/components/ApiInformation.vue | 9 +- .../mock/Components/MockRequestParam.vue | 46 ++- .../components/module/ModulePublicButton.vue | 2 +- .../components/module/ModuleTrashButton.vue | 70 ++-- .../request/http/ApiHttpRequestForm.vue | 149 +++++---- .../definition/components/step/JmxStep.vue | 180 ++++++----- .../track/case/components/TestCaseEdit.vue | 5 +- .../case/components/TestCaseEditShow.vue | 20 +- .../components/track/common/NodeTree.vue | 23 +- .../plan/components/ScheduleMaintain.vue | 34 +- 18 files changed, 482 insertions(+), 445 deletions(-) diff --git a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue index e74c260c16..b942d38071 100644 --- a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue +++ b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue @@ -59,7 +59,7 @@ ref="envPopover" class="env-popover"/>
- {{ $t("run_mode.other_config") }}: + {{ $t("run_mode.other_config") }}: {{ $t('run_mode.run_with_resource_pool') }} @@ -96,9 +96,12 @@ diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 26e2e8e0e5..1e010ecd4a 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -58,7 +58,7 @@ @@ -247,7 +247,7 @@ export default { }, compare(row) { this.basisData.createTime = this.$refs.versionHistory.versionOptions.filter(v => v.id === this.basisData.versionId)[0].createTime; - this.$get('/api/definition/get/' + row.id+"/"+this.basisData.refId, response => { + this.$get('/api/definition/get/' + row.id + "/" + this.basisData.refId, response => { this.$get('/api/definition/get/' + response.data.id, res => { if (res.data) { this.newData = res.data; @@ -279,14 +279,14 @@ export default { } return false; }, - dealWithTag(api){ - if(api.tags){ - if(Object.prototype.toString.call(api.tags)==="[object String]"){ + dealWithTag(api) { + if (api.tags) { + if (Object.prototype.toString.call(api.tags) === "[object String]") { api.tags = JSON.parse(api.tags); } } - if(this.basisData.tags){ - if(Object.prototype.toString.call(this.basisData.tags)==="[object String]"){ + if (this.basisData.tags) { + if (Object.prototype.toString.call(this.basisData.tags) === "[object String]") { this.basisData.tags = JSON.parse(this.basisData.tags); } } diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue index 59cc22c940..b73e4796f2 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -7,12 +7,12 @@
diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue index eea5ebcf5c..7b7ba9bbfd 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue @@ -7,12 +7,12 @@
@@ -171,8 +171,8 @@ export default { this.getVersionHistory(); } - if(!this.request.environmentId){ - this.request.environmentId = this.$store.state.useEnvironment; + if (!this.request.environmentId) { + this.request.environmentId = this.$store.state.useEnvironment; } }, methods: { @@ -254,7 +254,7 @@ export default { }, compare(row) { this.basisData.createTime = this.$refs.versionHistory.versionOptions.filter(v => v.id === this.basisData.versionId)[0].createTime; - this.$get('/api/definition/get/' + row.id+"/"+this.basisData.refId, response => { + this.$get('/api/definition/get/' + row.id + "/" + this.basisData.refId, response => { this.$get('/api/definition/get/' + response.data.id, res => { if (res.data) { this.newData = res.data; @@ -289,14 +289,14 @@ export default { } return false; }, - dealWithTag(api){ - if(api.tags){ - if(Object.prototype.toString.call(api.tags)==="[object String]"){ + dealWithTag(api) { + if (api.tags) { + if (Object.prototype.toString.call(api.tags) === "[object String]") { api.tags = JSON.parse(api.tags); } } - if(this.basisData.tags){ - if(Object.prototype.toString.call(this.basisData.tags)==="[object String]"){ + if (this.basisData.tags) { + if (Object.prototype.toString.call(this.basisData.tags) === "[object String]") { this.basisData.tags = JSON.parse(this.basisData.tags); } } diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue index cda1be87c0..5ec6d4894f 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue @@ -7,12 +7,12 @@
@@ -371,7 +371,7 @@ export default { }, compare(row) { this.basisData.createTime = this.$refs.versionHistory.versionOptions.filter(v => v.id === this.basisData.versionId)[0].createTime; - this.$get('/api/definition/get/' + row.id+"/"+this.basisData.refId, response => { + this.$get('/api/definition/get/' + row.id + "/" + this.basisData.refId, response => { this.$get('/api/definition/get/' + response.data.id, res => { if (res.data) { this.newData = res.data; @@ -410,14 +410,14 @@ export default { } return false; }, - dealWithTag(api){ - if(api.tags){ - if(Object.prototype.toString.call(api.tags)==="[object String]"){ + dealWithTag(api) { + if (api.tags) { + if (Object.prototype.toString.call(api.tags) === "[object String]") { api.tags = JSON.parse(api.tags); } } - if(this.basisData.tags){ - if(Object.prototype.toString.call(this.basisData.tags)==="[object String]"){ + if (this.basisData.tags) { + if (Object.prototype.toString.call(this.basisData.tags) === "[object String]") { this.basisData.tags = JSON.parse(this.basisData.tags); } } diff --git a/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue b/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue index 1933027f31..cf9d39a068 100644 --- a/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue +++ b/frontend/src/business/components/api/definition/components/document/ApiDocumentAnchor.vue @@ -100,9 +100,7 @@ diff --git a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue index 39aafd6e2d..bf5d253e5f 100644 --- a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue +++ b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue @@ -5,7 +5,8 @@ - + {{ $t('api_test.request.headers') }}
{{ headers.length - 1 }}
@@ -13,22 +14,25 @@ - {{ $t("commons.batch_add") }} + + {{ $t("commons.batch_add") }} + + @editScenarioAdvance="editScenarioAdvance" + :scenario-definition="scenarioDefinition" + :show-desc="true" + :is-read-only="isReadOnly" + :isShowEnable="isShowEnable" + :suggestions="headerSuggestions" + :items="headers" + :need-mock="true" v-if="activeName === 'headers'"/> - + {{ $t('api_test.definition.request.query_param') }}
{{ request.arguments.length - 1 }}
@@ -36,22 +40,25 @@ - {{ $t("commons.batch_add") }} + + {{ $t("commons.batch_add") }} + - + {{ $t('api_test.definition.request.rest_param') }}
@@ -60,51 +67,54 @@ - {{ $t("commons.batch_add") }} + + {{ $t("commons.batch_add") }} + - + {{ $t('api_test.definition.request.auth_config') }} @@ -117,13 +127,13 @@
@@ -134,13 +144,13 @@
@@ -151,14 +161,14 @@
+ :request="request" + :apiId="request.id" + :scenarioId="scenarioId" + :response="response" + @reload="reloadBody" + :tab-type="'assertionsRule'" + ref="assertionsRule" + v-if="activeName === 'assertionsRule'"/>
@@ -177,13 +187,12 @@ import MsApiVariable from "../../ApiVariable"; import MsApiAssertions from "../../assertion/ApiAssertions"; import MsApiExtract from "../../extract/ApiExtract"; import {Body, KeyValue} from "../../../model/ApiTestModel"; -import {hasLicense, getUUID} from "@/common/js/utils"; +import {getUUID, hasLicense, hasPermission} from "@/common/js/utils"; import BatchAddParameter from "../../basis/BatchAddParameter"; import MsApiAdvancedConfig from "./ApiAdvancedConfig"; import MsJsr233Processor from "../../../../automation/scenario/component/Jsr233Processor"; -import {hasPermission} from '@/common/js/utils'; import Convert from "@/business/components/common/json-schema/convert/convert"; -import {stepCompute, hisDataProcessing} from "@/business/components/api/definition/api-definition"; +import {hisDataProcessing, stepCompute} from "@/business/components/api/definition/api-definition"; export default { name: "MsApiHttpRequestForm", @@ -561,4 +570,8 @@ export default { width: 100%; } +/deep/ .el-step__icon-inner { + border-top-color: var(--primary_color); +} + diff --git a/frontend/src/business/components/api/definition/components/step/JmxStep.vue b/frontend/src/business/components/api/definition/components/step/JmxStep.vue index 0979b1ab36..b19bae48da 100644 --- a/frontend/src/business/components/api/definition/components/step/JmxStep.vue +++ b/frontend/src/business/components/api/definition/components/step/JmxStep.vue @@ -18,109 +18,111 @@ :value="item.id"> - + {{ $t('api_test.request.assertions.add') }}

- - + -
- - - +
+ + + - + -
-
- - +
+
+ + - - - - -
-
- - -
- + + + + +
+
+ + +
+
diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index bb7e38da3d..e4d66b468d 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -27,12 +27,12 @@
@@ -142,7 +142,6 @@ import {TokenKey} from '@/common/js/constants'; import MsDialogFooter from '../../../common/components/MsDialogFooter'; import { - byteToSize, getCurrentProjectID, getCurrentUser, getNodePath, diff --git a/frontend/src/business/components/track/case/components/TestCaseEditShow.vue b/frontend/src/business/components/track/case/components/TestCaseEditShow.vue index a4a9c243a3..ed6e2f1139 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEditShow.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEditShow.vue @@ -7,12 +7,12 @@
@@ -32,7 +32,7 @@ :content="$t('commons.copy')" size="small" @click="handleCopyPublic" icon="" - /> + />
@@ -57,7 +57,8 @@ - @@ -96,7 +97,8 @@ - @@ -112,7 +114,7 @@ :destroy-on-close="true" width="100%" > - @@ -274,7 +276,7 @@ export default { }, tabId: getUUID(), versionData: [], - currentProjectId: "" , + currentProjectId: "", dialogVisible: false, oldData: null, newData: null, @@ -513,7 +515,7 @@ export default { initFuc(testCase); }); }, - initEdit(testCase , callback) { + initEdit(testCase, callback) { if (window.history && window.history.pushState) { history.pushState(null, null, document.URL); window.addEventListener('popstate', this.close); @@ -860,7 +862,7 @@ export default { }, getVersionHistory() { this.$get('/test/case/versions/' + this.currentTestCaseInfo.id, response => { - for (let i = 0; i < response.data.length ; i++) { + for (let i = 0; i < response.data.length; i++) { this.currentProjectId = response.data[i].projectId } this.versionData = response.data; diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 8bef64c1ad..1000c5024b 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -33,9 +33,8 @@ - - {{ data.caseNum }} + {{ data.caseNum }} { - if (action === "confirm") { - let nodeIds = []; - this.getChildNodeId(node.data, nodeIds); - this.$emit('remove', nodeIds, data); + confirmButtonText: this.$t("commons.confirm"), + callback: action => { + if (action === "confirm") { + let nodeIds = []; + this.getChildNodeId(node.data, nodeIds); + this.$emit('remove', nodeIds, data); + } } } - } - ); - }else { + ); + } else { let nodeIds = []; this.getChildNodeId(node.data, nodeIds); this.$emit('remove', nodeIds, data); diff --git a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue index 3adafaffc8..450c7f0dcd 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue @@ -12,7 +12,8 @@
1
{{ $t('schedule.edit_timer_task') }} - + @@ -104,11 +105,11 @@ + v-for="item in resourcePools" + :key="item.id" + :label="item.name" + :disabled="!item.api" + :value="item.id">
@@ -184,12 +185,12 @@