From 96d805a08af1979db2a15075671cf22cca650c15 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 8 Apr 2022 17:55:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=8E=AF=E5=A2=83=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E5=90=8E=E7=BD=AE=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=A0=BC=E5=BC=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010776 --user=郭雨琦 修复了环境管理变更记录列表排序问题 修复了环境管理前后置脚本变更记录显示格式问题 修复了系统-操作日志部分变更记录显示问题 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001010776 --- .../base/mapper/ext/ExtOperatingLogMapper.xml | 2 +- .../components/history/api/EnvironmentEditParams.vue | 9 +++++++-- .../components/settings/operatinglog/LogDetail.vue | 9 +++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml index c40254143c..2d7237396f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml @@ -77,9 +77,9 @@ and JSON_UNQUOTE(JSON_EXTRACT(t.oper_content, '$.columns[*]')) is not null - order by t.oper_time desc )tt LEFT JOIN `user` t1 ON tt.oper_user = t1.id LEFT JOIN project t2 ON tt.project_id = t2.id + order by tt.oper_time desc diff --git a/frontend/src/business/components/history/api/EnvironmentEditParams.vue b/frontend/src/business/components/history/api/EnvironmentEditParams.vue index f062f6fefc..b907002275 100644 --- a/frontend/src/business/components/history/api/EnvironmentEditParams.vue +++ b/frontend/src/business/components/history/api/EnvironmentEditParams.vue @@ -145,8 +145,13 @@ } }, getDiff(v1, v2) { - let delta = jsondiffpatch.diff(v1 , v2); - return formattersHtml.format(delta, v1); + if(typeof v1 === 'string' && typeof v2 === 'string' && v1.indexOf("{") !==-1 && v2.indexOf("{") !==-1 ){ + let delta = jsondiffpatch.diff(JSON.parse(v1), JSON.parse(v2)); + return formattersHtml.format(delta,delta); + }else{ + let delta = jsondiffpatch.diff(v1, v2); + return formattersHtml.format(delta,v1); + } }, } } diff --git a/frontend/src/business/components/settings/operatinglog/LogDetail.vue b/frontend/src/business/components/settings/operatinglog/LogDetail.vue index 931598f032..b990713087 100644 --- a/frontend/src/business/components/settings/operatinglog/LogDetail.vue +++ b/frontend/src/business/components/settings/operatinglog/LogDetail.vue @@ -136,8 +136,13 @@ this.infoVisible = false; }, getDiff(v1, v2) { - let delta = jsondiffpatch.diff(v1, v2); - return formattersHtml.format(delta, v1); + if(typeof v1 === 'string' && typeof v2 === 'string' && v1.indexOf("{") !==-1 && v2.indexOf("{") !==-1 ){ + let delta = jsondiffpatch.diff(JSON.parse(v1), JSON.parse(v2)); + return formattersHtml.format(delta,delta); + }else{ + let delta = jsondiffpatch.diff(v1, v2); + return formattersHtml.format(delta,v1); + } }, getDetails(id) { this.result = this.$get("/operating/log/get/" + id, response => {