From 9ed0e584542f3e5697a5645f9ca0df598fdff2b8 Mon Sep 17 00:00:00 2001 From: linxd <544554903@qq.com> Date: Mon, 11 Aug 2025 10:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=88=86=E7=B1=BB=E5=8F=96?= =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/help/helpQuestion.tsx | 71 ++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/src/pages/help/helpQuestion.tsx b/src/pages/help/helpQuestion.tsx index 3179ccc..236c6e7 100644 --- a/src/pages/help/helpQuestion.tsx +++ b/src/pages/help/helpQuestion.tsx @@ -6,6 +6,8 @@ import WangEditor from 'wangeditor'; import { QUESTION_TYPES } from '@/dicts/help'; import { addHelpCenterQuestion } from '@/servers/api/help'; import styles from './helpQuestion.less'; +import { getDictList } from '@/servers/api/dict'; +import type { DictItem } from '@/servers/api/dict'; const { Title } = Typography; const { Option } = Select; @@ -28,9 +30,15 @@ const HelpQuestionPage: React.FC = () => { const [editor, setEditor] = useState(null); const [content, setContent] = useState(''); const [submitting, setSubmitting] = useState(false); + const [typeList, setTypeList] = useState([]); // 初始化编辑器 useEffect(() => { + getDictList('help_center').then((res) => { + if (res.code === 200 && res.success) { + setTypeList(res.data); + } + }); const editorInstance = new WangEditor('#editor'); // 配置编辑器 @@ -138,9 +146,7 @@ const HelpQuestionPage: React.FC = () => {
{intl.formatMessage({ id: 'help.question.title' })} -

- {intl.formatMessage({ id: 'help.question.subtitle' })} -

+

{intl.formatMessage({ id: 'help.question.subtitle' })}

@@ -157,12 +163,17 @@ const HelpQuestionPage: React.FC = () => { @@ -172,7 +183,12 @@ const HelpQuestionPage: React.FC = () => { @@ -182,7 +198,9 @@ const HelpQuestionPage: React.FC = () => {
@@ -192,7 +210,12 @@ const HelpQuestionPage: React.FC = () => { @@ -201,7 +224,12 @@ const HelpQuestionPage: React.FC = () => { @@ -213,7 +241,12 @@ const HelpQuestionPage: React.FC = () => { @@ -223,8 +256,11 @@ const HelpQuestionPage: React.FC = () => { name="email" label={intl.formatMessage({ id: 'help.form.email' })} rules={[ - { required: true, message: intl.formatMessage({ id: 'help.form.email.required' }) }, - { validator: emailValidator } + { + required: true, + message: intl.formatMessage({ id: 'help.form.email.required' }), + }, + { validator: emailValidator }, ]} > @@ -245,7 +281,12 @@ const HelpQuestionPage: React.FC = () => { -