data.ts.vm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. export const columns: BasicColumn[] = [
  3. ## ----------BEGIN 字段循环遍历----------
  4. #foreach($field in ${table.fields})
  5. #if(${field.keyFlag})
  6. ## 主键
  7. #if(${field.keyIdentityFlag})
  8. #end
  9. ## 普通字段
  10. #else
  11. {
  12. title: '#if("$!field.comment" != "")${field.comment}#else${field.propertyName}#end',
  13. dataIndex: '${field.propertyName}',
  14. width: 120,
  15. },
  16. #end
  17. #end
  18. ## ----------END 字段循环遍历----------
  19. ];
  20. export const searchFormSchema: FormSchema[] = [
  21. ## ----------BEGIN 字段循环遍历----------
  22. #foreach($field in ${table.fields})
  23. #if(${field.keyFlag})
  24. ## 主键
  25. #if(${field.keyIdentityFlag})
  26. #end
  27. ## 普通字段
  28. #else
  29. {
  30. field: '${field.propertyName}',
  31. label: '#if("$!field.comment" != "")${field.comment}#else${field.propertyName}#end',
  32. component: 'Input',
  33. componentProps: {
  34. placeholder: '请输入#if("$!field.comment" != "")${field.comment}#else${field.propertyName}#end',
  35. },
  36. },
  37. #end
  38. #end
  39. ## ----------END 字段循环遍历----------
  40. ];
  41. export const dataFormSchema: FormSchema[] = [
  42. ## ----------BEGIN 字段循环遍历----------
  43. #foreach($field in ${table.fields})
  44. #if(${field.keyFlag})
  45. ## 主键
  46. #if(${field.keyIdentityFlag})
  47. #end
  48. ## 普通字段
  49. #else
  50. {
  51. field: '${field.propertyName}',
  52. label: '#if("$!field.comment" != "")${field.comment}#else${field.propertyName}#end',
  53. component: 'Input',
  54. required: true,
  55. componentProps: {
  56. placeholder: '请输入#if("$!field.comment" != "")${field.comment}#else${field.propertyName}#end',
  57. },
  58. },
  59. #end
  60. #end
  61. ## ----------END 字段循环遍历----------
  62. ];