columns.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. {
  5. item: { key: "year", title: "年度", require: true },
  6. attr: {
  7. is: "el-date-picker",
  8. type: "year",
  9. valueFormat: "yyyy-MM-dd",
  10. },
  11. },
  12. {
  13. item: { key: "name", title: "模板名称", require: true },
  14. attr: { is: "el-input" },
  15. },
  16. {
  17. item: { key: "startTime", title: "开始日期", require: true },
  18. attr: {
  19. is: "el-date-picker",
  20. valueFormat: "yyyy-MM-dd",
  21. },
  22. },
  23. {
  24. item: { key: "deadlineTime", title: "结束日期", require: true },
  25. attr: {
  26. is: "el-date-picker",
  27. valueFormat: "yyyy-MM-dd",
  28. },
  29. },
  30. {
  31. item: { key: "cycle", title: "周期", require: true },
  32. attr: {
  33. is: "el-select",
  34. dictName: "mk_periodic_unit",
  35. },
  36. },
  37. {
  38. item: { key: "unfold", title: "按列展开"},
  39. attr: {
  40. is: "el-select",
  41. dictName: "mk_expansion_mode",
  42. clearable: true,
  43. },
  44. },
  45. ].map(({ item, attr }) => ({
  46. attr,
  47. item: { ...item, hidden: true, span: item.span || 6 },
  48. }));
  49. const TabColumns = [
  50. {
  51. item: {
  52. title: "指标",
  53. key: "indexs",
  54. },
  55. attr: {
  56. value: [],
  57. },
  58. TableColumns: [
  59. {
  60. item: { key: "target", title: "指标", width: 'auto' },
  61. attr: {
  62. is: "el-select",
  63. dictName: "mk_index_type",
  64. },
  65. },
  66. ],
  67. },
  68. {
  69. item: {
  70. title: "维度",
  71. key: "dimensionalitys"
  72. },
  73. attr: {
  74. value: [],
  75. },
  76. TableColumns: [
  77. {
  78. item: { key: "dimensionality", title: "维度", width: 'auto' },
  79. attr: {
  80. is: "el-select",
  81. dictName: "mk_dimensionality",
  82. },
  83. },
  84. ],
  85. },
  86. {
  87. item: {
  88. title: "周期",
  89. key: "cycles",
  90. },
  91. attr: {
  92. value: [],
  93. },
  94. TableColumns: [
  95. {
  96. item: { key: "name", title: "周期名称", require: true },
  97. attr: { is: "el-input" },
  98. },
  99. {
  100. item: {
  101. key: "startTime",
  102. title: "周期开始日期",
  103. require: true,
  104. },
  105. attr: {
  106. is: "el-date-picker",
  107. // valueFormat: "yyyy-MM-dd",
  108. // value: new Date(),
  109. },
  110. },
  111. {
  112. item: {
  113. key: "deadlineTime",
  114. title: "周期结束日期",
  115. require: true,
  116. width: 'auto'
  117. },
  118. attr: {
  119. is: "el-date-picker",
  120. // valueFormat: "yyyy-MM-dd",
  121. // value: new Date(),
  122. },
  123. },
  124. ],
  125. },
  126. ];
  127. return { TableColumns, TabColumns };
  128. }