[fix]:[FL-202][简化ATP模型创建表单]
- 移除描述字段(description)的展示和填写 - 移除Select组件创建新选项的能力(去掉dropdownRender提示文字) - 现在只能从预定义的选项中选择,不再支持自定义输入新值 - 更新表单验证提示文字,去掉"或新建"字样 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -34,7 +34,6 @@ import type { AtpAssetListResponse, AtpAssetSummary } from "@/types/auth";
|
|||||||
const AntCard = Card as unknown as ComponentType<CardProps & RefAttributes<HTMLDivElement>>;
|
const AntCard = Card as unknown as ComponentType<CardProps & RefAttributes<HTMLDivElement>>;
|
||||||
|
|
||||||
type AssetFormValues = {
|
type AssetFormValues = {
|
||||||
description: string;
|
|
||||||
voltage_level: string;
|
voltage_level: string;
|
||||||
tower_type: string;
|
tower_type: string;
|
||||||
scene_type: string;
|
scene_type: string;
|
||||||
@@ -43,7 +42,6 @@ type AssetFormValues = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const EMPTY_FORM: AssetFormValues = {
|
const EMPTY_FORM: AssetFormValues = {
|
||||||
description: "",
|
|
||||||
voltage_level: "",
|
voltage_level: "",
|
||||||
tower_type: "",
|
tower_type: "",
|
||||||
scene_type: "",
|
scene_type: "",
|
||||||
@@ -201,7 +199,7 @@ export default function AtpModelsPage() {
|
|||||||
const payload = {
|
const payload = {
|
||||||
code: generateCode(),
|
code: generateCode(),
|
||||||
name: generateName(values),
|
name: generateName(values),
|
||||||
description: values.description.trim(),
|
description: "",
|
||||||
voltage_level: values.voltage_level.trim() || null,
|
voltage_level: values.voltage_level.trim() || null,
|
||||||
tower_type: values.tower_type.trim() || null,
|
tower_type: values.tower_type.trim() || null,
|
||||||
scene_type: values.scene_type.trim() || null,
|
scene_type: values.scene_type.trim() || null,
|
||||||
@@ -740,73 +738,38 @@ export default function AtpModelsPage() {
|
|||||||
}}
|
}}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
>
|
>
|
||||||
<Form.Item name="voltage_level" label="电压等级" rules={[{ required: true, message: "请选择或新建电压等级" }]}>
|
<Form.Item name="voltage_level" label="电压等级" rules={[{ required: true, message: "请选择电压等级" }]}>
|
||||||
<Select
|
<Select
|
||||||
showSearch
|
showSearch
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择或新建电压等级"
|
placeholder="请选择电压等级"
|
||||||
options={voltageLevelOptions}
|
options={voltageLevelOptions}
|
||||||
dropdownRender={(menu) => (
|
|
||||||
<>
|
|
||||||
{menu}
|
|
||||||
<div style={{ padding: '8px 12px', color: '#999', fontSize: '12px' }}>
|
|
||||||
可直接输入新建选项
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="tower_type" label="塔型" rules={[{ required: true, message: "请选择或新建塔型" }]}>
|
<Form.Item name="tower_type" label="塔型" rules={[{ required: true, message: "请选择塔型" }]}>
|
||||||
<Select
|
<Select
|
||||||
showSearch
|
showSearch
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择或新建塔型"
|
placeholder="请选择塔型"
|
||||||
options={towerTypeOptions}
|
options={towerTypeOptions}
|
||||||
dropdownRender={(menu) => (
|
|
||||||
<>
|
|
||||||
{menu}
|
|
||||||
<div style={{ padding: '8px 12px', color: '#999', fontSize: '12px' }}>
|
|
||||||
可直接输入新建选项
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="scene_type" label="场景" rules={[{ required: true, message: "请选择或新建场景" }]}>
|
<Form.Item name="scene_type" label="场景" rules={[{ required: true, message: "请选择场景" }]}>
|
||||||
<Select
|
<Select
|
||||||
showSearch
|
showSearch
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择或新建场景"
|
placeholder="请选择场景"
|
||||||
options={sceneTypeOptions}
|
options={sceneTypeOptions}
|
||||||
dropdownRender={(menu) => (
|
|
||||||
<>
|
|
||||||
{menu}
|
|
||||||
<div style={{ padding: '8px 12px', color: '#999', fontSize: '12px' }}>
|
|
||||||
可直接输入新建选项
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="arrester_config" label="避雷器装设组合" rules={[{ required: true, message: "请选择或新建避雷器装设组合" }]}>
|
<Form.Item name="arrester_config" label="避雷器装设组合" rules={[{ required: true, message: "请选择避雷器装设组合" }]}>
|
||||||
<Select
|
<Select
|
||||||
showSearch
|
showSearch
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择或新建避雷器装设组合"
|
placeholder="请选择避雷器装设组合"
|
||||||
options={arresterConfigOptions}
|
options={arresterConfigOptions}
|
||||||
dropdownRender={(menu) => (
|
|
||||||
<>
|
|
||||||
{menu}
|
|
||||||
<div style={{ padding: '8px 12px', color: '#999', fontSize: '12px' }}>
|
|
||||||
可直接输入新建选项
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="description" label="描述">
|
|
||||||
<Input.TextArea rows={3} />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="上传模型文件" required>
|
<Form.Item label="上传模型文件" required>
|
||||||
<div>
|
<div>
|
||||||
<Upload
|
<Upload
|
||||||
|
|||||||
Reference in New Issue
Block a user