Commit aff02bc396ca8eb92ba1ef2725735687f0016b0d

Authored by ww
1 parent 45d95317

fix: 定时任务列表任务组名回显&&禁用编辑cron表达式和任务分组

@@ -9,6 +9,14 @@ export enum EJobGroup { @@ -9,6 +9,14 @@ export enum EJobGroup {
9 DEFAULT = 'DEFAULT', 9 DEFAULT = 'DEFAULT',
10 SYSTEM = 'SYSTEM', 10 SYSTEM = 'SYSTEM',
11 REPORT = 'REPORT', 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,12 +24,8 @@ export const personSchema: DescItem[] = [
16 { 24 {
17 field: 'jobGroup', 25 field: 'jobGroup',
18 label: '任务分组:', 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,8 +112,8 @@ export const columnSchedue: BasicColumn[] = [
108 const status = record.status; 112 const status = record.status;
109 const success = status === 1; 113 const success = status === 1;
110 const color = success ? 'green' : 'red'; 114 const color = success ? 'green' : 'red';
111 - const successText: string = '成功';  
112 - const failedText: string = '失败'; 115 + const successText = '成功';
  116 + const failedText = '失败';
113 const text = success ? successText : failedText; 117 const text = success ? successText : failedText;
114 return h(Tag, { color: color }, () => text); 118 return h(Tag, { color: color }, () => text);
115 }, 119 },
1 import { BasicColumn, FormSchema } from '/@/components/Table'; 1 import { BasicColumn, FormSchema } from '/@/components/Table';
2 import type { FormSchema as QFormSchema } from '/@/components/Form/index'; 2 import type { FormSchema as QFormSchema } from '/@/components/Form/index';
3 import { JCronValidator } from '/@/components/Form'; 3 import { JCronValidator } from '/@/components/Form';
4 -import { EJobGroup } from './config.data'; 4 +import { EJobGroup, EJobGroupName } from './config.data';
5 5
6 // 定时任务表格配置 6 // 定时任务表格配置
7 export const columnSchedue: BasicColumn[] = [ 7 export const columnSchedue: BasicColumn[] = [
@@ -14,12 +14,8 @@ export const columnSchedue: BasicColumn[] = [ @@ -14,12 +14,8 @@ export const columnSchedue: BasicColumn[] = [
14 title: '任务组名', 14 title: '任务组名',
15 dataIndex: 'jobGroup', 15 dataIndex: 'jobGroup',
16 width: 120, 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,6 +109,7 @@ export const formSchema: QFormSchema[] = [
113 field: 'jobGroup', 109 field: 'jobGroup',
114 component: 'Select', 110 component: 'Select',
115 label: '任务分组', 111 label: '任务分组',
  112 + dynamicDisabled: true,
116 colProps: { 113 colProps: {
117 span: 24, 114 span: 24,
118 }, 115 },
@@ -120,17 +117,21 @@ export const formSchema: QFormSchema[] = [ @@ -120,17 +117,21 @@ export const formSchema: QFormSchema[] = [
120 placeholder: '请选择任务分组', 117 placeholder: '请选择任务分组',
121 options: [ 118 options: [
122 { 119 {
123 - label: '默认', 120 + label: EJobGroupName.DEFAULT,
124 value: EJobGroup.DEFAULT, 121 value: EJobGroup.DEFAULT,
125 }, 122 },
126 { 123 {
127 - label: '系统', 124 + label: EJobGroupName.SYSTEM,
128 value: EJobGroup.SYSTEM, 125 value: EJobGroup.SYSTEM,
129 }, 126 },
130 { 127 {
131 - label: '报表', 128 + label: EJobGroupName.REPORT,
132 value: EJobGroup.REPORT, 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,6 +154,7 @@ export const formSchema: QFormSchema[] = [
153 label: 'Cron表达式', 154 label: 'Cron表达式',
154 component: 'JEasyCron', 155 component: 'JEasyCron',
155 defaultValue: '* * * * * ? *', 156 defaultValue: '* * * * * ? *',
  157 + dynamicDisabled: true,
156 colProps: { 158 colProps: {
157 span: 24, 159 span: 24,
158 }, 160 },