Commit b7e4e8e673985c94e6810150b1fd46b230751cd7
1 parent
a6a4d377
fix:DEFECT-606 修复报表设置的定时任务,每天10点,任务详细信息下次执行时间错误
Showing
2 changed files
with
28 additions
and
3 deletions
@@ -12,6 +12,8 @@ enum ReportManagerApi { | @@ -12,6 +12,8 @@ enum ReportManagerApi { | ||
12 | JOB_LOG_PAGE_API = '/monitor/jobLog/page', | 12 | JOB_LOG_PAGE_API = '/monitor/jobLog/page', |
13 | DELETE_LOG_API = '/monitor/jobLog', | 13 | DELETE_LOG_API = '/monitor/jobLog', |
14 | POST_LOG_CLEAN_API = '/monitor/jobLog/clean', | 14 | POST_LOG_CLEAN_API = '/monitor/jobLog/clean', |
15 | + QUERY_CORN_API = '/monitor/job/queryCronExpression/', | ||
16 | + CHECK_CORN_API = '/monitor/job/checkCron/', | ||
15 | } | 17 | } |
16 | 18 | ||
17 | //分页 | 19 | //分页 |
@@ -57,7 +59,21 @@ export const putSchedueByidAndStatusManage = (id, status) => { | @@ -57,7 +59,21 @@ export const putSchedueByidAndStatusManage = (id, status) => { | ||
57 | //执行一次 | 59 | //执行一次 |
58 | export const postRunSchedueConfigManage = (id) => { | 60 | export const postRunSchedueConfigManage = (id) => { |
59 | return defHttp.post<ReportModel>({ | 61 | return defHttp.post<ReportModel>({ |
60 | - url: ReportManagerApi.RUN_REPORT_API+'/'+id, | 62 | + url: ReportManagerApi.RUN_REPORT_API + '/' + id, |
63 | + }); | ||
64 | +}; | ||
65 | + | ||
66 | +// 查询cron表达式近5次的执行时间 | ||
67 | +export const schedueQueryCornTimeApi = (corn) => { | ||
68 | + return defHttp.get({ | ||
69 | + url: ReportManagerApi.QUERY_CORN_API + corn, | ||
70 | + }); | ||
71 | +}; | ||
72 | + | ||
73 | +// 检查cron表达式是否有效 | ||
74 | +export const schedueCheckCornApi = (corn) => { | ||
75 | + return defHttp.get({ | ||
76 | + url: ReportManagerApi.CHECK_CORN_API + corn, | ||
61 | }); | 77 | }); |
62 | }; | 78 | }; |
63 | 79 |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <div> | 2 | <div> |
3 | <BasicModal | 3 | <BasicModal |
4 | v-bind="$attrs" | 4 | v-bind="$attrs" |
5 | - width="62rem" | 5 | + width="80rem" |
6 | :height="heightNum" | 6 | :height="heightNum" |
7 | @register="register" | 7 | @register="register" |
8 | title="任务详细信息" | 8 | title="任务详细信息" |
@@ -22,21 +22,30 @@ | @@ -22,21 +22,30 @@ | ||
22 | import { personSchema } from './config.data'; | 22 | import { personSchema } from './config.data'; |
23 | import { Description } from '/@/components/Description/index'; | 23 | import { Description } from '/@/components/Description/index'; |
24 | import { useDescription } from '/@/components/Description'; | 24 | import { useDescription } from '/@/components/Description'; |
25 | + import { schedueQueryCornTimeApi, schedueCheckCornApi } from '/@/api/schedue/schedueManager'; | ||
25 | 26 | ||
26 | const heightNum = ref(800); | 27 | const heightNum = ref(800); |
28 | + const timeData: any = ref([]); | ||
27 | let personData = reactive({}); | 29 | let personData = reactive({}); |
28 | const [registeDesc, { setDescProps }] = useDescription({ | 30 | const [registeDesc, { setDescProps }] = useDescription({ |
29 | data: personData, | 31 | data: personData, |
30 | schema: personSchema, | 32 | schema: personSchema, |
31 | column: 3, | 33 | column: 3, |
32 | }); | 34 | }); |
33 | - const [register] = useModalInner((data) => { | 35 | + const [register] = useModalInner(async (data) => { |
36 | + console.log(data.record.cronExpression); | ||
37 | + const resuCheck = await schedueCheckCornApi(encodeURIComponent(data.record.cronExpression)); | ||
38 | + if (resuCheck) { | ||
39 | + const resu = await schedueQueryCornTimeApi(encodeURIComponent(data.record.cronExpression)); | ||
40 | + timeData.value = resu.data; | ||
41 | + } | ||
34 | nextTick(() => { | 42 | nextTick(() => { |
35 | //回显 | 43 | //回显 |
36 | for (let i in data.record) { | 44 | for (let i in data.record) { |
37 | Reflect.set(personData, i, data.record[i]); | 45 | Reflect.set(personData, i, data.record[i]); |
38 | } | 46 | } |
39 | setDescProps(personData); | 47 | setDescProps(personData); |
48 | + Reflect.set(personData, 'updateTime', timeData.value.join(',')); | ||
40 | }); | 49 | }); |
41 | }); | 50 | }); |
42 | const handleCancel = () => {}; | 51 | const handleCancel = () => {}; |