fix(测试跟踪): 缺陷管理自定义字段内容特殊转义字符处理

--bug=1026051 --user=宋昌昌 【测试跟踪】github#24283,导入缺陷时,当缺陷字段为输入框,并存在回车时,会导致数据解析失败 https://www.tapd.cn/55049933/s/1370289
This commit is contained in:
song-cc-rock 2023-05-09 17:56:58 +08:00 committed by fit2-zhao
parent e7eb75c321
commit 398d6ac894
1 changed files with 2 additions and 1 deletions

View File

@ -706,7 +706,8 @@ export function parseCustomFilesForList(data) {
export function parseCustomFilesForItem(data) {
if (data.value) {
data.value = JSON.parse(data.value);
// 自定义字段内容存在回车,换行符, 需转义.
data.value = JSON.parse(data.value.replace(/\n/g,"\\n").replace(/\r/g,"\\r"));
}
if (data.textValue && !data.textValue.startsWith(OPTION_LABEL_PREFIX)) {
data.value = data.textValue;