From 407bc88ee1f26330d317afcfe83b5e06b5431d98 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 29 Jul 2022 01:25:44 +0800 Subject: [PATCH 1/3] refactor: Job crontab components --- yudao-ui-admin-vue3/src/api/bpm/task/index.ts | 10 +- .../src/api/infra/job/index.ts | 8 +- .../src/api/infra/job/types.ts | 1 - .../src/components/Crontab/index.ts | 3 +- .../src/components/Crontab/src/Crontab.vue | 1025 +++++++++++++++++ .../components/Crontab/src/components/day.vue | 173 --- .../Crontab/src/components/hour.vue | 120 -- .../Crontab/src/components/index.ts | 19 - .../components/Crontab/src/components/min.vue | 120 -- .../Crontab/src/components/month.vue | 120 -- .../Crontab/src/components/result.vue | 573 --------- .../Crontab/src/components/second.vue | 120 -- .../Crontab/src/components/week.vue | 223 ---- .../Crontab/src/components/year.vue | 139 --- .../src/components/Crontab/src/index.vue | 437 ------- .../src/views/infra/job/index.vue | 50 +- .../src/views/infra/job/job.data.ts | 8 +- 17 files changed, 1090 insertions(+), 2059 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/day.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/hour.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/index.ts delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/min.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/month.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/result.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/second.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/week.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/components/year.vue delete mode 100644 yudao-ui-admin-vue3/src/components/Crontab/src/index.vue diff --git a/yudao-ui-admin-vue3/src/api/bpm/task/index.ts b/yudao-ui-admin-vue3/src/api/bpm/task/index.ts index 7967f5e37..c663a4321 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/task/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/task/index.ts @@ -11,22 +11,22 @@ export const getDoneTaskPage = async (params) => { } export const completeTask = async (data) => { - return await request.put({ url: '/bpm/task/complete', data: data }) + return await request.put({ url: '/bpm/task/complete', data }) } export const approveTask = async (data) => { - return await request.put({ url: '/bpm/task/approve', data: data }) + return await request.put({ url: '/bpm/task/approve', data }) } export const rejectTask = async (data) => { - return await request.put({ url: '/bpm/task/reject', data: data }) + return await request.put({ url: '/bpm/task/reject', data }) } export const backTask = async (data) => { - return await request.put({ url: '/bpm/task/back', data: data }) + return await request.put({ url: '/bpm/task/back', data }) } export const updateTaskAssignee = async (data) => { - return await request.put({ url: '/bpm/task/update-assignee', data: data }) + return await request.put({ url: '/bpm/task/update-assignee', data }) } export const getTaskListByProcessInstanceId = async (processInstanceId) => { diff --git a/yudao-ui-admin-vue3/src/api/infra/job/index.ts b/yudao-ui-admin-vue3/src/api/infra/job/index.ts index bf1193194..985562da6 100644 --- a/yudao-ui-admin-vue3/src/api/infra/job/index.ts +++ b/yudao-ui-admin-vue3/src/api/infra/job/index.ts @@ -19,8 +19,8 @@ export const createJobApi = (data: JobVO) => { } // 修改定时任务调度 -export const updateJobApi = (params: JobVO) => { - return request.put({ url: '/infra/job/update', params }) +export const updateJobApi = (data: JobVO) => { + return request.put({ url: '/infra/job/update', data }) } // 删除定时任务调度 @@ -35,11 +35,11 @@ export const exportJobApi = (params) => { // 任务状态修改 export const updateJobStatusApi = (id: number, status: number) => { - const data = { + const params = { id, status } - return request.put({ url: '/infra/job/update-status', data: data }) + return request.put({ url: '/infra/job/update-status', params }) } // 定时任务立即执行一次 diff --git a/yudao-ui-admin-vue3/src/api/infra/job/types.ts b/yudao-ui-admin-vue3/src/api/infra/job/types.ts index a608b6f67..5a3b74fd7 100644 --- a/yudao-ui-admin-vue3/src/api/infra/job/types.ts +++ b/yudao-ui-admin-vue3/src/api/infra/job/types.ts @@ -8,5 +8,4 @@ export type JobVO = { retryCount: number retryInterval: number monitorTimeout: number - createTime: string } diff --git a/yudao-ui-admin-vue3/src/components/Crontab/index.ts b/yudao-ui-admin-vue3/src/components/Crontab/index.ts index a91f929d3..6beeef864 100644 --- a/yudao-ui-admin-vue3/src/components/Crontab/index.ts +++ b/yudao-ui-admin-vue3/src/components/Crontab/index.ts @@ -1,3 +1,2 @@ -import Crontab from './src/index.vue' - +import Crontab from './src/Crontab.vue' export { Crontab } diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue new file mode 100644 index 000000000..96ae7cad5 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/Crontab/src/Crontab.vue @@ -0,0 +1,1025 @@ + + + + + diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/day.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/day.vue deleted file mode 100644 index 7186baf35..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/day.vue +++ /dev/null @@ -1,173 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/hour.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/hour.vue deleted file mode 100644 index e258572ed..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/hour.vue +++ /dev/null @@ -1,120 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/index.ts b/yudao-ui-admin-vue3/src/components/Crontab/src/components/index.ts deleted file mode 100644 index bc95ebd24..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import CrontabSecond from './second.vue' -import CrontabMin from './min.vue' -import CrontabHour from './hour.vue' -import CrontabDay from './day.vue' -import CrontabMonth from './month.vue' -import CrontabWeek from './week.vue' -import CrontabYear from './year.vue' -import CrontabResult from './result.vue' - -export { - CrontabSecond, - CrontabMin, - CrontabHour, - CrontabDay, - CrontabMonth, - CrontabWeek, - CrontabYear, - CrontabResult -} diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/min.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/min.vue deleted file mode 100644 index 491749e0e..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/min.vue +++ /dev/null @@ -1,120 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/month.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/month.vue deleted file mode 100644 index 8b0669a93..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/month.vue +++ /dev/null @@ -1,120 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/result.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/result.vue deleted file mode 100644 index 37e2aec99..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/result.vue +++ /dev/null @@ -1,573 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/second.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/second.vue deleted file mode 100644 index f3cf00ae5..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/second.vue +++ /dev/null @@ -1,120 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/week.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/week.vue deleted file mode 100644 index 5a940fa02..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/week.vue +++ /dev/null @@ -1,223 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/components/year.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/components/year.vue deleted file mode 100644 index c17f3f399..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/components/year.vue +++ /dev/null @@ -1,139 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/components/Crontab/src/index.vue b/yudao-ui-admin-vue3/src/components/Crontab/src/index.vue deleted file mode 100644 index e71276bac..000000000 --- a/yudao-ui-admin-vue3/src/components/Crontab/src/index.vue +++ /dev/null @@ -1,437 +0,0 @@ - - - diff --git a/yudao-ui-admin-vue3/src/views/infra/job/index.vue b/yudao-ui-admin-vue3/src/views/infra/job/index.vue index 14742bbe2..2774444e8 100644 --- a/yudao-ui-admin-vue3/src/views/infra/job/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/job/index.vue @@ -1,4 +1,5 @@