修复短效IP的提取数量输入框移动端的设置
This commit is contained in:
@@ -270,20 +270,50 @@ const FormFields = memo(() => {
|
|||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
{/* 提取数量 */}
|
{/* 提取数量 */}
|
||||||
<FormField name="count" className="max-w[160px*2+1rem]" label="提取数量" classNames={{label: 'max-md:text-sm'}}>
|
<FormField
|
||||||
|
name="count"
|
||||||
|
className="max-w[160px*2+1rem]"
|
||||||
|
label="提取数量"
|
||||||
|
classNames={{label: 'max-md:text-sm'}}
|
||||||
|
>
|
||||||
{({id, field}) => (
|
{({id, field}) => (
|
||||||
|
<div className="flex gap-2 items-center">
|
||||||
|
{/* 减号按钮:移动端显示,步长1,最小1 */}
|
||||||
|
<Button
|
||||||
|
theme="outline"
|
||||||
|
type="button"
|
||||||
|
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||||
|
onClick={() => field.onChange(Math.max(1, Number(field.value) - 1))}
|
||||||
|
disabled={Number(field.value) === 1}
|
||||||
|
>
|
||||||
|
-
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
{/* 数量输入框 */}
|
||||||
<Input
|
<Input
|
||||||
{...field}
|
{...field}
|
||||||
id={id}
|
id={id}
|
||||||
type="number"
|
type="number"
|
||||||
min={1}
|
min={1}
|
||||||
|
step={1}
|
||||||
|
className="w-40 h-10 border border-gray-200 rounded-sm text-center"
|
||||||
|
placeholder="输入提取数量"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = Math.max(1, Number(e.target.value))
|
const value = Math.max(1, Number(e.target.value) || 1)
|
||||||
field.onChange(value)
|
field.onChange(value)
|
||||||
}}
|
}}
|
||||||
className="h-10"
|
|
||||||
placeholder="输入提取数量"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* 加号按钮:移动端显示,步长1 */}
|
||||||
|
<Button
|
||||||
|
theme="outline"
|
||||||
|
type="button"
|
||||||
|
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||||
|
onClick={() => field.onChange(Number(field.value) + 1)}
|
||||||
|
>
|
||||||
|
+
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</FormField>
|
</FormField>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user