-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad4fb54
commit 7ea4a7b
Showing
5 changed files
with
110 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/pages/question/edit/component/rightPanel/RightPageSetting.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { useGetPageInfo } from '@/hooks' | ||
import { resetPageInfo } from '@/store/modules/pageInfoReducer' | ||
import { Form, Input } from 'antd' | ||
import TextArea from 'antd/es/input/TextArea' | ||
import { FC } from 'react' | ||
import { useDispatch } from 'react-redux' | ||
|
||
const RightPageSetting: FC = () => { | ||
const pageInfo = useGetPageInfo() | ||
const [form] = Form.useForm() | ||
const dispatch = useDispatch() | ||
|
||
/** 更新表单 */ | ||
const handelValuesChange = () => { | ||
dispatch(resetPageInfo(form.getFieldsValue())) | ||
} | ||
|
||
return ( | ||
<Form | ||
layout="vertical" | ||
initialValues={pageInfo} | ||
onValuesChange={handelValuesChange} | ||
form={form} | ||
> | ||
<Form.Item | ||
name="title" | ||
label="问卷标题" | ||
rules={[{ required: true, message: '请输入标题' }]} | ||
> | ||
<Input placeholder="请输入标题" /> | ||
</Form.Item> | ||
|
||
<Form.Item name="desc" label="问卷描述"> | ||
<TextArea placeholder="问卷描述信息" /> | ||
</Form.Item> | ||
|
||
<Form.Item name="css" label="样式代码"> | ||
<TextArea placeholder="请输入 CSS 样式代码" /> | ||
</Form.Item> | ||
|
||
<Form.Item name="js" label="脚本代码"> | ||
<TextArea placeholder="请输入 JS 脚本代码" /> | ||
</Form.Item> | ||
</Form> | ||
) | ||
} | ||
|
||
export default RightPageSetting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters