food.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { VillageBulidingInfo } from "@/api/inhert/VillageInfoApi";
  2. import type { SingleForm } from "../forms";
  3. import { villageCommonContent } from "./common";
  4. export function villageInfoFoodProductsForm(title: string) : SingleForm {
  5. return [VillageBulidingInfo, (r) => ({
  6. formItems: [
  7. {
  8. label: `${title}名称`,
  9. name: 'name',
  10. type: 'text',
  11. defaultValue: '',
  12. additionalProps: {
  13. placeholder: '请输入名称',
  14. },
  15. rules: [{
  16. required: true,
  17. message: '请输入名称',
  18. }]
  19. },
  20. {
  21. label: `${title}详情`,
  22. name: 'details',
  23. type: 'richtext',
  24. defaultValue: '',
  25. additionalProps: {
  26. placeholder: '请输入详情',
  27. maxLength: 200,
  28. showWordLimit: true,
  29. },
  30. rules: [{
  31. required: true,
  32. message: '请输入详情',
  33. }]
  34. },
  35. ...(villageCommonContent(r, {
  36. title: title,
  37. showContent: false,
  38. showTitle: false,
  39. })).formItems
  40. ]
  41. }), { title: title, typeName: 'productType', }];
  42. }