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;
}
}
}