quartz.data.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 dataCenterColumns: BasicColumn[] = [
  37. {
  38. title: '任务类名',
  39. dataIndex: 'jobClassName',
  40. width: 200,
  41. align: 'left',
  42. },
  43. {
  44. title: 'Cron表达式',
  45. dataIndex: 'cronExpression',
  46. width: 200,
  47. },
  48. {
  49. title: '参数',
  50. dataIndex: 'parameter',
  51. width: 200,
  52. },
  53. {
  54. title: '系统类型',
  55. dataIndex: 'sysType_dictText',
  56. width: 200,
  57. },
  58. {
  59. title: '描述',
  60. dataIndex: 'description',
  61. width: 200,
  62. },
  63. {
  64. title: '状态',
  65. dataIndex: 'status',
  66. width: 100,
  67. customRender: ({ text }) => {
  68. const color = text == '0' ? 'green' : text == '-1' ? 'red' : 'gray';
  69. return render.renderTag(render.renderDict(text, 'quartz_status'), color);
  70. },
  71. },
  72. ];
  73. export const searchFormSchema: FormSchema[] = [
  74. {
  75. field: 'jobClassName',
  76. label: '任务类名',
  77. component: 'Input',
  78. colProps: { span: 8 },
  79. },
  80. {
  81. field: 'status',
  82. label: '任务状态',
  83. component: 'JDictSelectTag',
  84. componentProps: {
  85. dictCode: 'quartz_status',
  86. stringToNumber: true,
  87. },
  88. colProps: { span: 8 },
  89. },
  90. ];
  91. export const formSchema: FormSchema[] = [
  92. {
  93. field: 'id',
  94. label: 'id',
  95. component: 'Input',
  96. show: false,
  97. },
  98. {
  99. field: 'jobClassName',
  100. label: '任务类名',
  101. component: 'Input',
  102. required: true,
  103. },
  104. {
  105. label: '系统类型',
  106. field: 'sysType',
  107. component: 'JDictSelectTag',
  108. componentProps: {
  109. dictCode: 'jobSysType',
  110. placeholder: '请选择系统类型',
  111. },
  112. required: true,
  113. },
  114. {
  115. field: 'cronExpression',
  116. label: 'Cron表达式',
  117. component: 'JEasyCron',
  118. defaultValue: '* * * * * ? *',
  119. rules: [{ required: true, message: '请输入Cron表达式' }, { validator: JCronValidator }],
  120. },
  121. {
  122. field: 'paramterType',
  123. label: '参数类型',
  124. component: 'Select',
  125. defaultValue: 'string',
  126. componentProps: {
  127. options: [
  128. { label: '字符串', value: 'string' },
  129. { label: 'JSON对象', value: 'json' },
  130. ],
  131. },
  132. },
  133. {
  134. field: 'parameter',
  135. label: '参数',
  136. component: 'InputTextArea',
  137. ifShow: ({ values }) => {
  138. return values.paramterType == 'string';
  139. },
  140. },
  141. {
  142. field: 'parameter',
  143. label: '参数',
  144. component: 'JAddInput',
  145. helpMessage: '键值对形式填写',
  146. ifShow: ({ values }) => {
  147. return values.paramterType == 'json';
  148. },
  149. },
  150. {
  151. field: 'status',
  152. label: '状态',
  153. component: 'JDictSelectTag',
  154. componentProps: {
  155. dictCode: 'quartz_status',
  156. type: 'radioButton',
  157. stringToNumber: true,
  158. dropdownStyle: {
  159. maxHeight: '6vh',
  160. },
  161. },
  162. },
  163. {
  164. field: 'description',
  165. label: '描述',
  166. component: 'InputTextArea',
  167. },
  168. ];