content.config.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* eslint-disable prettier/prettier */
  2. import { BeforeRequestType, ContentConfig } from "/@/components/PageContent";
  3. import apis from "./apis";
  4. import { h } from "vue";
  5. import { ElTag } from "element-plus";
  6. const statusOptions = [
  7. { value: 1, label: '待执行', type: "info" },
  8. { value: 2, label: '执行完成', type: "success" },
  9. { value: 3, label: '执行失败', type: 'danger' },
  10. ]
  11. const exceTypeOptions = [
  12. { value: 1, label: '立即执行', type: "" },
  13. { value: 2, label: '延迟执行', type: "warning" },
  14. ]
  15. const columns = [
  16. {
  17. prop: "exec_name",
  18. label: "业务表名称",
  19. minWidth: "115px"
  20. },
  21. {
  22. prop: "start",
  23. label: "数据开始时间",
  24. minWidth: "155px"
  25. },
  26. {
  27. prop: "end",
  28. label: "数据结束时间",
  29. minWidth: "155px"
  30. },
  31. {
  32. prop: "updatetime",
  33. label: "状态更新时间",
  34. minWidth: "155px"
  35. },
  36. {
  37. prop: "createtime",
  38. label: "创建时间",
  39. minWidth: "115px"
  40. },
  41. {
  42. prop: 'exce_type',
  43. label: '执行类型',
  44. cellRenderer({ row }) {
  45. const s = exceTypeOptions.find(({ value }) => String(value) === String(row.exec_type))
  46. return h(ElTag, {
  47. type: s.type || ''
  48. }, {
  49. default: () => s.label || '--'
  50. })
  51. }
  52. },
  53. {
  54. prop: 'status',
  55. label: '状态',
  56. cellRenderer({ row }) {
  57. const s = statusOptions.find(({ value }) => String(value) === String(row.status))
  58. return h(ElTag, {
  59. type: s.type || ''
  60. }, {
  61. default: () => s.label || '--'
  62. })
  63. }
  64. },
  65. // {
  66. // prop: "departName",
  67. // label: "部门名称",
  68. // minWidth: "155px"
  69. // },
  70. {
  71. prop: "apply_name",
  72. label: "申请人",
  73. minWidth: "80px"
  74. },
  75. {
  76. label: "操作",
  77. fixed: "right",
  78. width: 90,
  79. slot: "operation"
  80. }
  81. ];
  82. const contentConfig: ContentConfig = {
  83. columns,
  84. showTitle: false,
  85. superUserNoAction: false,
  86. apis: { httpList: apis.list }
  87. };
  88. export default contentConfig;