fix(环境管理): 修复前后置脚本变更记录格式显示问题

--bug=1010776
--user=郭雨琦
修复了环境管理变更记录列表排序问题
修复了环境管理前后置脚本变更记录显示格式问题
修复了系统-操作日志部分变更记录显示问题
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001010776
This commit is contained in:
guoyuqi 2022-04-08 17:55:59 +08:00 committed by xiaomeinvG
parent d3da8d9a0e
commit 96d805a08a
3 changed files with 15 additions and 5 deletions

View File

@ -77,9 +77,9 @@
</if>
and JSON_UNQUOTE(JSON_EXTRACT(t.oper_content, '$.columns[*]')) is not null
</where>
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
</select>
</mapper>

View File

@ -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);
}
},
}
}

View File

@ -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 => {