提交 e6403d45 authored 作者: 王鹏飞's avatar 王鹏飞

feat: 帮助中心支持排序

上级 d9e41303
import { Button, Form, Input, Upload, Space, message } from 'antd' import { Button, Form, Input, InputNumber, Upload, Space, message } from 'antd'
import { useState, useEffect, useRef } from 'react' import { useState, useEffect, useRef } from 'react'
const { TextArea } = Input const { TextArea } = Input
import '@wangeditor/editor/dist/css/style.css' // 引入 css import '@wangeditor/editor/dist/css/style.css' // 引入 css
...@@ -28,9 +28,10 @@ const HelpAddEdit = () => { ...@@ -28,9 +28,10 @@ const HelpAddEdit = () => {
const [uploadProgress, setUploadProgress] = useState(0) const [uploadProgress, setUploadProgress] = useState(0)
const getHelpInfo = async (id) => { const getHelpInfo = async (id) => {
const { help_title, help_content } = await HelpInfo({ id }) const { help_title, help_content, sort } = await HelpInfo({ id })
form.setFieldValue('help_title', help_title) form.setFieldValue('help_title', help_title)
form.setFieldValue('help_content', help_content) form.setFieldValue('help_content', help_content)
form.setFieldValue('sort', sort ?? 0)
setHtml(help_content) setHtml(help_content)
} }
...@@ -230,6 +231,14 @@ const HelpAddEdit = () => { ...@@ -230,6 +231,14 @@ const HelpAddEdit = () => {
style={{ width: 'calc(100% - 180px)' }} style={{ width: 'calc(100% - 180px)' }}
/> />
</Form.Item> </Form.Item>
<Form.Item label='排序' name='sort' initialValue={0} tooltip='数值越小越靠前'>
<InputNumber
min={0}
precision={0}
placeholder='请输入排序值'
style={{ width: 'calc(100% - 180px)' }}
/>
</Form.Item>
<Button <Button
style={{ position: 'absolute', right: 100, top: 0 }} style={{ position: 'absolute', right: 100, top: 0 }}
type='primary' type='primary'
......
...@@ -89,6 +89,13 @@ const HelpTable = () => { ...@@ -89,6 +89,13 @@ const HelpTable = () => {
</Popover> </Popover>
), ),
}, },
{
title: '排序',
key: 'sort',
dataIndex: 'sort',
align: 'center',
width: 80,
},
{ {
title: '创建时间', title: '创建时间',
key: 'create_time', key: 'create_time',
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论