| | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'edit'; |
| | | |
| | | /** 课题组成员角色选项 */ |
| | | export const MEMBER_ROLE_OPTIONS = [ |
| | | { label: '主持人', value: '主持人' }, |
| | | { label: '核心成员', value: '核心成员' }, |
| | | { label: '参与人', value: '参与人' }, |
| | | /** 课题组成员类型选项(对齐学校版成员表) */ |
| | | export const MEMBER_TYPE_OPTIONS = [ |
| | | { label: '教师', value: '教师' }, |
| | | { label: '学生', value: '学生' }, |
| | | { label: '校外人员', value: '校外人员' }, |
| | | ]; |
| | | |
| | | /** |
| | | * 成员行投影为可提交对象:只保留后端接受的字段, |
| | | * 不带 id / applicationId,避免与「先删后增」的软删行主键冲突。 |
| | | * 联系电话、成员角色已不在表单录入,但历史行原值继续透传,避免编辑时被清空。 |
| | | */ |
| | | export function toSubmitMembers( |
| | | members?: ResearchApplicationApi.ApplicationMember[], |
| | | ): ResearchApplicationApi.ApplicationMember[] { |
| | | return (members ?? []).map((member) => ({ |
| | | name: member.name, |
| | | memberType: member.memberType, |
| | | contactPhone: member.contactPhone, |
| | | workUnit: member.workUnit, |
| | | jobTitle: member.jobTitle, |