From 0ab08dece87b892c7948ac04ae571b4e28347058 Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Tue, 25 Jan 2022 01:21:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=89=88=E6=9C=AC=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=8D=E5=AF=B9=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/TestCaseEdit.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 4d831e9291..433002ebf5 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -931,10 +931,10 @@ export default { }); }, setSpecialPropForCompare: function (that) { - that.newData.tags = JSON.parse(that.newData.tags || ""); - that.newData.steps = JSON.parse(that.newData.steps || ""); - that.oldData.tags = JSON.parse(that.oldData.tags || ""); - that.oldData.steps = JSON.parse(that.oldData.steps || ""); + that.newData.tags = JSON.parse(that.newData.tags || "{}"); + that.newData.steps = JSON.parse(that.newData.steps || "{}"); + that.oldData.tags = JSON.parse(that.oldData.tags || "{}"); + that.oldData.steps = JSON.parse(that.oldData.steps || "{}"); that.newData.readOnly = true; that.oldData.readOnly = true; }, @@ -947,9 +947,9 @@ export default { if (data[0] && data[1]) { that.newData = data[0].data.data; that.oldData = data[1].data.data; - let testCase = this.versionData.filter(v => v.versionId === this.currentTestCaseInfo.versionId)[0]; - that.newData.versionName = response.data.versionName - that.oldData.versionName = testCase.versionName + let testCase = that.versionData.filter(v => v.versionId === this.currentTestCaseInfo.versionId)[0]; + that.newData.versionName = that.versionData.filter(v => v.id === that.newData.id)[0].versionName; + that.oldData.versionName = that.versionData.filter(v => v.id === that.oldData.id)[0].versionName; that.newData.userName = response.data.createName that.oldData.userName = testCase.createName this.setSpecialPropForCompare(that);