Update MicUploadPage.jsx via upload script - 2026-09-21 01:36:58
This commit is contained in:
parent
471b55f84e
commit
3405b71aca
|
|
@ -496,16 +496,31 @@ export function MicUploadPage({ products = [], productCategories = [] }) {
|
|||
onChange={(e) => setSearch(e.target.value)}
|
||||
style={{ padding: '6px 8px', fontSize: 13 }}
|
||||
/>
|
||||
<select
|
||||
size={8}
|
||||
value={selectedProductId}
|
||||
onChange={(e) => setSelectedProductId(e.target.value)}
|
||||
style={{ fontSize: 13 }}
|
||||
>
|
||||
{filteredProducts.map((p) => (
|
||||
<option key={p.id} value={p.id}>{p.brand ? `[${p.brand}] ` : ''}{p.name}</option>
|
||||
))}
|
||||
</select>
|
||||
<div style={{ maxHeight: 220, overflowY: 'auto', border: '1px solid var(--line, #ddd)', borderRadius: 6 }}>
|
||||
{filteredProducts.length === 0 && (
|
||||
<div style={{ padding: 8, fontSize: 12, color: 'var(--ink-soft, #888)' }}>没有匹配的产品</div>
|
||||
)}
|
||||
{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)',
|
||||
}}
|
||||
>
|
||||
<span>{p.brand ? `[${p.brand}] ` : ''}{p.name}</span>
|
||||
<span style={{ fontWeight: 700, color: selected ? 'var(--brand, #d9822b)' : '#999', width: 16, textAlign: 'center' }}>
|
||||
{selected ? '✓' : '+'}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue