diff --git a/frontend/src/components/pure/ms-form-create/ms-form-create.vue b/frontend/src/components/pure/ms-form-create/ms-form-create.vue index 5acd99a7de..033ca94ab4 100644 --- a/frontend/src/components/pure/ms-form-create/ms-form-create.vue +++ b/frontend/src/components/pure/ms-form-create/ms-form-create.vue @@ -166,7 +166,7 @@ }; if (optionsItem.children) { - mappedItem.children = mapOption(optionsItem.children); + mappedItem.children = mapOption(optionsItem.children || []); } return mappedItem; }); @@ -186,8 +186,8 @@ } else { fieldType = FieldTypeFormRules[currentTypeForm].type; } - const options = item?.options; - const currentOptions = mapOption(options || []); + const options = Array.isArray(item?.options) ? item?.options : []; + const currentOptions = mapOption(options); const ruleItem: any = { type: fieldType, // 表单类型 field: item.name, // 字段 @@ -279,7 +279,7 @@ } function getControlFormItems() { - const convertedData = formItems.value.map((item: FormItem) => convertItem(item)); + const convertedData = (formItems.value || []).map((item: FormItem) => convertItem(item)); formRuleList.value = convertedData; } diff --git a/frontend/src/views/bug-management/utils.ts b/frontend/src/views/bug-management/utils.ts index 1ac38fc1f8..9588d9619a 100644 --- a/frontend/src/views/bug-management/utils.ts +++ b/frontend/src/views/bug-management/utils.ts @@ -98,6 +98,7 @@ export function makeCustomFieldsParams(formItem: FormRuleItem[]) { // 设置成员默认值 export function getDefaultMemberValue(item: DetailCustomField, initOptions: FieldOptions[]) { + // 系统模板创建人 if ((item.defaultValue as string | string[]).includes('CREATE_USER')) { const optionsIds = initOptions.map((e: any) => e.value); const userId = userStore.id as string; @@ -106,6 +107,13 @@ export function getDefaultMemberValue(item: DetailCustomField, initOptions: Fiel } else { item.defaultValue = item.type === 'MEMBER' ? '' : []; } + // 三方默认创建人 + } else { + const value = + item.type === 'MULTIPLE_MEMBER' && item.defaultValue && typeof item.defaultValue === 'string' + ? JSON.parse(item.defaultValue) + : item.defaultValue; + item.defaultValue = value; } return item.defaultValue; } diff --git a/frontend/src/views/case-management/components/addDefectDrawer/index.vue b/frontend/src/views/case-management/components/addDefectDrawer/index.vue index cd5dc5a6bc..f940d2f947 100644 --- a/frontend/src/views/case-management/components/addDefectDrawer/index.vue +++ b/frontend/src/views/case-management/components/addDefectDrawer/index.vue @@ -2,8 +2,8 @@