Commit aff02bc396ca8eb92ba1ef2725735687f0016b0d
1 parent
45d95317
fix: 定时任务列表任务组名回显&&禁用编辑cron表达式和任务分组
Showing
2 changed files
with
24 additions
and
18 deletions
| ... | ... | @@ -9,6 +9,14 @@ export enum EJobGroup { |
| 9 | 9 | DEFAULT = 'DEFAULT', |
| 10 | 10 | SYSTEM = 'SYSTEM', |
| 11 | 11 | REPORT = 'REPORT', |
| 12 | + TASK_CENTER = 'TASK_CENTER', | |
| 13 | +} | |
| 14 | + | |
| 15 | +export enum EJobGroupName { | |
| 16 | + DEFAULT = '默认', | |
| 17 | + SYSTEM = '系统', | |
| 18 | + REPORT = '报表', | |
| 19 | + TASK_CENTER = '任务中心', | |
| 12 | 20 | } |
| 13 | 21 | |
| 14 | 22 | //任务详细配置 |
| ... | ... | @@ -16,12 +24,8 @@ export const personSchema: DescItem[] = [ |
| 16 | 24 | { |
| 17 | 25 | field: 'jobGroup', |
| 18 | 26 | label: '任务分组:', |
| 19 | - render: (_, data) => { | |
| 20 | - return data.jobGroup == EJobGroup.DEFAULT | |
| 21 | - ? '默认' | |
| 22 | - : data.jobGroup == EJobGroup.SYSTEM | |
| 23 | - ? '系统' | |
| 24 | - : '报表'; | |
| 27 | + render: (value: EJobGroup) => { | |
| 28 | + return EJobGroupName[value]; | |
| 25 | 29 | }, |
| 26 | 30 | }, |
| 27 | 31 | { |
| ... | ... | @@ -108,8 +112,8 @@ export const columnSchedue: BasicColumn[] = [ |
| 108 | 112 | const status = record.status; |
| 109 | 113 | const success = status === 1; |
| 110 | 114 | const color = success ? 'green' : 'red'; |
| 111 | - const successText: string = '成功'; | |
| 112 | - const failedText: string = '失败'; | |
| 115 | + const successText = '成功'; | |
| 116 | + const failedText = '失败'; | |
| 113 | 117 | const text = success ? successText : failedText; |
| 114 | 118 | return h(Tag, { color: color }, () => text); |
| 115 | 119 | }, | ... | ... |
| 1 | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
| 2 | 2 | import type { FormSchema as QFormSchema } from '/@/components/Form/index'; |
| 3 | 3 | import { JCronValidator } from '/@/components/Form'; |
| 4 | -import { EJobGroup } from './config.data'; | |
| 4 | +import { EJobGroup, EJobGroupName } from './config.data'; | |
| 5 | 5 | |
| 6 | 6 | // 定时任务表格配置 |
| 7 | 7 | export const columnSchedue: BasicColumn[] = [ |
| ... | ... | @@ -14,12 +14,8 @@ export const columnSchedue: BasicColumn[] = [ |
| 14 | 14 | title: '任务组名', |
| 15 | 15 | dataIndex: 'jobGroup', |
| 16 | 16 | width: 120, |
| 17 | - format: (_text: string, record: Recordable) => { | |
| 18 | - return record.jobGroup === EJobGroup.DEFAULT | |
| 19 | - ? '默认' | |
| 20 | - : record.jobGroup === EJobGroup.SYSTEM | |
| 21 | - ? '系统' | |
| 22 | - : '报表'; | |
| 17 | + format: (text: string) => { | |
| 18 | + return EJobGroupName[text]; | |
| 23 | 19 | }, |
| 24 | 20 | }, |
| 25 | 21 | { |
| ... | ... | @@ -113,6 +109,7 @@ export const formSchema: QFormSchema[] = [ |
| 113 | 109 | field: 'jobGroup', |
| 114 | 110 | component: 'Select', |
| 115 | 111 | label: '任务分组', |
| 112 | + dynamicDisabled: true, | |
| 116 | 113 | colProps: { |
| 117 | 114 | span: 24, |
| 118 | 115 | }, |
| ... | ... | @@ -120,17 +117,21 @@ export const formSchema: QFormSchema[] = [ |
| 120 | 117 | placeholder: '请选择任务分组', |
| 121 | 118 | options: [ |
| 122 | 119 | { |
| 123 | - label: '默认', | |
| 120 | + label: EJobGroupName.DEFAULT, | |
| 124 | 121 | value: EJobGroup.DEFAULT, |
| 125 | 122 | }, |
| 126 | 123 | { |
| 127 | - label: '系统', | |
| 124 | + label: EJobGroupName.SYSTEM, | |
| 128 | 125 | value: EJobGroup.SYSTEM, |
| 129 | 126 | }, |
| 130 | 127 | { |
| 131 | - label: '报表', | |
| 128 | + label: EJobGroupName.REPORT, | |
| 132 | 129 | value: EJobGroup.REPORT, |
| 133 | 130 | }, |
| 131 | + { | |
| 132 | + label: EJobGroupName.TASK_CENTER, | |
| 133 | + value: EJobGroup.TASK_CENTER, | |
| 134 | + }, | |
| 134 | 135 | ], |
| 135 | 136 | }, |
| 136 | 137 | }, |
| ... | ... | @@ -153,6 +154,7 @@ export const formSchema: QFormSchema[] = [ |
| 153 | 154 | label: 'Cron表达式', |
| 154 | 155 | component: 'JEasyCron', |
| 155 | 156 | defaultValue: '* * * * * ? *', |
| 157 | + dynamicDisabled: true, | |
| 156 | 158 | colProps: { |
| 157 | 159 | span: 24, |
| 158 | 160 | }, | ... | ... |