From d4a521aaf07a0eb7c13e6999347455e3ec23b2e5 Mon Sep 17 00:00:00 2001 From: lzq <2495532633@qq.com> Date: Fri, 19 Dec 2025 10:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/sys/task/Task.vue | 19 +++++--- src/pages/sys/task/execute-log/Executelog.vue | 21 +++++++-- .../sys/task/execute-log/execute-log.d.ts | 14 +----- .../task/schedule-recode/ScheduleRecode.vue | 46 ++++++++++++++++--- .../task/schedule-recode/schedule-recode.d.ts | 12 ----- 5 files changed, 71 insertions(+), 41 deletions(-) diff --git a/src/pages/sys/task/Task.vue b/src/pages/sys/task/Task.vue index 4a2df0c..82f393e 100644 --- a/src/pages/sys/task/Task.vue +++ b/src/pages/sys/task/Task.vue @@ -12,12 +12,15 @@ placeholder="任务执行函数"/> - + @@ -115,7 +118,7 @@ import ScheduleRecodePanel from '@/pages/sys/task/schedule-recode/ScheduleRecode import Times from '@/common/utils/times.ts' const tableData = ref([]) -const searchForm = reactive({ +const searchForm = ref({ current: 1, size: 20, builtin: false, @@ -138,8 +141,8 @@ const scheduleTypeList = [ ] function pageChangeHandler(currentPage: number, pageSize: number) { - searchForm.current = currentPage - searchForm.size = pageSize + searchForm.value.current = currentPage + searchForm.value.size = pageSize paging() } @@ -183,13 +186,17 @@ function addHandler() { } function reset() { - Object.assign(searchForm, {}) + searchForm.value = { + current: 1, + size: 20, + builtin: false, + } paging() } function paging() { searching.value = true - TaskApi.paging(searchForm) + TaskApi.paging(searchForm.value) .then(res => { tableData.value = res.data?.records ?? [] }) diff --git a/src/pages/sys/task/execute-log/Executelog.vue b/src/pages/sys/task/execute-log/Executelog.vue index d92b0a4..c09a625 100644 --- a/src/pages/sys/task/execute-log/Executelog.vue +++ b/src/pages/sys/task/execute-log/Executelog.vue @@ -8,7 +8,7 @@ end-placeholder="结束" range-separator="至" start-placeholder="开始" - type="daterange" + type="datetimerange" unlink-panels /> @@ -109,6 +109,8 @@ import TaskExecuteLogApi from '@/pages/sys/task/execute-log/execute-log-api.ts' import { elIcons } from '@/common/element/element.ts' import Strings from '@/common/utils/strings.ts' +import Colls from '@/common/utils/colls.ts' +import Times from '@/common/utils/times.ts' const props = defineProps<{ scheduleId: string @@ -125,7 +127,6 @@ const searching = ref(false) const deling = ref(false) const showSearchForm = ref(true) const pagination = reactive({ - total: 0, current: 1, size: 1, }) @@ -191,13 +192,25 @@ function delHandler({row}: { row: TaskExecuteLogTypes.SearchTaskExecuteLogResult function reset() { - searchForm.value = {} + searchForm.value = { + current: 1, + size: 20, + } paging() } function paging() { searching.value = true - TaskExecuteLogApi.paging({...searchForm.value, scheduleId: props.scheduleId}) + const { + logLevel, + logTime, + } = searchForm.value + TaskExecuteLogApi.paging({ + logLevel, + startLogTime: Colls.isEmpty(logTime) ? undefined : Times.format(logTime[0]), + endLogTime: Colls.isEmpty(logTime) ? undefined : Times.format(logTime[1]), + scheduleId: props.scheduleId, + }) .then(res => { tableData.value = res.data?.records ?? [] }) diff --git a/src/pages/sys/task/execute-log/execute-log.d.ts b/src/pages/sys/task/execute-log/execute-log.d.ts index 4807512..4100f37 100644 --- a/src/pages/sys/task/execute-log/execute-log.d.ts +++ b/src/pages/sys/task/execute-log/execute-log.d.ts @@ -3,24 +3,14 @@ export {} declare global { namespace TaskExecuteLogTypes { interface SearchTaskExecuteLogParam extends G.PageParam { - // Id - id?: string // 调度 Id;sys_task_schedule_recode.id scheduleId?: string // 日志等级 logLevel?: string // 日志时间 logTime?: string - // 位置 - place?: string - // 行号 - line?: number - // 日志信息 - msg?: string - // 错误信息 - err?: string - // 创建时间 - createTime?: string + startLogTime?: string + endLogTime?: string } interface SearchTaskExecuteLogResult { diff --git a/src/pages/sys/task/schedule-recode/ScheduleRecode.vue b/src/pages/sys/task/schedule-recode/ScheduleRecode.vue index 0ed4429..4878a42 100644 --- a/src/pages/sys/task/schedule-recode/ScheduleRecode.vue +++ b/src/pages/sys/task/schedule-recode/ScheduleRecode.vue @@ -8,15 +8,25 @@ end-placeholder="结束" range-separator="至" start-placeholder="开始" - type="daterange" + type="datetimerange" unlink-panels /> + + + + + + + + 搜索 重置 @@ -33,7 +43,7 @@ row-key="id"> - + @@ -119,12 +129,18 @@ import TaskScheduleRecodeApi from '@/pages/sys/task/schedule-recode/schedule-rec import { elIcons } from '@/common/element/element.ts' import Times from '@/common/utils/times.ts' import ExecuteLogPanel from '@/pages/sys/task/execute-log/ExecuteLogPanel.vue' +import Colls from '@/common/utils/colls.ts' const executeLogPanelIns = useTemplateRef>('executeLogPanel') const props = defineProps<{ taskId: string }>() +const scheduleTypeList = [ + {value: 'Manually', label: '手动'}, + {value: 'Fixed', label: '固定周期'}, + {value: 'Cron', label: '自定义'}, +] const shortcuts = [ { text: '上周', @@ -176,7 +192,7 @@ const status = [ ] const tableData = ref([]) -const searchForm = reactive({ +const searchForm = ref({ current: 1, size: 20, }) @@ -191,8 +207,8 @@ const pagination = reactive({ }) function pageChangeHandler(currentPage: number, pageSize: number) { - searchForm.current = currentPage - searchForm.size = pageSize + searchForm.value.current = currentPage + searchForm.value.size = pageSize paging() } @@ -209,13 +225,29 @@ function delHandler({row}: { row: TaskScheduleRecodeTypes.SearchTaskScheduleReco } function reset() { - Object.assign(searchForm, {}) + searchForm.value = { + current: 1, + size: 20, + } paging() } function paging() { searching.value = true - TaskScheduleRecodeApi.paging({...searchForm, taskId: props.taskId}) + const { + scheduleType, + scheduleTime, + taskStatus, + manually, + } = searchForm.value + TaskScheduleRecodeApi.paging({ + taskId: props.taskId, + scheduleType, + taskStatus, + manually, + startTime: Colls.isEmpty(scheduleTime) ? undefined : Times.format(scheduleTime[0]), + endTime: Colls.isEmpty(scheduleTime) ? undefined : Times.format(scheduleTime[1]), + }) .then(res => { tableData.value = res.data?.records ?? [] }) diff --git a/src/pages/sys/task/schedule-recode/schedule-recode.d.ts b/src/pages/sys/task/schedule-recode/schedule-recode.d.ts index 0ea5d26..a231fb8 100644 --- a/src/pages/sys/task/schedule-recode/schedule-recode.d.ts +++ b/src/pages/sys/task/schedule-recode/schedule-recode.d.ts @@ -2,18 +2,10 @@ export {} declare global { namespace TaskScheduleRecodeTypes { interface SearchTaskScheduleRecodeParam extends G.PageParam { - // Id - id?: string // 任务 Id taskId?: string - // 任务名称 - taskName?: string - // 任务执行函数 - fn?: string // 调度方式 scheduleType?: string - // 调度配置 - scheduleConf?: string // 调度时间 scheduleTime?: string // 任务开始时间 @@ -22,12 +14,8 @@ declare global { endTime?: string // 任务状态 taskStatus?: string - // 是否为内内置任务 - builtin?: boolean // 本次调度是否为手动触发 manually?: boolean - // 备注 - memo?: string } interface SearchTaskScheduleRecodeResult {