columns.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. export default function useColumns() {
  2. const SearchColumns = [
  3. {
  4. item: { key: "year", title: "年度" },
  5. attr: {
  6. is: "el-date-picker",
  7. type: "year",
  8. valueFormat: "yyyy-MM-dd",
  9. clearable: true,
  10. }
  11. },
  12. {
  13. item: { key: "name", title: "模板名称" },
  14. attr: {
  15. is: "el-input",
  16. clearable: true,
  17. }
  18. },
  19. {
  20. item: { key: "dateRange", title: "开始日期" },
  21. attr: {
  22. is: "el-date-picker",
  23. type: "daterange",
  24. rangeSeparator: "-",
  25. endPlaceholder: "结束",
  26. startPlaceholder: "开始",
  27. valueFormat: "yyyy-MM-dd",
  28. }
  29. },
  30. ];
  31. const TableColumns = [
  32. {
  33. item: { key: "year", title: "年度", width: 100, },
  34. attr: {}
  35. },
  36. {
  37. item: { key: "name", title: "模板名称" },
  38. attr: {}
  39. },
  40. {
  41. item: { key: "startTime", title: "开始日期", },
  42. attr: {}
  43. },
  44. {
  45. item: { key: "deadlineTime", title: "结束日期", },
  46. attr: {}
  47. },
  48. {
  49. item: { key: "cycle", title: "周期", width: 100, },
  50. attr: {
  51. is: "el-dict-tag",
  52. dictName: "mk_periodic_unit",
  53. }
  54. },
  55. {
  56. item: { key: "unfold", title: "按列展开" },
  57. attr: {
  58. is: "el-dict-tag",
  59. dictName: "mk_expansion_mode",
  60. }
  61. },
  62. {
  63. item: { key: "createByName", title: "创建人", width: 120, },
  64. attr: {}
  65. },
  66. {
  67. item: { key: "createTime", title: "创建时间" },
  68. attr: {}
  69. },
  70. {
  71. item: { key: "updateByName", title: "修改人", width: 120, },
  72. attr: {}
  73. },
  74. {
  75. item: { key: "updateTime", title: "修改时间" },
  76. attr: {}
  77. },
  78. ].map(({ item, attr }) => ({
  79. attr,
  80. item: {
  81. ...item,
  82. sortabled: true,
  83. fixedabled: true,
  84. filterabled: true,
  85. hiddenabled: true,
  86. },
  87. }));
  88. return { SearchColumns, TableColumns }
  89. }