fix: 用例评审执行报错

This commit is contained in:
chenjianxing 2021-04-28 19:46:42 +08:00 committed by jianxing
parent 4b7204c960
commit 01171820a2
1 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import {SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants";
* @param oldFields 用于兼容旧版本数据
*/
export function parseCustomField(data, template, customFieldForm, rules, oldFields) {
let hasOldData = false
let hasOldData = false;
if (!data.customFields) {
// 旧数据
hasOldData = true;
@ -22,8 +22,10 @@ export function parseCustomField(data, template, customFieldForm, rules, oldFiel
// 设置页面显示的默认值
template.customFields.forEach(item => {
if (item.defaultValue) {
if (item.defaultValue && !item.hasParse) {
item.defaultValue = JSON.parse(item.defaultValue);
item.hasParse = true; // 多次调用不执行这部分
}
// 添加自定义字段必填校验