From 6e3f8101c81bb887983ded584a8172c46ba263fa Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 8 Jan 2026 15:15:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=B8=88=E5=A4=A7=E5=8E=85=E4=BB=BB=E5=8A=A1=E5=B1=95=E5=BC=80?= =?UTF-8?q?UI=E9=85=8D=E8=89=B2=EF=BC=8C=E6=98=BE=E7=A4=BASPU=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designhub/service/DesignerService.java | 10 +- frontend/src/views/DesignerHall.vue | 138 ++++++++++++++++-- frontend/src/views/Settings.vue | 119 +++++++++++++++ 3 files changed, 250 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/com/designhub/service/DesignerService.java b/backend/src/main/java/com/designhub/service/DesignerService.java index 08fb024..fec50b2 100644 --- a/backend/src/main/java/com/designhub/service/DesignerService.java +++ b/backend/src/main/java/com/designhub/service/DesignerService.java @@ -459,6 +459,7 @@ public class DesignerService { item.put("id", task.getId()); item.put("taskNo", task.getTaskNo()); item.put("title", task.getTitle()); + item.put("spuInfo", task.getSpuInfo()); // 添加SPU信息 item.put("status", task.getStatus()); item.put("progress", task.getProgress()); item.put("score", task.getScore()); @@ -483,13 +484,16 @@ public class DesignerService { java.util.Map taskItem = new java.util.LinkedHashMap<>(); taskItem.put("id", item.getId()); taskItem.put("taskNo", item.getItemNo()); - taskItem.put("title", "子任务 #" + item.getGroupNo()); + // 获取主任务信息 + Task mainTask = taskMapper.selectById(item.getTaskId()); + // 优先显示主任务的SPU信息,否则显示子任务标题 + String spuInfo = mainTask != null ? mainTask.getSpuInfo() : null; + taskItem.put("title", spuInfo != null ? spuInfo : ("子任务 #" + item.getGroupNo())); + taskItem.put("spuInfo", spuInfo); taskItem.put("status", item.getStatus()); taskItem.put("progress", item.getProgress()); taskItem.put("score", item.getTotalScore()); taskItem.put("startTime", item.getCreateTime()); // 使用创建时间作为开始时间 - // 获取主任务的截止时间 - Task mainTask = taskMapper.selectById(item.getTaskId()); taskItem.put("deadline", mainTask != null ? mainTask.getDeadline() : null); taskItem.put("createTime", item.getCreateTime()); taskItem.put("isSubTask", true); diff --git a/frontend/src/views/DesignerHall.vue b/frontend/src/views/DesignerHall.vue index 874a58a..ec5df19 100644 --- a/frontend/src/views/DesignerHall.vue +++ b/frontend/src/views/DesignerHall.vue @@ -227,28 +227,40 @@
-
- {{ task.title }} - {{ task.taskNo }} +
+ {{ task.spuInfo || task.title || '未知任务' }} + + {{ task.isSubTask ? '子任务' : '主任务' }} +
-
+
+ 编号: + {{ task.taskNo }} +
+
+
进度
- {{ task.progress || 0 }}% + {{ task.progress || 0 }}%
-
- - - 开始: {{ formatDate(task.startTime) }} - - - 截止: {{ formatDate(task.deadline) }} - +
+
+ + 开始: + {{ formatDate(task.startTime) }} +
+
+ + 截止: + {{ formatDate(task.deadline) }} +
@@ -902,6 +914,104 @@ onMounted(() => { font-size: $font-size-sm; } + // 展开的任务项样式 + .task-item-expanded { + padding: 12px; + margin-bottom: 8px; + background: linear-gradient(135deg, rgba(49, 240, 139, 0.08) 0%, rgba(26, 26, 26, 0.95) 100%); + border-radius: 8px; + border: 1px solid rgba(49, 240, 139, 0.2); + + &:last-child { + margin-bottom: 0; + } + + .task-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 8px; + + .task-title-text { + font-size: 13px; + font-weight: 500; + color: #fff; + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-right: 8px; + } + } + + .task-no-row { + display: flex; + align-items: center; + margin-bottom: 8px; + font-size: 11px; + + .task-no-label { + color: rgba(255, 255, 255, 0.5); + margin-right: 4px; + } + + .task-no-value { + color: rgba(255, 255, 255, 0.8); + font-family: monospace; + } + } + + .task-progress-bar { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 8px; + + .progress-label { + font-size: 11px; + color: rgba(255, 255, 255, 0.5); + min-width: 28px; + } + + :deep(.ant-progress) { + margin: 0; + + .ant-progress-inner { + background: rgba(255, 255, 255, 0.1); + } + } + + .progress-percent { + font-size: 12px; + font-weight: 500; + color: #31f08b; + min-width: 35px; + text-align: right; + } + } + + .task-time-info { + display: flex; + justify-content: space-between; + gap: 16px; + + .time-item { + display: flex; + align-items: center; + gap: 4px; + font-size: 11px; + + .time-label { + color: rgba(255, 255, 255, 0.5); + } + + .time-value { + color: rgba(255, 255, 255, 0.9); + } + } + } + } + .task-item { padding: $space-sm; margin-bottom: $space-sm; diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue index 53f8dc3..c234523 100644 --- a/frontend/src/views/Settings.vue +++ b/frontend/src/views/Settings.vue @@ -856,6 +856,72 @@ + + +
+

每日进度检查配置

+
+ + + + + + + + + {{ progressCheckConfig.enabled ? '已启用' : '已禁用' }} + + + + + + 点 + + + + + + + + 分/任务/天 + + + + + + {{ progressCheckConfig.notifyEnabled ? '已启用' : '已禁用' }} + + + +
@@ -2485,6 +2551,14 @@ const designerTargetForm = reactive({ const designerTargetModalVisible = ref(false) const designerTargetModalTitle = ref('添加目标积分配置') +// 每日进度检查配置 +const progressCheckConfig = reactive({ + enabled: true, + checkHour: 18, + deductionScore: 1, + notifyEnabled: true +}) + const designerTargetColumns = [ { title: 'ID', dataIndex: 'id', key: 'id', width: 60 }, { title: '部门', dataIndex: 'deptName', key: 'deptName' }, @@ -4625,6 +4699,8 @@ onMounted(() => { // 加载设计师目标积分配置 loadTargetScoreDepartments() loadDesignerTargetList() + // 加载进度检查配置 + loadProgressCheckConfig() }) // S3配置相关方法 @@ -4910,6 +4986,49 @@ const handleDeleteDesignerTarget = async (id: number) => { } } +// 加载进度检查配置 +const loadProgressCheckConfig = async () => { + try { + const response = await getSystemConfigsByGroup('progress') + const configList = response.data || [] + + for (const config of configList) { + switch (config.configKey) { + case 'progress.daily_check_enabled': + progressCheckConfig.enabled = config.configValue === 'true' + break + case 'progress.daily_check_hour': + progressCheckConfig.checkHour = parseInt(config.configValue) || 18 + break + case 'progress.no_update_deduction': + progressCheckConfig.deductionScore = parseFloat(config.configValue) || 1 + break + case 'progress.notify_on_deduction': + progressCheckConfig.notifyEnabled = config.configValue === 'true' + break + } + } + } catch (error: any) { + console.error('加载进度检查配置失败:', error) + } +} + +// 保存进度检查配置 +const saveProgressCheckConfig = async () => { + try { + await batchUpdateSystemConfigs({ + 'progress.daily_check_enabled': String(progressCheckConfig.enabled), + 'progress.daily_check_hour': String(progressCheckConfig.checkHour), + 'progress.no_update_deduction': String(progressCheckConfig.deductionScore), + 'progress.notify_on_deduction': String(progressCheckConfig.notifyEnabled) + }) + message.success('保存成功') + } catch (error: any) { + console.error('保存进度检查配置失败:', error) + message.error('保存失败') + } +} + watch(activeTab, (value) => { // 切换到用户与部门 tab 时,始终刷新数据以获取最新状态 if (value === 'users') {