| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- 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<ResearchReportVO>({
- 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,
- },
- ],
- });
|