import type { ResearchReportVO } from '#/api/outcome'; import { getPopupContainer } from '@vben/utils'; import { defineEditShell } from '#/adapter/shell/edit'; import { editResearchReportMethod, getResearchReportMethod, RESEARCH_REPORT_CATEGORY_OPTIONS, RESEARCH_REPORT_STATUS_OPTIONS, ResearchReportVOSchema, } from '#/api/outcome'; export const researchReportForm = defineEditShell({ scope: 'outcome.researchReport', title: '研究报告', submit: editResearchReportMethod, load: getResearchReportMethod, shell: { type: 'modal', class: '!w-[760px]', confirmText: '提交报告', }, form: { layout: 'vertical', wrapperClass: 'grid-cols-2', }, schema: [ { component: 'Select', fieldName: 'status', label: '状态', dependencies: { show: false, triggerFields: ['status'], }, componentProps: { options: [...RESEARCH_REPORT_STATUS_OPTIONS], placeholder: '请选择状态', getPopupContainer, }, rules: ResearchReportVOSchema.shape.status, }, { component: 'Input', fieldName: 'title', label: '报告标题', formItemClass: 'col-span-2', componentProps: { placeholder: '请输入研究报告标题', }, rules: ResearchReportVOSchema.shape.title, }, { component: 'Input', fieldName: 'leader', label: '负责人', componentProps: { placeholder: '请输入负责人姓名', }, rules: ResearchReportVOSchema.shape.leader, }, { component: 'Select', fieldName: 'category', label: '研究类型', componentProps: { options: [...RESEARCH_REPORT_CATEGORY_OPTIONS], placeholder: '请选择研究类型', getPopupContainer, }, rules: ResearchReportVOSchema.shape.category, }, { component: 'DatePicker', fieldName: 'startDate', label: '开始日期', componentProps: { class: 'w-full', format: 'YYYY-MM', picker: 'month', placeholder: '年 / 月', valueFormat: 'YYYY-MM', getPopupContainer, }, rules: ResearchReportVOSchema.shape.startDate, }, { component: 'DatePicker', fieldName: 'endDate', label: '预计结束日期', componentProps: { class: 'w-full', format: 'YYYY-MM', picker: 'month', placeholder: '年 / 月', valueFormat: 'YYYY-MM', getPopupContainer, }, rules: ResearchReportVOSchema.shape.endDate, }, { component: 'Input', fieldName: 'fundingSource', label: '资助来源', componentProps: { placeholder: '例如:国家自然科学基金', }, rules: ResearchReportVOSchema.shape.fundingSource, }, { component: 'Input', fieldName: 'projectNumber', label: '项目编号', componentProps: { placeholder: '请输入项目编号', }, rules: ResearchReportVOSchema.shape.projectNumber, }, { component: 'Input', fieldName: 'keywords', label: '关键词', formItemClass: 'col-span-2', componentProps: { placeholder: '多个关键词用分号分隔,例如:中医药;临床研究;疗效评价', }, rules: ResearchReportVOSchema.shape.keywords, }, { component: 'Divider', fieldName: '_section_content', formItemClass: 'col-span-2 !mb-0', hideLabel: true, componentProps: { orientation: 'left', plain: true, }, label: '研究内容', }, { component: 'Textarea', fieldName: 'abstract', label: '研究摘要', formItemClass: 'col-span-2', componentProps: { placeholder: '请简要概述研究的背景、目的、方法和预期成果...', rows: 4, showCount: false, }, rules: ResearchReportVOSchema.shape.abstract, }, { component: 'Textarea', fieldName: 'objectives', label: '研究目标', formItemClass: 'col-span-2', componentProps: { placeholder: '列出本研究的主要目标和次要目标...', rows: 3, showCount: false, }, rules: ResearchReportVOSchema.shape.objectives, }, { component: 'Textarea', fieldName: 'methods', label: '研究方法', formItemClass: 'col-span-2', componentProps: { placeholder: '描述研究设计、样本选择、数据收集和分析方法...', rows: 3, showCount: false, }, rules: ResearchReportVOSchema.shape.methods, }, { component: 'Textarea', fieldName: 'expectedResults', label: '预期成果', formItemClass: 'col-span-2', componentProps: { placeholder: '描述预期的研究成果、创新点和应用价值...', rows: 3, showCount: false, }, rules: ResearchReportVOSchema.shape.expectedResults, }, { component: 'Input', fieldName: 'workroomId', dependencies: { show: false, triggerFields: ['workroomId'], }, rules: ResearchReportVOSchema.shape.workroomId, }, ], });