From 7ee745b7c3ae9aa9eb98eb3070ae4f6a7f384786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=8C=E7=83=A8?= Date: Tue, 1 Mar 2022 17:43:58 +0800 Subject: [PATCH] update cronjob --- src/api/monitor/job.js | 34 +++---- src/views/monitor/job/index.vue | 156 ++++++-------------------------- src/views/monitor/job/log.vue | 27 +----- 3 files changed, 46 insertions(+), 171 deletions(-) diff --git a/src/api/monitor/job.js b/src/api/monitor/job.js index 58c4343..4666455 100644 --- a/src/api/monitor/job.js +++ b/src/api/monitor/job.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 查询定时任务调度列表 export function listJob(query) { return request({ - url: '/monitor/job/list', + url: '/api/v1/monitor/cronJob/list', method: 'get', params: query }) @@ -12,7 +12,7 @@ export function listJob(query) { // 查询定时任务调度详细 export function getJob(jobId) { return request({ - url: '/monitor/job/' + jobId, + url: '/api/v1/monitor/cronJob/' + jobId, method: 'get' }) } @@ -20,7 +20,7 @@ export function getJob(jobId) { // 新增定时任务调度 export function addJob(data) { return request({ - url: '/monitor/job', + url: '/api/v1/monitor/cronJob/create', method: 'post', data: data }) @@ -29,37 +29,29 @@ export function addJob(data) { // 修改定时任务调度 export function updateJob(data) { return request({ - url: '/monitor/job', + url: '/api/v1/monitor/cronJob/modify', method: 'put', data: data }) } // 删除定时任务调度 -export function delJob(jobId) { +export function delJob(jobId, funcAlias) { return request({ - url: '/monitor/job/' + jobId, + url: `/api/v1/monitor/cronJob/${jobId}/${funcAlias}`, method: 'delete' }) } -// 导出定时任务调度 -export function exportJob(query) { - return request({ - url: '/monitor/job/export', - method: 'get', - params: query - }) -} - // 任务状态修改 -export function changeJobStatus(jobId, status) { +export function changeJobStatus(jobId, funcAlias, status) { const data = { jobId, + funcAlias, status } return request({ - url: '/monitor/job/changeStatus', + url: '/api/v1/monitor/cronJob/changeStatus', method: 'put', data: data }) @@ -67,14 +59,14 @@ export function changeJobStatus(jobId, status) { // 定时任务立即执行一次 -export function runJob(jobId, jobGroup) { +export function runJob(jobId, funcAlias) { const data = { jobId, - jobGroup + funcAlias } return request({ - url: '/monitor/job/run', + url: '/api/v1/monitor/cronJob/run', method: 'put', data: data }) -} \ No newline at end of file +} diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 2a32ca7..67ea733 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -10,16 +10,6 @@ @keyup.enter.native="handleQuery" /> - - - - - 新增 + > 修改 + > 删除 - - - 导出 + > 日志 + > - + - - - + + @@ -114,18 +87,18 @@