quartz.data.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { render } from '/@/utils/common/renderUtils';
  3. import { JCronValidator } from '/@/components/Form';
  4. export const columns: BasicColumn[] = [
  5. {
  6. title: '任务类名',
  7. dataIndex: 'jobClassName',
  8. width: 200,
  9. align: 'left',
  10. },
  11. {
  12. title: 'Cron表达式',
  13. dataIndex: 'cronExpression',
  14. width: 200,
  15. },
  16. {
  17. title: '参数',
  18. dataIndex: 'parameter',
  19. width: 200,
  20. },
  21. {
  22. title: '描述',
  23. dataIndex: 'description',
  24. width: 200,
  25. },
  26. {
  27. title: '状态',
  28. dataIndex: 'status',
  29. width: 100,
  30. customRender: ({ text }) => {
  31. const color = text == '0' ? 'green' : text == '-1' ? 'red' : 'gray';
  32. return render.renderTag(render.renderDict(text, 'quartz_status'), color);
  33. },
  34. },
  35. ];
  36. export const searchFormSchema: FormSchema[] = [
  37. {
  38. field: 'jobClassName',
  39. label: '任务类名',
  40. component: 'Input',
  41. colProps: { span: 8 },
  42. },
  43. {
  44. field: 'status',
  45. label: '任务状态',
  46. component: 'JDictSelectTag',
  47. componentProps: {
  48. dictCode: 'quartz_status',
  49. stringToNumber: true,
  50. },
  51. colProps: { span: 8 },
  52. },
  53. ];
  54. export const formSchema: FormSchema[] = [
  55. {
  56. field: 'id',
  57. label: 'id',
  58. component: 'Input',
  59. show: false,
  60. },
  61. {
  62. field: 'jobClassName',
  63. label: '任务类名',
  64. component: 'Input',
  65. required: true,
  66. },
  67. {
  68. label: '系统类型',
  69. field: 'jobSysType',
  70. component: 'JDictSelectTag',
  71. componentProps: {
  72. dictCode: 'jobSysType',
  73. placeholder: '请选择系统类型',
  74. },
  75. },
  76. {
  77. field: 'cronExpression',
  78. label: 'Cron表达式',
  79. component: 'JEasyCron',
  80. defaultValue: '* * * * * ? *',
  81. rules: [{ required: true, message: '请输入Cron表达式' }, { validator: JCronValidator }],
  82. },
  83. {
  84. field: 'paramterType',
  85. label: '参数类型',
  86. component: 'Select',
  87. defaultValue: 'string',
  88. componentProps: {
  89. options: [
  90. { label: '字符串', value: 'string' },
  91. { label: 'JSON对象', value: 'json' },
  92. ],
  93. },
  94. },
  95. {
  96. field: 'parameter',
  97. label: '参数',
  98. component: 'InputTextArea',
  99. ifShow: ({ values }) => {
  100. return values.paramterType == 'string';
  101. },
  102. },
  103. {
  104. field: 'parameter',
  105. label: '参数',
  106. component: 'JAddInput',
  107. helpMessage: '键值对形式填写',
  108. ifShow: ({ values }) => {
  109. return values.paramterType == 'json';
  110. },
  111. },
  112. {
  113. field: 'status',
  114. label: '状态',
  115. component: 'JDictSelectTag',
  116. componentProps: {
  117. dictCode: 'quartz_status',
  118. type: 'radioButton',
  119. stringToNumber: true,
  120. dropdownStyle: {
  121. maxHeight: '6vh',
  122. },
  123. },
  124. },
  125. {
  126. field: 'description',
  127. label: '描述',
  128. component: 'InputTextArea',
  129. },
  130. ];