From 15c01c5d926f15830da25d565f9db2250aa4f935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=9A=82=E8=9A=81=E4=BA=91?= Date: Sat, 12 Sep 2026 19:19:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=85=A5=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - ui/src/api/monitor/dataSource.ts | 65 ++++++ ui/src/views/monitor/job/log/columns.ts | 84 ++++++++ ui/src/views/monitor/job/log/edit.vue | 122 +++++++++++ ui/src/views/monitor/job/log/edit2.vue | 116 ++++++++++ ui/src/views/monitor/job/log/index.vue | 215 +++++++++++++++++++ ui/src/views/monitor/job/log/querySchemas.ts | 30 +++ 7 files changed, 632 insertions(+), 1 deletion(-) create mode 100644 ui/src/api/monitor/dataSource.ts create mode 100644 ui/src/views/monitor/job/log/columns.ts create mode 100644 ui/src/views/monitor/job/log/edit.vue create mode 100644 ui/src/views/monitor/job/log/edit2.vue create mode 100644 ui/src/views/monitor/job/log/index.vue create mode 100644 ui/src/views/monitor/job/log/querySchemas.ts diff --git a/.gitignore b/.gitignore index e1abe4a..b71c9fe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ .vscode/ vender/ # 业务模块 log 目录(src/modules/log)须入库,特例排除 -log/ !src/modules/log/ composer.lock gitpush.sh diff --git a/ui/src/api/monitor/dataSource.ts b/ui/src/api/monitor/dataSource.ts new file mode 100644 index 0000000..6fcbf0e --- /dev/null +++ b/ui/src/api/monitor/dataSource.ts @@ -0,0 +1,65 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 列表 + */ +export function getDataSourceList(params?) { + return http.request({ + url: '/data/source/page', + method: 'GET', + params, + }); +} + +/** + * @description: 根据ID获取详情 + */ +export function getDataSourceDetail(id) { + return http.request({ + url: '/data/source/detail/' + id, + method: 'get', + }); +} + +/** + * @description: 添加 + */ +export function dataSourceAdd(data: any) { + return http.request({ + url: '/data/source/add', + method: 'POST', + data, + }); +} + +/** + * @description: 更新 + */ +export function dataSourceUpdate(data: any) { + return http.request({ + url: '/data/source/update', + method: 'PUT', + data, + }); +} + +/** + * @description: 删除 + */ +export function dataSourceDelete(id) { + return http.request({ + url: '/data/source/delete/' + id, + method: 'DELETE', + }); +} + +/** + * @description: 批量删除 + */ +export function dataSourceBatchDelete(data: any) { + return http.request({ + url: '/data/source/batchDelete', + method: 'DELETE', + data, + }); +} diff --git a/ui/src/views/monitor/job/log/columns.ts b/ui/src/views/monitor/job/log/columns.ts new file mode 100644 index 0000000..f9c131c --- /dev/null +++ b/ui/src/views/monitor/job/log/columns.ts @@ -0,0 +1,84 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: 'ID', + prop: 'id', + fixed: 'left', + width: 100, + }, + { + label: '任务名称', + prop: 'jobName', + minWidth: 200, + }, + { + label: '任务组名', + prop: 'jobGroup', + minWidth: 100, + }, + { + label: '任务触发器', + prop: 'jobTrigger', + minWidth: 200, + }, + { + label: '任务日志信息', + prop: 'jobMessage', + minWidth: 300, + }, + { + label: '执行表达式', + prop: 'cronExpression', + minWidth: 150, + }, + { + label: '执行状态', + prop: 'status', + minWidth: 100, + render(record) { + let typeText = ''; + switch (record.row.status) { + case 0: + typeText = '未发布'; + break; + case 1: + typeText = '运行中'; + break; + case 2: + typeText = '暂停'; + break; + case 3: + typeText = '删除'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + label: '任务开始时间', + prop: 'startTime', + minWidth: 180, + }, + { + label: '任务结束时间', + prop: 'endTime', + minWidth: 180, + }, + { + label: '任务执行时间', + prop: 'createTime', + minWidth: 180, + }, + { + label: '任务执行耗时', + prop: 'consumeTime', + minWidth: 120, + }, +]; diff --git a/ui/src/views/monitor/job/log/edit.vue b/ui/src/views/monitor/job/log/edit.vue new file mode 100644 index 0000000..24f0372 --- /dev/null +++ b/ui/src/views/monitor/job/log/edit.vue @@ -0,0 +1,122 @@ + + + diff --git a/ui/src/views/monitor/job/log/edit2.vue b/ui/src/views/monitor/job/log/edit2.vue new file mode 100644 index 0000000..70ebf8e --- /dev/null +++ b/ui/src/views/monitor/job/log/edit2.vue @@ -0,0 +1,116 @@ + + diff --git a/ui/src/views/monitor/job/log/index.vue b/ui/src/views/monitor/job/log/index.vue new file mode 100644 index 0000000..725b4fa --- /dev/null +++ b/ui/src/views/monitor/job/log/index.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/ui/src/views/monitor/job/log/querySchemas.ts b/ui/src/views/monitor/job/log/querySchemas.ts new file mode 100644 index 0000000..40e5827 --- /dev/null +++ b/ui/src/views/monitor/job/log/querySchemas.ts @@ -0,0 +1,30 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'jobName', + component: 'Input', + label: '任务名称', + componentProps: { + placeholder: '请输入任务名称', + }, + }, + { + field: 'status', + component: 'Select', + label: '任务状态', + componentProps: { + placeholder: '请选择任务状态', + clearable: true, + options: [ + { + label: '正常', + value: 0, + }, + { + label: '失败', + value: 1, + }, + ], + }, + }, +];