refactor(缺陷管理): 优化第三方平台默认模板默认值的展示
This commit is contained in:
parent
b05031b548
commit
1c6c8fcb7a
|
@ -388,8 +388,10 @@
|
|||
|
||||
if (Array.isArray(arr) && arr.length) {
|
||||
formRules.value = arr.map((item: any) => {
|
||||
let initValue = item.defaultValue;
|
||||
const initOptions = item.options ? item.options : JSON.parse(item.platformOptionJson);
|
||||
let initValue;
|
||||
if (!isEditOrCopy.value) {
|
||||
initValue = item.defaultValue;
|
||||
if (memberType.includes(item.type)) {
|
||||
if (item.defaultValue === 'CREATE_USER' || item.defaultValue.includes('CREATE_USER')) {
|
||||
initValue = item.type === 'MEMBER' ? userStore.id : [userStore.id];
|
||||
|
@ -397,10 +399,15 @@
|
|||
initValue = JSON.parse(item.defaultValue);
|
||||
}
|
||||
} else if (multipleType.includes(item.type)) {
|
||||
if (item.defaultValue && item.defaultValue.length > 0) {
|
||||
initValue = item.defaultValue ? JSON.parse(item.defaultValue) : [];
|
||||
}
|
||||
} else if (numberType.includes(item.type)) {
|
||||
initValue = Number(initValue);
|
||||
}
|
||||
} else {
|
||||
initValue = null;
|
||||
}
|
||||
return {
|
||||
type: item.type,
|
||||
name: item.fieldId,
|
||||
|
@ -590,7 +597,7 @@
|
|||
value: form.value.platformSystemFields[key],
|
||||
});
|
||||
});
|
||||
delete form.value.platformSystemFields;
|
||||
// delete form.value.platformSystemFields;
|
||||
// 平台默认模板不传递名称, 描述, 标签等参数
|
||||
delete form.value.title;
|
||||
delete form.value.description;
|
||||
|
|
Loading…
Reference in New Issue