feat: 设计师选择器增加搜索功能,优化显示样式

This commit is contained in:
Your Name 2026-01-12 15:05:16 +08:00
parent 3d7106fd7b
commit f18b3da725
2 changed files with 46 additions and 21 deletions

View File

@ -128,20 +128,25 @@
<div v-if="formData.releaseType === 'assigned'" class="task-type-receiver">
<a-select
v-model:value="item.receiverId"
placeholder="指定设计师"
placeholder="搜索设计师姓名"
style="width: 200px"
show-search
allow-clear
size="large"
:filter-option="filterOption"
:filter-option="filterDesignerOption"
option-filter-prop="label"
@focus="loadDesignersForItem(item)"
>
<a-select-option
v-for="designer in getDesignersForItem(item)"
:key="designer.id"
:value="designer.id"
:label="designer.realName"
>
{{ designer.realName }} (进行中: {{ designer.inProgressCount || 0 }})
<div class="designer-option">
<span class="designer-name">{{ designer.realName }}</span>
<span class="designer-workload">进行中: {{ designer.inProgressCount || 0 }}</span>
</div>
</a-select-option>
</a-select>
</div>
@ -1235,9 +1240,11 @@ const calculateScore = () => {
}
}
// 筛选选项
const filterOption = (input: string, option: any) => {
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
// 筛选设计师选项
const filterDesignerOption = (input: string, option: any) => {
// 搜索设计师姓名
const designerName = option.label || ''
return designerName.toLowerCase().includes(input.toLowerCase())
}
// 取消
@ -2591,4 +2598,22 @@ onUnmounted(() => {
color: #31f08b !important;
}
}
// 设计师选择器选项样式
.designer-option {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.designer-name {
color: #e5e5e5;
font-weight: 500;
}
.designer-workload {
color: #8a8a8a;
font-size: 12px;
}
}
</style>

View File

@ -58,22 +58,22 @@
</div>
<div style="display: flex; align-items: center; gap: 12px;">
<!-- 月份选择器 -->
<!-- 月份选择器 -->
<div class="month-selector" @click.stop>
<a-select
v-model:value="selectedMonth"
placeholder="选择月份"
style="width: 150px"
@change="handleMonthChange"
<a-select
v-model:value="selectedMonth"
placeholder="选择月份"
style="width: 150px"
@change="handleMonthChange"
>
<a-select-option
v-for="month in availableMonths"
:key="month.value"
:value="month.value"
>
<a-select-option
v-for="month in availableMonths"
:key="month.value"
:value="month.value"
>
{{ month.label }}
</a-select-option>
</a-select>
{{ month.label }}
</a-select-option>
</a-select>
</div>
<!-- 展开/折叠按钮 -->
<a-button type="link" size="small" style="color: #31f08b;">
@ -112,7 +112,7 @@
<!-- 设计师列表 -->
<div class="designers-section">
<div class="section-header">
<h2 class="section-title">设计师列表</h2>
<h2 class="section-title">设计师列表</h2>
<div class="filter-area">
<a-select
v-model:value="selectedDeptId"