Commit b7e4e8e673985c94e6810150b1fd46b230751cd7

Authored by fengtao
1 parent a6a4d377

fix:DEFECT-606 修复报表设置的定时任务,每天10点,任务详细信息下次执行时间错误

... ... @@ -12,6 +12,8 @@ enum ReportManagerApi {
12 12 JOB_LOG_PAGE_API = '/monitor/jobLog/page',
13 13 DELETE_LOG_API = '/monitor/jobLog',
14 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 59 //执行一次
58 60 export const postRunSchedueConfigManage = (id) => {
59 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 2 <div>
3 3 <BasicModal
4 4 v-bind="$attrs"
5   - width="62rem"
  5 + width="80rem"
6 6 :height="heightNum"
7 7 @register="register"
8 8 title="任务详细信息"
... ... @@ -22,21 +22,30 @@
22 22 import { personSchema } from './config.data';
23 23 import { Description } from '/@/components/Description/index';
24 24 import { useDescription } from '/@/components/Description';
  25 + import { schedueQueryCornTimeApi, schedueCheckCornApi } from '/@/api/schedue/schedueManager';
25 26
26 27 const heightNum = ref(800);
  28 + const timeData: any = ref([]);
27 29 let personData = reactive({});
28 30 const [registeDesc, { setDescProps }] = useDescription({
29 31 data: personData,
30 32 schema: personSchema,
31 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 42 nextTick(() => {
35 43 //回显
36 44 for (let i in data.record) {
37 45 Reflect.set(personData, i, data.record[i]);
38 46 }
39 47 setDescProps(personData);
  48 + Reflect.set(personData, 'updateTime', timeData.value.join(','));
40 49 });
41 50 });
42 51 const handleCancel = () => {};
... ...