columns.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. { item: { key: "year", title: "年度" }, attr: {} },
  5. { item: { key: "name", title: "模板名称" }, attr: {} },
  6. { item: { key: "startTime", title: "开始日期" }, attr: {} },
  7. { item: { key: "deadlineTime", title: "结束日期" }, attr: {} },
  8. {
  9. item: { key: "cycle", title: "周期" },
  10. attr: { is: "el-dict-tag", dictName: "mk_periodic_unit" },
  11. },
  12. {
  13. item: { key: "unfold", title: "按列展开" },
  14. attr: { is: "el-dict-tag", dictName: "mk_expansion_mode" },
  15. },
  16. { item: { key: "createByName", title: "创建人" }, attr: {} },
  17. { item: { key: "createTime", title: "创建时间" }, attr: {} },
  18. { item: { key: "updateByName", title: "修改人" }, attr: {} },
  19. { item: { key: "updateTime", title: "修改时间" }, attr: {} },
  20. ].map(({ item, attr }) => ({
  21. attr,
  22. item: { ...item, hidden: true, fixed: false },
  23. }));
  24. const SearchColumns = [
  25. { item: { key: "year", title: "年度",},attr: {
  26. is: "el-date-picker",
  27. type: "year",
  28. valueFormat: "yyyy-MM-dd",
  29. }, },
  30. { item: { key: "name", title: "模板名称"},attr: { is: "el-input" }, },
  31. ].map(({ item, attr }) => ({
  32. attr,
  33. item: { ...item, hidden: true, span: item.span || 6 },
  34. }));
  35. return { TableColumns, SearchColumns };
  36. }