本地Mock店铺支持自定义输入便于录入其他平台订单

This commit is contained in:
yml2213
2026-08-22 14:26:04 +08:00
parent f92dc6a4c9
commit 72b3f7c592
3 changed files with 43 additions and 25 deletions
@@ -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