From 0adff62071c1126073b1f94fb33191d2b89d93d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Thu, 28 Nov 2024 13:42:14 +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/views/monitor/job/columns.ts | 73 ++++++ src/views/monitor/job/edit.vue | 236 ++++++++++++++++++ src/views/monitor/job/index.vue | 291 ++++++++++++++++++++++ src/views/monitor/job/log/columns.ts | 58 +++++ src/views/monitor/job/log/edit.vue | 94 +++++++ src/views/monitor/job/log/index.vue | 199 +++++++++++++++ src/views/monitor/job/log/querySchemas.ts | 30 +++ src/views/monitor/job/querySchemas.ts | 38 +++ 8 files changed, 1019 insertions(+) create mode 100644 src/views/monitor/job/columns.ts create mode 100644 src/views/monitor/job/edit.vue create mode 100644 src/views/monitor/job/index.vue create mode 100644 src/views/monitor/job/log/columns.ts create mode 100644 src/views/monitor/job/log/edit.vue create mode 100644 src/views/monitor/job/log/index.vue create mode 100644 src/views/monitor/job/log/querySchemas.ts create mode 100644 src/views/monitor/job/querySchemas.ts diff --git a/src/views/monitor/job/columns.ts b/src/views/monitor/job/columns.ts new file mode 100644 index 0000000..c23ed60 --- /dev/null +++ b/src/views/monitor/job/columns.ts @@ -0,0 +1,73 @@ +import { h } from 'vue'; +import { NTag } from 'naive-ui'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + fixed: 'left', + width: 50, + }, + { + title: '任务名称', + key: 'jobName', + width: 150, + }, + { + title: '任务分组', + key: 'jobGroup', + width: 100, + }, + { + title: '任务触发器', + key: 'jobTrigger', + width: 150, + }, + { + title: '执行表达式', + key: 'cronExpression', + width: 150, + }, + { + title: '执行策略', + key: 'executePolicyText', + width: 100, + }, + { + title: '同步任务', + key: 'isSync', + width: 100, + render(record) { + return h( + NTag, + { + color: record.isSync == 1 ? 'success' : 'info', + }, + { + default: () => (record.isSync == 1 ? '同步' : '异步'), + }, + ); + }, + }, + { + title: 'URL', + key: 'url', + width: 150, + }, + { + title: '状态', + key: 'status', + key: 'status', + width: 100, + }, + { + title: '备注', + key: 'note', + width: 200, + }, +]; diff --git a/src/views/monitor/job/edit.vue b/src/views/monitor/job/edit.vue new file mode 100644 index 0000000..1220198 --- /dev/null +++ b/src/views/monitor/job/edit.vue @@ -0,0 +1,236 @@ + + diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue new file mode 100644 index 0000000..814b361 --- /dev/null +++ b/src/views/monitor/job/index.vue @@ -0,0 +1,291 @@ + + + + + diff --git a/src/views/monitor/job/log/columns.ts b/src/views/monitor/job/log/columns.ts new file mode 100644 index 0000000..d655fec --- /dev/null +++ b/src/views/monitor/job/log/columns.ts @@ -0,0 +1,58 @@ +import { h } from 'vue'; + +export const columns = [ + { + type: 'selection', + width: 50, + fixed: 'left', + }, + { + title: 'ID', + key: 'id', + width: 100, + }, + { + title: '任务名称', + key: 'jobName', + }, + { + title: '任务组名', + key: 'jobGroup', + }, + { + title: '任务触发器', + key: 'jobTrigger', + }, + { + title: '任务信息', + key: 'jobMessage', + }, + { + title: '执行状态', + key: 'status', + render(record) { + let typeText = ''; + switch (record.status) { + case 0: + typeText = '未发布'; + break; + case 1: + typeText = '运行中'; + break; + case 2: + typeText = '暂停'; + break; + case 3: + typeText = '删除'; + break; + default: + break; + } + return h('span', typeText || '-'); + }, + }, + { + title: '执行时间', + key: 'startTime', + }, +]; diff --git a/src/views/monitor/job/log/edit.vue b/src/views/monitor/job/log/edit.vue new file mode 100644 index 0000000..413f4e5 --- /dev/null +++ b/src/views/monitor/job/log/edit.vue @@ -0,0 +1,94 @@ + + diff --git a/src/views/monitor/job/log/index.vue b/src/views/monitor/job/log/index.vue new file mode 100644 index 0000000..5f0066c --- /dev/null +++ b/src/views/monitor/job/log/index.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/src/views/monitor/job/log/querySchemas.ts b/src/views/monitor/job/log/querySchemas.ts new file mode 100644 index 0000000..859c66c --- /dev/null +++ b/src/views/monitor/job/log/querySchemas.ts @@ -0,0 +1,30 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'jobName', + component: 'NInput', + label: '任务名称', + componentProps: { + placeholder: '请输入数据源名称', + }, + }, + { + field: 'status', + component: 'NSelect', + label: '任务状态', + componentProps: { + placeholder: '请选择任务状态', + clearable: true, + options: [ + { + label: '正常', + value: 0, + }, + { + label: '失败', + value: 1, + }, + ], + }, + }, +]; diff --git a/src/views/monitor/job/querySchemas.ts b/src/views/monitor/job/querySchemas.ts new file mode 100644 index 0000000..d4dab4e --- /dev/null +++ b/src/views/monitor/job/querySchemas.ts @@ -0,0 +1,38 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'jobName', + component: 'NInput', + label: '任务名称', + componentProps: { + placeholder: '请输入任务名称', + }, + }, + { + field: 'status', + component: 'NSelect', + label: '任务状态', + componentProps: { + placeholder: '请选择任务状态', + clearable: true, + options: [ + { + label: '未发布', + value: 0, + }, + { + label: '运行中', + value: 1, + }, + { + label: '暂停', + value: 2, + }, + { + label: '删除', + value: 3, + }, + ], + }, + }, +];