From b845cf52a5d5ced83e173da89e8882f34c599c44 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Jan 2026 16:53:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=8F=AF=E6=8E=A5?= =?UTF-8?q?=E5=8D=95=E9=83=A8=E9=97=A8=E6=A0=87=E7=AD=BE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 移除无法识别的部门ID显示 2. 如果所有部门都可接单则不显示标签 3. 调整标签UI风格为绿色主题 --- frontend/src/views/TaskHall.vue | 45 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/frontend/src/views/TaskHall.vue b/frontend/src/views/TaskHall.vue index c1ea6bb..662e77b 100644 --- a/frontend/src/views/TaskHall.vue +++ b/frontend/src/views/TaskHall.vue @@ -305,14 +305,13 @@
可接单部门: - {{ deptName }} - +
@@ -2917,19 +2916,23 @@ const getTaskAllowedDeptNames = (task: any): string[] => { } } - // 如果为空,表示所有接单部门都可以接单 + // 如果为空,表示所有接单部门都可以接单,不显示标签 if (!allowedDeptIds || allowedDeptIds.trim() === '') { - return ['全部接单部门'] + return [] } - // 将部门ID转换为部门名称 + // 将部门ID转换为部门名称,只返回能找到名称的部门 const deptIds = allowedDeptIds.split(',').map((id: string) => parseInt(id.trim())) - const deptNames = deptIds.map((id: number) => { - const dept = receivingDeptList.value.find(d => d.id === id) - return dept ? dept.deptName : `部门${id}` - }) + const deptNames: string[] = [] - return deptNames.filter((name: string) => name) + for (const id of deptIds) { + const dept = receivingDeptList.value.find(d => d.id === id) + if (dept && dept.deptName) { + deptNames.push(dept.deptName) + } + } + + return deptNames } // 构建级联选择器选项 @@ -6607,9 +6610,6 @@ onUnmounted(() => { flex-wrap: wrap; gap: $space-xs; margin-bottom: $space-md; - padding: $space-xs $space-sm; - background: rgba(#1890ff, 0.08); - border-radius: 6px; .allowed-depts-label { font-size: $font-size-xs; @@ -6620,13 +6620,18 @@ onUnmounted(() => { .allowed-depts-tags { display: flex; flex-wrap: wrap; - gap: 4px; + gap: 6px; - :deep(.ant-tag) { - margin: 0; + .dept-tag { + display: inline-flex; + align-items: center; + padding: 2px 10px; font-size: $font-size-xs; - line-height: 18px; - padding: 0 6px; + color: $brand-primary; + background: rgba($brand-primary, 0.1); + border: 1px solid rgba($brand-primary, 0.3); + border-radius: 4px; + white-space: nowrap; } } }