|
|
@@ -40,16 +40,28 @@ const CreateForm = (props) => { |
|
|
|
} |
|
|
|
</Select> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name="status" label="状态" |
|
|
|
rules={[{ required: true, message: '请选择状态' }]} > |
|
|
|
<Select placeholder="请选择状态"> |
|
|
|
<OptGroup> |
|
|
|
<Select.Option value={0}>正常</Select.Option> |
|
|
|
<Select.Option value={1}>停用</Select.Option> |
|
|
|
<Select.Option value={2}>删除</Select.Option> |
|
|
|
</OptGroup> |
|
|
|
</Select> |
|
|
|
|
|
|
|
<Form.Item |
|
|
|
noStyle |
|
|
|
shouldUpdate={(prevValues, currentValues) => |
|
|
|
prevValues.mode !== currentValues.mode |
|
|
|
} > |
|
|
|
{({ getFieldValue }) => |
|
|
|
(props.values.id) ? ( |
|
|
|
<Form.Item name="status" label="状态" |
|
|
|
rules={[{ required: true, message: '请选择状态' }]} > |
|
|
|
<Select placeholder="请选择状态"> |
|
|
|
<OptGroup> |
|
|
|
<Select.Option value={0}>正常</Select.Option> |
|
|
|
<Select.Option value={1}>停用</Select.Option> |
|
|
|
</OptGroup> |
|
|
|
</Select> |
|
|
|
</Form.Item> |
|
|
|
) : null |
|
|
|
} |
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
|
|
|
|
<Form.Item> |
|
|
|
<Button type="primary" htmlType="submit"> |
|
|
|
保存 |
|
|
|