From 37dbf0aad93ee77c34975aea12d2d5a878478538 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 14 Jan 2022 14:43:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94):=20d?= =?UTF-8?q?ubbo/TCP/SQL=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=AF=B9=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 dubbo/TCP/SQL接口定义版本对比 --- .../complete/EditCompleteDubboApi.vue | 116 +++++++- .../complete/EditCompleteSQLApi.vue | 121 +++++++- .../complete/EditCompleteTCPApi.vue | 130 ++++++++- .../components/complete/TCPBasicApi.vue | 6 +- .../complete/version/DubboApiVersionDiff.vue | 203 +++++++++++++ .../complete/version/HttpApiVersionDiff.vue | 3 - .../complete/version/SQLApiVersionDiff.vue | 195 +++++++++++++ .../complete/version/TCPApiVersionDiff.vue | 266 ++++++++++++++++++ 8 files changed, 1032 insertions(+), 8 deletions(-) create mode 100644 frontend/src/business/components/api/definition/components/complete/version/DubboApiVersionDiff.vue create mode 100644 frontend/src/business/components/api/definition/components/complete/version/SQLApiVersionDiff.vue create mode 100644 frontend/src/business/components/api/definition/components/complete/version/TCPApiVersionDiff.vue diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue index 252063f4ba..11d6aa1a1c 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue @@ -46,6 +46,22 @@ + + + + @@ -58,6 +74,10 @@ import {getCurrentUser, hasLicense} from "@/common/js/utils"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {}; +import DubboApiVersionDiff from "./version/DubboApiVersionDiff" +import {createComponent } from ".././jmeter/components"; +const {Body} = require("@/business/components/api/definition/model/ApiTestModel"); +import { TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; export default { name: "MsApiDubboRequestForm", @@ -65,6 +85,7 @@ export default { ApiOtherInfo, MsBasisApi, MsBasisParameters, MsChangeHistory, 'MsVersionHistory': versionHistory.default, + DubboApiVersionDiff, }, props: { request: {}, @@ -114,7 +135,12 @@ export default { return { validated: false, showFollow: false, + dialogVisible:false, + newShowFollow:false, versionData: [], + newData:{}, + oldRequest:{}, + oldResponse:{} }; }, methods: { @@ -185,7 +211,95 @@ export default { }); }, compare(row) { - // console.log(row); + 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; + this.$get('/api/definition/follow/' + response.data.id, resp => { + if(resp.data&&resp.data.follows){ + for (let i = 0; i 0) { + this.sort(stepArray[i].hashTree); + } + } + } }, checkout(row) { let api = this.versionData.filter(v => v.versionId === row.id)[0]; 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 57106865b2..d1342f0927 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue @@ -47,6 +47,22 @@ + + + + @@ -56,9 +72,14 @@ import MsBasisParameters from "../request/database/BasisParameters"; import MsChangeHistory from "../../../../history/ChangeHistory"; import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo"; import {getCurrentUser, hasLicense} from "@/common/js/utils"; +import SQLApiVersionDiff from "./version/SQLApiVersionDiff" +import {createComponent } from ".././jmeter/components"; +import { TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {}; +const {Body} = require("@/business/components/api/definition/model/ApiTestModel"); + export default { name: "MsApiSqlRequestForm", @@ -66,6 +87,7 @@ export default { ApiOtherInfo, MsBasisApi, MsBasisParameters, MsChangeHistory, 'MsVersionHistory': versionHistory.default, + SQLApiVersionDiff }, props: { request: {}, @@ -101,10 +123,16 @@ export default { return { validated: false, showFollow: false, + dialogVisible:false, + newShowFollow:false, versionData: [], + newData:{}, + oldRequest:{}, + oldResponse:{} }; }, created() { + console.log("看看是不是这页面") this.$get('/api/definition/follow/' + this.basisData.id, response => { this.basisData.follows = response.data; for (let i = 0; i < response.data.length; i++) { @@ -187,7 +215,97 @@ export default { }); }, compare(row) { - // console.log(row); + 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; + this.$get('/api/definition/follow/' + response.data.id, resp => { + if(resp.data&&resp.data.follows){ + for (let i = 0; i 0) { + this.sort(stepArray[i].hashTree); + } + } + } }, checkout(row) { let api = this.versionData.filter(v => v.versionId === row.id)[0]; @@ -198,6 +316,7 @@ export default { }, create(row) { // 创建新版本 + this.basisData.versionId = row.id; this.saveApi(); }, 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 d42110d249..e2b3e1c528 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue @@ -74,7 +74,26 @@ - + + + @@ -85,7 +104,11 @@ import MsTcpFormatParameters from "../request/tcp/TcpFormatParameters"; import MsChangeHistory from "../../../../history/ChangeHistory"; import {getCurrentProjectID, getCurrentUser, hasLicense} from "@/common/js/utils"; import ApiOtherInfo from "@/business/components/api/definition/components/complete/ApiOtherInfo"; +import TCPApiVersionDiff from "./version/TCPApiVersionDiff" +import {createComponent } from ".././jmeter/components"; +import { TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; +const {Body} = require("@/business/components/api/definition/model/ApiTestModel"); const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const esbDefinition = (requireComponent != null && requireComponent.keys().length) > 0 ? requireComponent("./apidefinition/EsbDefinition.vue") : {}; const esbDefinitionResponse = (requireComponent != null && requireComponent.keys().length) > 0 ? requireComponent("./apidefinition/EsbDefinitionResponse.vue") : {}; @@ -98,6 +121,7 @@ export default { "esbDefinition": esbDefinition.default, "esbDefinitionResponse": esbDefinitionResponse.default, 'MsVersionHistory': versionHistory.default, + TCPApiVersionDiff, }, props: { request: {}, @@ -123,6 +147,13 @@ export default { ], showXpackCompnent: false, versionData: [], + dialogVisible:false, + newShowFollow:false, + newData:{}, + oldRequest:{}, + oldResponse:{}, + oldApiProtocol: "TCP", + }; }, created: function () { @@ -301,7 +332,102 @@ export default { }); }, compare(row) { - // console.log(row); + 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; + if (this.newData.method !== 'TCP' && this.newData.method !== 'ESB') { + this.newData.method = this.newData.protocol; + } + this.oldApiProtocol = this.basisData.method; + if (this.oldApiProtocol == null || this.oldApiProtocol === "") { + this.oldApiProtocol = "TCP"; + } + this.$get('/api/definition/follow/' + response.data.id, resp => { + if(resp.data&&resp.data.follows){ + for (let i = 0; i 0) { + this.sort(stepArray[i].hashTree); + } + } + } }, checkout(row) { let api = this.versionData.filter(v => v.versionId === row.id)[0]; diff --git a/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue b/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue index 6984c89a19..5263f00432 100644 --- a/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/TCPBasicApi.vue @@ -3,7 +3,7 @@ - + @@ -81,6 +81,10 @@ moduleOptions: Array, methodTypes: Array, basisData: {}, + isDiff:{ + type: Boolean, + default: false + }, }, created() { this.getMaintainerOptions(); diff --git a/frontend/src/business/components/api/definition/components/complete/version/DubboApiVersionDiff.vue b/frontend/src/business/components/api/definition/components/complete/version/DubboApiVersionDiff.vue new file mode 100644 index 0000000000..8d2efad886 --- /dev/null +++ b/frontend/src/business/components/api/definition/components/complete/version/DubboApiVersionDiff.vue @@ -0,0 +1,203 @@ + + + diff --git a/frontend/src/business/components/api/definition/components/complete/version/HttpApiVersionDiff.vue b/frontend/src/business/components/api/definition/components/complete/version/HttpApiVersionDiff.vue index 2e9e8c24ee..49ad9d4fdc 100644 --- a/frontend/src/business/components/api/definition/components/complete/version/HttpApiVersionDiff.vue +++ b/frontend/src/business/components/api/definition/components/complete/version/HttpApiVersionDiff.vue @@ -267,7 +267,6 @@ + diff --git a/frontend/src/business/components/api/definition/components/complete/version/TCPApiVersionDiff.vue b/frontend/src/business/components/api/definition/components/complete/version/TCPApiVersionDiff.vue new file mode 100644 index 0000000000..1ba5ef458e --- /dev/null +++ b/frontend/src/business/components/api/definition/components/complete/version/TCPApiVersionDiff.vue @@ -0,0 +1,266 @@ + + +