From 00bf070dbd29425e9b28f60129ea7f1acf112d9f Mon Sep 17 00:00:00 2001 From: aylvn Date: Sun, 16 Mar 2025 14:58:07 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/TableTools.vue | 21 +- desktop/frontend/src/locales/en.js | 19 + desktop/frontend/src/locales/zh-cn.js | 19 + desktop/frontend/src/router/index.js | 15 +- desktop/frontend/src/views/task/History.vue | 348 ++++++++++++++++++ .../src/views/{main => task}/Home.vue | 0 .../{main/History.vue => task/TaskIndex.vue} | 9 +- .../{main/Task.vue => task/TaskInfo.vue} | 0 8 files changed, 407 insertions(+), 24 deletions(-) create mode 100644 desktop/frontend/src/views/task/History.vue rename desktop/frontend/src/views/{main => task}/Home.vue (100%) rename desktop/frontend/src/views/{main/History.vue => task/TaskIndex.vue} (98%) rename desktop/frontend/src/views/{main/Task.vue => task/TaskInfo.vue} (100%) diff --git a/desktop/frontend/src/components/TableTools.vue b/desktop/frontend/src/components/TableTools.vue index a149f5a..2ba617e 100644 --- a/desktop/frontend/src/components/TableTools.vue +++ b/desktop/frontend/src/components/TableTools.vue @@ -6,22 +6,16 @@ - - - - - 新增 - - 删除 + {{ t('delete') }}
- 重置 - 查询 + {{ t('reset') }} + {{ t('search') }}
@@ -54,7 +48,9 @@ diff --git a/desktop/frontend/src/views/main/Home.vue b/desktop/frontend/src/views/task/Home.vue similarity index 100% rename from desktop/frontend/src/views/main/Home.vue rename to desktop/frontend/src/views/task/Home.vue diff --git a/desktop/frontend/src/views/main/History.vue b/desktop/frontend/src/views/task/TaskIndex.vue similarity index 98% rename from desktop/frontend/src/views/main/History.vue rename to desktop/frontend/src/views/task/TaskIndex.vue index 81d5a51..8ee8a35 100644 --- a/desktop/frontend/src/views/main/History.vue +++ b/desktop/frontend/src/views/task/TaskIndex.vue @@ -49,7 +49,7 @@
{{ t('taskStatus.name') }}: - {{ t(taskInfo.status) }} + {{ taskInfo.status }}
@@ -87,7 +87,6 @@ import { ref, reactive, inject, computed, onMounted, onUnmounted } from 'vue' import { FolderAdd, Promotion, Eleme, CircleClose } from '@element-plus/icons-vue' import { useConfig } from '@/store/config' import { useI18n } from 'vue-i18n' -import i18n from '@/locales/i18n' const utils = inject('utils') const config = useConfig() @@ -124,7 +123,7 @@ const buildEventSource = (taskId) => { // 处理错误情况 loading.value = false eventSource.value.close() - taskInfo.value.status = "failed" + taskInfo.value.status = "taskStatus.failed" utils.pop("任务执行失败", "error") } @@ -143,7 +142,7 @@ const handleEvent = (event, type) => { console.log('task completed'); loading.value = false eventSource.value.close() - taskInfo.value.status = "success" + taskInfo.value.status = "taskStatus.success" utils.pop("任务已完成", "success") return } @@ -288,7 +287,7 @@ function stop() { console.log("stop") loading.value = false eventSource.value.close() - taskInfo.value.status = "terminated" + taskInfo.value.status = "taskStatus.terminated" utils.pop("用户终止任务", "error") } diff --git a/desktop/frontend/src/views/main/Task.vue b/desktop/frontend/src/views/task/TaskInfo.vue similarity index 100% rename from desktop/frontend/src/views/main/Task.vue rename to desktop/frontend/src/views/task/TaskInfo.vue From 94cf2be101378b9726799c111f17b2ecd3835fd6 Mon Sep 17 00:00:00 2001 From: aylvn Date: Sun, 16 Mar 2025 15:04:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desktop/frontend/src/views/task/TaskIndex.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop/frontend/src/views/task/TaskIndex.vue b/desktop/frontend/src/views/task/TaskIndex.vue index 8ee8a35..37e73d8 100644 --- a/desktop/frontend/src/views/task/TaskIndex.vue +++ b/desktop/frontend/src/views/task/TaskIndex.vue @@ -123,7 +123,7 @@ const buildEventSource = (taskId) => { // 处理错误情况 loading.value = false eventSource.value.close() - taskInfo.value.status = "taskStatus.failed" + taskInfo.value.status = "failed" utils.pop("任务执行失败", "error") } @@ -142,7 +142,7 @@ const handleEvent = (event, type) => { console.log('task completed'); loading.value = false eventSource.value.close() - taskInfo.value.status = "taskStatus.success" + taskInfo.value.status = "success" utils.pop("任务已完成", "success") return } @@ -287,7 +287,7 @@ function stop() { console.log("stop") loading.value = false eventSource.value.close() - taskInfo.value.status = "taskStatus.terminated" + taskInfo.value.status = "terminated" utils.pop("用户终止任务", "error") } From d08db8a76ab3e832fa937788ad20b47dd11b3534 Mon Sep 17 00:00:00 2001 From: aylvn Date: Sun, 16 Mar 2025 16:02:03 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desktop/frontend/src/locales/en.js | 3 + desktop/frontend/src/locales/zh-cn.js | 3 + desktop/frontend/src/router/index.js | 2 +- .../task/{History.vue => HistoryIndex.vue} | 121 +------ desktop/frontend/src/views/task/Home.vue | 2 +- desktop/frontend/src/views/task/TaskIndex.vue | 21 +- desktop/frontend/src/views/task/TaskInfo.vue | 329 ++++-------------- 7 files changed, 97 insertions(+), 384 deletions(-) rename desktop/frontend/src/views/task/{History.vue => HistoryIndex.vue} (76%) diff --git a/desktop/frontend/src/locales/en.js b/desktop/frontend/src/locales/en.js index 17dce83..9a410c4 100644 --- a/desktop/frontend/src/locales/en.js +++ b/desktop/frontend/src/locales/en.js @@ -13,9 +13,12 @@ export default { copy: "Copy", paste: "Paste", cut: "Cut", + baseInfo: "Base Info", createdDt: "Created Date", updatedDt: "Updated Date", + noData: "No Data", + menu: { task: "Task", history: "History", diff --git a/desktop/frontend/src/locales/zh-cn.js b/desktop/frontend/src/locales/zh-cn.js index 4f1f404..a1d605e 100644 --- a/desktop/frontend/src/locales/zh-cn.js +++ b/desktop/frontend/src/locales/zh-cn.js @@ -13,9 +13,12 @@ export default { copy: "复制", paste: "粘贴", cut: "剪切", + baseInfo: "基本信息", createdDt: "创建时间", updatedDt: "更新时间", + noData: "暂无数据", + menu: { task: "任务", history: "历史记录", diff --git a/desktop/frontend/src/router/index.js b/desktop/frontend/src/router/index.js index 5a0f815..2c7049b 100644 --- a/desktop/frontend/src/router/index.js +++ b/desktop/frontend/src/router/index.js @@ -32,7 +32,7 @@ const router = createRouter({ }, { path: 'history', - component: () => import('@/views/task/History.vue'), + component: () => import('@/views/task/HistoryIndex.vue'), meta: { keepAlive: false, title: "历史记录", diff --git a/desktop/frontend/src/views/task/History.vue b/desktop/frontend/src/views/task/HistoryIndex.vue similarity index 76% rename from desktop/frontend/src/views/task/History.vue rename to desktop/frontend/src/views/task/HistoryIndex.vue index a3c75a7..24a0f97 100644 --- a/desktop/frontend/src/views/task/History.vue +++ b/desktop/frontend/src/views/task/HistoryIndex.vue @@ -1,4 +1,4 @@ -