data.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import { FormSchema } from '/@/components/Form';
  2. const colProps = {
  3. span: 8,
  4. };
  5. export const schemas: FormSchema[] = [
  6. {
  7. field: 'title',
  8. component: 'Input',
  9. label: '标题',
  10. colProps,
  11. componentProps: {
  12. placeholder: '给目标起个名字',
  13. },
  14. required: true,
  15. },
  16. {
  17. field: 'time',
  18. component: 'RangePicker',
  19. label: '起止日期',
  20. colProps,
  21. required: true,
  22. },
  23. {
  24. field: 'client',
  25. component: 'Input',
  26. colProps,
  27. label: '客户',
  28. helpMessage: '目标的服务对象',
  29. subLabel: '( 选填 )',
  30. componentProps: {
  31. placeholder: '请描述你服务的客户,内部客户直接 @姓名/工号',
  32. },
  33. },
  34. {
  35. field: 'weights',
  36. component: 'InputNumber',
  37. label: '权重',
  38. colProps,
  39. subLabel: '( 选填 )',
  40. componentProps: {
  41. formatter: (value: string) => (value ? `${value}%` : ''),
  42. parser: (value: string) => value.replace('%', ''),
  43. placeholder: '请输入',
  44. },
  45. },
  46. {
  47. field: 'target',
  48. component: 'InputTextArea',
  49. label: '目标描述',
  50. colProps,
  51. componentProps: {
  52. placeholder: '请输入你的阶段性工作目标',
  53. rows: 4,
  54. },
  55. required: true,
  56. },
  57. {
  58. field: 'metrics',
  59. component: 'InputTextArea',
  60. label: '衡量标准',
  61. colProps,
  62. componentProps: {
  63. placeholder: '请输入衡量标准',
  64. rows: 4,
  65. },
  66. required: true,
  67. },
  68. {
  69. field: 'inviteer',
  70. component: 'Input',
  71. label: '邀评人',
  72. colProps: {
  73. span: 8,
  74. },
  75. subLabel: '( 选填 )',
  76. componentProps: {
  77. placeholder: '请直接 @姓名/工号,最多可邀请 5 人',
  78. },
  79. },
  80. {
  81. field: 'disclosure',
  82. component: 'RadioGroup',
  83. label: '目标公开',
  84. colProps: {
  85. span: 16,
  86. },
  87. itemProps: {
  88. extra: '客户、邀评人默认被分享',
  89. },
  90. componentProps: {
  91. options: [
  92. {
  93. label: '公开',
  94. value: '1',
  95. },
  96. {
  97. label: '部分公开',
  98. value: '2',
  99. },
  100. {
  101. label: '不公开',
  102. value: '3',
  103. },
  104. ],
  105. },
  106. },
  107. {
  108. field: 'disclosure',
  109. component: 'Select',
  110. label: ' ',
  111. colProps: {
  112. span: 8,
  113. },
  114. show: ({ model }) => {
  115. return model.disclosure === '2';
  116. },
  117. componentProps: {
  118. placeholder: '公开给',
  119. mode: 'multiple',
  120. options: [
  121. {
  122. label: '同事1',
  123. value: '1',
  124. },
  125. {
  126. label: '同事2',
  127. value: '2',
  128. },
  129. {
  130. label: '同事3',
  131. value: '3',
  132. },
  133. ],
  134. },
  135. },
  136. ];