reading-note.data.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import type { ReadingNoteVO } from '#/api/outcome';
  2. import { defineEditShell } from '#/adapter/shell/edit';
  3. import {
  4. editReadingNoteMethod,
  5. getReadingNoteMethod,
  6. ReadingNoteVOSchema,
  7. } from '#/api/outcome';
  8. export const readingNoteForm = defineEditShell<ReadingNoteVO>({
  9. scope: 'outcome.readingNote',
  10. title: '读书心得',
  11. submit: editReadingNoteMethod,
  12. load: getReadingNoteMethod,
  13. shell: {
  14. type: 'modal',
  15. class: '!w-[640px]',
  16. confirmText: '确定',
  17. },
  18. form: {
  19. layout: 'vertical',
  20. wrapperClass: 'grid-cols-1',
  21. },
  22. schema: [
  23. {
  24. component: 'Input',
  25. fieldName: 'title',
  26. label: '心得标题',
  27. componentProps: {
  28. placeholder: '请输入',
  29. },
  30. rules: ReadingNoteVOSchema.shape.title,
  31. },
  32. {
  33. component: 'Input',
  34. fieldName: 'bookName',
  35. label: '书名',
  36. componentProps: {
  37. placeholder: '请输入',
  38. },
  39. rules: ReadingNoteVOSchema.shape.bookName,
  40. },
  41. {
  42. component: 'Input',
  43. fieldName: 'author',
  44. label: '心得作者',
  45. componentProps: {
  46. placeholder: '请输入',
  47. },
  48. rules: ReadingNoteVOSchema.shape.author,
  49. },
  50. {
  51. component: 'Textarea',
  52. fieldName: 'content',
  53. label: '心得',
  54. componentProps: {
  55. placeholder: '请输入',
  56. rows: 6,
  57. showCount: false,
  58. },
  59. rules: ReadingNoteVOSchema.shape.content,
  60. },
  61. {
  62. component: 'Input',
  63. fieldName: 'workroomId',
  64. dependencies: {
  65. show: false,
  66. triggerFields: ['workroomId'],
  67. },
  68. rules: ReadingNoteVOSchema.shape.workroomId,
  69. },
  70. ],
  71. });