本地Mock店铺支持自定义输入便于录入其他平台订单
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { PlusOutlined } from '@ant-design/icons'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { App, Button, Card, Form, Input, InputNumber, Select, Switch } from 'antd'
|
||||
import { App, AutoComplete, Button, Card, Form, Input, InputNumber, Select, Switch } from 'antd'
|
||||
import { useState } from 'react'
|
||||
|
||||
import { createAdminMockWorkOrder } from '@/services/admin'
|
||||
@@ -105,14 +105,21 @@ export function MockWorkOrderForm({ onCreated }: { onCreated: () => Promise<void
|
||||
className="worker-order-mock-field-shop"
|
||||
label="店铺"
|
||||
name="sellerId"
|
||||
rules={[{ required: true, message: '请选择店铺' }]}
|
||||
rules={[{ required: true, whitespace: true, message: '请选择或输入店铺' }]}
|
||||
>
|
||||
<Select
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
loading={shopsQuery.isLoading}
|
||||
<AutoComplete
|
||||
options={shopOptions}
|
||||
placeholder={shopOptions.length > 0 ? '请选择店铺' : '暂无可用店铺'}
|
||||
filterOption={(inputValue, option) =>
|
||||
String(option?.label ?? '')
|
||||
.toLowerCase()
|
||||
.includes(inputValue.toLowerCase()) ||
|
||||
String(option?.value ?? '')
|
||||
.toLowerCase()
|
||||
.includes(inputValue.toLowerCase())
|
||||
}
|
||||
placeholder={
|
||||
shopOptions.length > 0 ? '选择已配置店铺,或直接输入自定义店铺' : '输入自定义店铺'
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
|
||||
Reference in New Issue
Block a user