This commit is contained in:
jeremygan2021
2026-02-12 14:23:36 +08:00
parent f00cc9a28e
commit b4ac97c3c2
7 changed files with 201 additions and 82 deletions

View File

@@ -1,10 +1,10 @@
import React, { useState } from 'react';
import { Modal, Form, Input, Button, message, Upload } from 'antd';
import { Modal, Form, Input, Button, message, Upload, Select } from 'antd';
import { InboxOutlined } from '@ant-design/icons';
import { createTopic } from '../api';
const { TextArea } = Input;
const { Dragger } = Upload;
const { Option } = Select;
const CreateTopicModal = ({ visible, onClose, onSuccess }) => {
const [form] = Form.useForm();
@@ -39,6 +39,7 @@ const CreateTopicModal = ({ visible, onClose, onSuccess }) => {
layout="vertical"
onFinish={handleSubmit}
style={{ marginTop: 20 }}
initialValues={{ category: 'discussion' }}
>
<Form.Item
name="title"
@@ -48,6 +49,18 @@ const CreateTopicModal = ({ visible, onClose, onSuccess }) => {
<Input placeholder="请输入清晰的问题或讨论标题" />
</Form.Item>
<Form.Item
name="category"
label="分类"
rules={[{ required: true, message: '请选择分类' }]}
>
<Select>
<Option value="discussion">技术讨论</Option>
<Option value="help">求助问答</Option>
<Option value="share">经验分享</Option>
</Select>
</Form.Item>
<Form.Item
name="content"
label="内容"