Update MicUploadPage.jsx via upload script - 2026-09-21 01:36:58

This commit is contained in:
mike 2026-09-21 01:37:08 +08:00
parent 471b55f84e
commit 3405b71aca
1 changed files with 25 additions and 10 deletions

View File

@ -496,16 +496,31 @@ export function MicUploadPage({ products = [], productCategories = [] }) {
onChange={(e) => setSearch(e.target.value)} onChange={(e) => setSearch(e.target.value)}
style={{ padding: '6px 8px', fontSize: 13 }} style={{ padding: '6px 8px', fontSize: 13 }}
/> />
<select <div style={{ maxHeight: 220, overflowY: 'auto', border: '1px solid var(--line, #ddd)', borderRadius: 6 }}>
size={8} {filteredProducts.length === 0 && (
value={selectedProductId} <div style={{ padding: 8, fontSize: 12, color: 'var(--ink-soft, #888)' }}>没有匹配的产品</div>
onChange={(e) => setSelectedProductId(e.target.value)} )}
style={{ fontSize: 13 }} {filteredProducts.map((p) => {
const selected = selectedProductId === p.id;
return (
<div
key={p.id}
onClick={() => setSelectedProductId(p.id)}
style={{
display: 'flex', justifyContent: 'space-between', alignItems: 'center',
padding: '6px 8px', fontSize: 13, cursor: 'pointer',
background: selected ? 'var(--brand-soft, #fde7d0)' : 'transparent',
borderBottom: '1px solid var(--line, #eee)',
}}
> >
{filteredProducts.map((p) => ( <span>{p.brand ? `[${p.brand}] ` : ''}{p.name}</span>
<option key={p.id} value={p.id}>{p.brand ? `[${p.brand}] ` : ''}{p.name}</option> <span style={{ fontWeight: 700, color: selected ? 'var(--brand, #d9822b)' : '#999', width: 16, textAlign: 'center' }}>
))} {selected ? '✓' : '+'}
</select> </span>
</div>
);
})}
</div>
</> </>
)} )}