From 49a4d67ce97bda2e5b52471061b2c0241b6b2d38 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 19 Jan 2022 19:00:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94):=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94=E5=88=87=E6=8D=A2=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 版本对比切换标签处理 --- .../components/complete/EditCompleteDubboApi.vue | 13 +++++++++++++ .../components/complete/EditCompleteHTTPApi.vue | 13 +++++++++++++ .../components/complete/EditCompleteSQLApi.vue | 13 +++++++++++++ .../components/complete/EditCompleteTCPApi.vue | 13 +++++++++++++ 4 files changed, 52 insertions(+) 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 5d5baa5b7e..3698d741f2 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteDubboApi.vue @@ -249,6 +249,7 @@ export default { } } }); + this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { this.oldRequest = createComponent("DubboSampler"); @@ -275,6 +276,18 @@ export default { } return false; }, + 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]"){ + this.basisData.tags = JSON.parse(this.basisData.tags); + } + } + }, formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { 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 9756671edc..78dcd16a8c 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -573,6 +573,7 @@ export default { } } }); + this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { this.oldRequest = createComponent("HTTPSamplerProxy"); @@ -598,6 +599,18 @@ export default { } return false; }, + dealWithTag(api){ + if(api.tags){ + if(Object.prototype.toString.call(api.tags)==="[object String]"){ + api.tags = JSON.parse(api.tags); + } + } + if(this.httpForm.tags){ + if(Object.prototype.toString.call(this.httpForm.tags)==="[object String]"){ + this.httpForm.tags = JSON.parse(this.httpForm.tags); + } + } + }, formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { 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 928f6ade4b..0ac9627005 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteSQLApi.vue @@ -253,6 +253,7 @@ export default { } } }); + this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { this.oldRequest = createComponent("JDBCSampler"); @@ -282,6 +283,18 @@ export default { } return false; }, + 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]"){ + this.basisData.tags = JSON.parse(this.basisData.tags); + } + } + }, formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') { 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 959e41d6e5..aebb663950 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteTCPApi.vue @@ -377,6 +377,7 @@ export default { } } }); + this.dealWithTag(res.data); this.setRequest(res.data) if (!this.setRequest(res.data)) { this.oldRequest = createComponent("TCPSampler"); @@ -403,6 +404,18 @@ export default { } return false; }, + 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]"){ + this.basisData.tags = JSON.parse(this.basisData.tags); + } + } + }, formatApi(api) { if (api.response != null && api.response !== 'null' && api.response !== undefined) { if (Object.prototype.toString.call(api.response).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') {