feedback.data.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { rules } from '/@/utils/helper/validator';
  4. import { render } from '/@/utils/common/renderUtils';
  5. import { getWeekMonthQuarterYear } from '/@/utils';
  6. import { h } from 'vue';
  7. import { Image } from 'ant-design-vue';
  8. //列表数据
  9. // 反馈类型0-投诉吐槽;1-功能异常;2-用户体验;3-功能建议;4-其他
  10. export const feedbackTypeOptions = ['投诉吐槽', '功能异常', '用户体验', '功能建议', '其他'];
  11. export const columns: BasicColumn[] = [
  12. {
  13. title: '昵称',
  14. align: 'center',
  15. dataIndex: 'userName',
  16. },
  17. {
  18. title: '手机号码',
  19. align: 'center',
  20. dataIndex: 'phone',
  21. },
  22. {
  23. title: '问题类型',
  24. align: 'center',
  25. dataIndex: 'feedbackType',
  26. slots: { customRender: 'type' },
  27. },
  28. {
  29. title: '问题描述',
  30. align: 'center',
  31. dataIndex: 'feedbackDescribed',
  32. },
  33. {
  34. title: '图片',
  35. align: 'center',
  36. dataIndex: 'feedbackImgList',
  37. slots: { customRender: 'img' },
  38. },
  39. {
  40. title: '反馈时间',
  41. align: 'center',
  42. dataIndex: 'createTime',
  43. },
  44. {
  45. title: '回复',
  46. align: 'center',
  47. dataIndex: 'replyContent',
  48. },
  49. ];
  50. //查询数据
  51. export const searchFormSchema: FormSchema[] = [];
  52. //表单数据
  53. export const formSchema: FormSchema[] = [
  54. {
  55. label: '',
  56. field: 'userId',
  57. component: 'Input',
  58. colSlot: 'title1',
  59. labelWidth: 0,
  60. colProps: {
  61. span: 28,
  62. xs: 28,
  63. },
  64. },
  65. // TODO 主键隐藏字段,目前写死为ID
  66. {
  67. label: '',
  68. field: 'id',
  69. component: 'Input',
  70. show: false,
  71. },
  72. {
  73. label: '昵称',
  74. field: 'userName',
  75. component: 'Input',
  76. span: 12,
  77. componentProps: {
  78. readonly: true,
  79. },
  80. },
  81. {
  82. label: '手机号码',
  83. field: 'phone',
  84. component: 'Input',
  85. span: 12,
  86. componentProps: {
  87. readonly: true,
  88. },
  89. },
  90. {
  91. label: '问题类型',
  92. field: 'feedbackName',
  93. component: 'Input',
  94. span: 12,
  95. componentProps: {
  96. readonly: true,
  97. },
  98. },
  99. {
  100. label: '问题描述',
  101. field: 'feedbackDescribed',
  102. component: 'Input',
  103. span: 12,
  104. componentProps: {
  105. readonly: true,
  106. },
  107. },
  108. {
  109. label: '图片',
  110. field: 'feedbackImgList',
  111. component: 'Input',
  112. span: 12,
  113. componentProps: {
  114. readonly: true,
  115. },
  116. render: ({ model, field }) => {
  117. console.log(typeof model[field] == 'object', field);
  118. return h(
  119. 'div',
  120. { class: 'flex item-center justify-around' }, // 外层容器
  121. model[field]?.map((img, idx) =>
  122. h(Image, {
  123. key: idx, // 重要:为循环项添加唯一 key
  124. src: img,
  125. width: 80,
  126. rootClassName: 'mr-4',
  127. })
  128. )
  129. );
  130. },
  131. },
  132. {
  133. label: '反馈时间',
  134. field: 'createTime',
  135. component: 'Input',
  136. span: 12,
  137. componentProps: {
  138. readonly: true,
  139. },
  140. },
  141. {
  142. label: '',
  143. field: '',
  144. component: 'Input',
  145. colSlot: 'title2',
  146. labelWidth: 0,
  147. },
  148. {
  149. label: '回复',
  150. field: 'replyContent',
  151. component: 'InputTextArea',
  152. span: 12,
  153. required: true,
  154. },
  155. ];
  156. /**
  157. * 流程表单调用这个方法获取formSchema
  158. * @param param
  159. */
  160. export function getBpmFormSchema(_formData): FormSchema[] {
  161. // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
  162. return formSchema;
  163. }