table.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. const tableConfig = {
  2. // 表格列配置
  3. columns: [
  4. {
  5. label: "序号",
  6. type: "index",
  7. align: "center",
  8. width: 80,
  9. },
  10. {
  11. label: "卡号",
  12. prop: "cardNo",
  13. align: "center",
  14. width: 120,
  15. showOverflowTooltip: true,
  16. },
  17. {
  18. label: "密码",
  19. prop: "password",
  20. align: "center",
  21. width: 100,
  22. },
  23. {
  24. label: "姓名—手机",
  25. prop: "studentInfo",
  26. align: "center",
  27. type: "slot",
  28. slotName: "studentInfo", // 自定义插槽显示姓名-手机
  29. width: 150,
  30. },
  31. {
  32. label: "卡类型",
  33. prop: "type",
  34. align: "center",
  35. type: "dict",
  36. options: [], // 动态设置
  37. width: 100,
  38. },
  39. {
  40. label: "分配学校",
  41. prop: "assignSchoolId",
  42. align: "center",
  43. type: "dict",
  44. options: [], // 动态设置学校选项
  45. width: 120,
  46. },
  47. {
  48. label: "注册学校",
  49. prop: "schoolName",
  50. align: "center",
  51. type: "dict",
  52. options: [], // 动态设置学校选项
  53. width: 120,
  54. },
  55. {
  56. label: "班级",
  57. prop: "classId",
  58. align: "center",
  59. type: "dict",
  60. options: [], // 动态设置班级选项
  61. width: 100,
  62. },
  63. {
  64. label: "校区",
  65. prop: "campusId",
  66. align: "center",
  67. type: "dict",
  68. options: [], // 动态设置校区选项
  69. width: 100,
  70. },
  71. {
  72. label: "校区班级",
  73. prop: "classId",
  74. align: "center",
  75. type: "dict",
  76. options: [], // 动态设置校区班级选项
  77. width: 120,
  78. },
  79. {
  80. label: "分配考生类型",
  81. prop: "assignExamType",
  82. align: "center",
  83. type: "dict",
  84. options: [], // 动态设置
  85. width: 120,
  86. },
  87. {
  88. label: "分配状态",
  89. prop: "distributeStatus",
  90. align: "center",
  91. type: "dict",
  92. options: [], // 动态设置
  93. width: 100,
  94. },
  95. {
  96. label: "使用状态",
  97. prop: "status",
  98. align: "center",
  99. type: "dict",
  100. options: [], // 动态设置
  101. width: 100,
  102. },
  103. {
  104. label: "过期状态",
  105. prop: "timeStatus",
  106. align: "center",
  107. type: "dict",
  108. options: [], // 动态设置
  109. width: 100,
  110. },
  111. {
  112. label: "结算状态",
  113. prop: "isSettlement",
  114. align: "center",
  115. type: "dict",
  116. options: [], // 动态设置
  117. width: 100,
  118. },
  119. {
  120. label: "激活时间",
  121. prop: "activeTime",
  122. align: "center",
  123. type: "time",
  124. format: "{y}-{m}-{d}",
  125. width: 120,
  126. },
  127. {
  128. label: "到期时间",
  129. prop: "outDate",
  130. align: "center",
  131. type: "time",
  132. format: "{y}-{m}-{d}",
  133. width: 120,
  134. },
  135. {
  136. label: "缴费时间",
  137. prop: "payTime",
  138. align: "center",
  139. type: "time",
  140. format: "{y}-{m}-{d}",
  141. width: 120,
  142. },
  143. {
  144. label: "开卡时间",
  145. prop: "openTime",
  146. align: "center",
  147. type: "time",
  148. format: "{y}-{m}-{d}",
  149. width: 120,
  150. },
  151. ],
  152. // 操作按钮配置
  153. actions: [
  154. {
  155. key: "edit",
  156. label: "修改",
  157. type: "primary",
  158. icon: "Edit",
  159. link: true,
  160. permission: ["dz:cards:edit"],
  161. },
  162. {
  163. key: "delete",
  164. label: "删除",
  165. type: "primary",
  166. icon: "Delete",
  167. link: true,
  168. permission: ["dz:cards:remove"],
  169. },
  170. ],
  171. // 表格属性配置
  172. tableProps: {
  173. stripe: true,
  174. border: false,
  175. showSelection: false, // 移除多选列
  176. showIndex: false, // 使用自定义序号列
  177. showPagination: true,
  178. actionWidth: "auto",
  179. // 选择模式配置
  180. selectionMode: "multiple", // 'single' | 'multiple' | 'none'
  181. rowKey: "cardId", // 选择键字段名
  182. },
  183. };
  184. export default tableConfig;