From 792ec067ab0b5232438a7bcb06ea0fe142e91a04 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Sat, 11 May 2024 00:17:13 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=B8=8A=E4=BC=A0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=97=E8=A1=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/router/routes/modules/exec.ts | 6 +- .../components/upload-task-clear-modal.vue | 162 +++++++++ .../components/upload-task-table.vue | 325 ++++++++++++++++++ .../src/views/exec/upload-task/index.vue | 47 +++ .../src/views/exec/upload-task/types/const.ts | 33 ++ .../exec/upload-task/types/table.columns.ts | 70 ++++ 6 files changed, 640 insertions(+), 3 deletions(-) create mode 100644 orion-ops-ui/src/views/exec/upload-task/components/upload-task-clear-modal.vue create mode 100644 orion-ops-ui/src/views/exec/upload-task/components/upload-task-table.vue create mode 100644 orion-ops-ui/src/views/exec/upload-task/index.vue create mode 100644 orion-ops-ui/src/views/exec/upload-task/types/const.ts create mode 100644 orion-ops-ui/src/views/exec/upload-task/types/table.columns.ts diff --git a/orion-ops-ui/src/router/routes/modules/exec.ts b/orion-ops-ui/src/router/routes/modules/exec.ts index 15fdb633..d62abb9a 100644 --- a/orion-ops-ui/src/router/routes/modules/exec.ts +++ b/orion-ops-ui/src/router/routes/modules/exec.ts @@ -23,9 +23,9 @@ const EXEC: AppRouteRecordRaw[] = [ component: () => import('@/views/exec/batch-upload/index.vue'), }, { - name: 'uploadTaskLog', - path: '/upload-log', - component: () => import('@/views/exec/upload-task-log/index.vue'), + name: 'uploadTask', + path: '/upload-task', + component: () => import('@/views/exec/upload-task/index.vue'), }, { name: 'execTemplate', diff --git a/orion-ops-ui/src/views/exec/upload-task/components/upload-task-clear-modal.vue b/orion-ops-ui/src/views/exec/upload-task/components/upload-task-clear-modal.vue new file mode 100644 index 00000000..bae36103 --- /dev/null +++ b/orion-ops-ui/src/views/exec/upload-task/components/upload-task-clear-modal.vue @@ -0,0 +1,162 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/upload-task/components/upload-task-table.vue b/orion-ops-ui/src/views/exec/upload-task/components/upload-task-table.vue new file mode 100644 index 00000000..7877fff9 --- /dev/null +++ b/orion-ops-ui/src/views/exec/upload-task/components/upload-task-table.vue @@ -0,0 +1,325 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/upload-task/index.vue b/orion-ops-ui/src/views/exec/upload-task/index.vue new file mode 100644 index 00000000..f7a94445 --- /dev/null +++ b/orion-ops-ui/src/views/exec/upload-task/index.vue @@ -0,0 +1,47 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/upload-task/types/const.ts b/orion-ops-ui/src/views/exec/upload-task/types/const.ts new file mode 100644 index 00000000..eb24662c --- /dev/null +++ b/orion-ops-ui/src/views/exec/upload-task/types/const.ts @@ -0,0 +1,33 @@ +// 上传任务状态 +export const UploadTaskStatus = { + // 等待中 + WAITING: 'WAITING', + // 上传中 + UPLOADING: 'UPLOADING', + // 已完成 + FINISHED: 'FINISHED', + // 已完成 + FAILED: 'FAILED', + // 已取消 + CANCELED: 'CANCELED', +}; + +// 上传任务文件状态 +export const UploadTaskFileStatus = { + // 等待中 + WAITING: 'WAITING', + // 上传中 + UPLOADING: 'UPLOADING', + // 已完成 + FINISHED: 'FINISHED', + // 已完成 + FAILED: 'FAILED', + // 已取消 + CANCELED: 'CANCELED', +}; + +// 上传任务状态 字典项 +export const uploadTaskStatusKey = 'uploadTaskStatus'; + +// 加载的字典值 +export const dictKeys = [uploadTaskStatusKey]; diff --git a/orion-ops-ui/src/views/exec/upload-task/types/table.columns.ts b/orion-ops-ui/src/views/exec/upload-task/types/table.columns.ts new file mode 100644 index 00000000..a7c352f5 --- /dev/null +++ b/orion-ops-ui/src/views/exec/upload-task/types/table.columns.ts @@ -0,0 +1,70 @@ +import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; +import { dateFormat } from '@/utils'; + +const columns = [ + { + title: 'id', + dataIndex: 'id', + slotName: 'id', + width: 70, + align: 'left', + fixed: 'left', + }, { + title: '上传用户', + dataIndex: 'username', + slotName: 'username', + align: 'left', + width: 118, + ellipsis: true, + tooltip: true, + }, { + title: '上传描述', + dataIndex: 'description', + slotName: 'description', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '远程路径', + dataIndex: 'remotePath', + slotName: 'remotePath', + align: 'left', + ellipsis: true, + tooltip: true, + }, { + title: '上传状态', + dataIndex: 'status', + slotName: 'status', + align: 'center', + width: 138, + }, { + title: '文件数量', + dataIndex: 'fileCount', + slotName: 'fileCount', + width: 98, + align: 'center', + }, { + title: '主机数量', + dataIndex: 'hostCount', + slotName: 'hostCount', + width: 98, + align: 'center', + }, { + title: '上传时间', + dataIndex: 'createTime', + slotName: 'createTime', + align: 'center', + width: 180, + render: ({ record }) => { + return dateFormat(new Date(record.createTime)); + }, + }, { + title: '操作', + slotName: 'handle', + width: 180, + align: 'center', + fixed: 'right', + }, +] as TableColumnData[]; + +export default columns;