fix: 搜索无结果时新建按钮改为el-select的empty插槽,避免被遮挡

- 将「新建客户」按钮从 el-select 下方的独立 div 移入 #empty 插槽
- 搜索无匹配时,下拉面板直接显示「未找到xxx」+ 新建按钮
- 不再被原生「无数据」空状态遮挡
- 移动端+桌面端五个页面统一修复

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 18:04:45 +08:00
parent 5682c12085
commit c489a8d6fd
5 changed files with 41 additions and 21 deletions
+13 -9
View File
@@ -235,16 +235,19 @@ async function handleDelete() {
style="width:100%"
>
<el-option v-for="c in customers" :key="c.id" :label="c.name" :value="c.id" />
<template #empty>
<div v-if="customerSearch" class="select-empty-create">
<p style="color:var(--warm-gray);font-size:13px;margin:0 0 8px">未找到{{ customerSearch }}</p>
<button type="button" class="quick-create-btn" @click.stop="handleQuickCreate">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
新建客户{{ customerSearch }}
</button>
</div>
</template>
</el-select>
<div v-if="customerSearch && !customers.some(c => c.name === customerSearch)" style="margin-top:8px">
<button type="button" class="quick-create-btn" @click="handleQuickCreate">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
新建客户{{ customerSearch }}
</button>
</div>
</el-form-item>
<el-form-item>
@@ -494,6 +497,7 @@ async function handleDelete() {
color: var(--vermilion);
background: rgba(184,71,46,0.03);
}
.select-empty-create { padding: 8px 12px; text-align: center; }
/* ═══ Photo Area ═══ */
.photo-area {