From 36f93db93f02974873aa75b7cda42af3ad76e2b6 Mon Sep 17 00:00:00 2001 From: wenyongda Date: Tue, 22 Jul 2025 17:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E7=AD=94=E5=8A=A9=E6=89=8B=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E8=A7=A3=E5=86=B3=E8=B5=9E=E5=90=8C=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=B8=8D=E4=BA=86=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E6=98=AF=E7=94=B1=E4=BA=8E=E4=BB=A3=E7=A0=81=E4=B8=AD?= =?UTF-8?q?=E5=8F=AA=E9=92=88=E5=AF=B9=E5=8F=8D=E5=AF=B9=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BA=86=E8=AE=B0=E5=BD=95=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20isSubmittingNow=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=AD=E7=9A=84state=EF=BC=8C=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E4=BD=BF=E7=94=A8useEffect=E8=BF=99=E4=B8=AAReact?= =?UTF-8?q?=E7=9A=84hook=E8=BF=9B=E8=A1=8C=E7=9B=91=E5=90=AC=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=8F=98=E5=8C=96=EF=BC=8C=E8=A7=A3=E5=86=B3React=20?= =?UTF-8?q?=E7=9A=84=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E6=98=AF=20?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E7=9A=84=20=EF=BC=8C=E8=80=8C=E4=B8=94?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E9=97=AD=E5=8C=85=E4=BC=9A=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=E6=97=A7=E5=80=BC=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=88=B0=E5=90=8E=E5=8F=B0=E6=8E=A5=E5=8F=A3=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E5=86=85=E5=AE=B9=E3=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?ID=E3=80=81=E4=BC=9A=E8=AF=9DID=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E7=9A=84=E6=98=AF=E4=B9=8B=E5=89=8D=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=AE=8C=E6=88=90=E5=8F=96=E6=B6=88=E8=B5=9E?= =?UTF-8?q?=E5=90=8C=E5=92=8C=E5=8F=96=E6=B6=88=E5=8F=8D=E5=AF=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat-with-history/FeedbackModal.tsx | 19 ++++---- app/components/chat-with-history/hooks.tsx | 45 ++++++++++++++----- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/app/components/chat-with-history/FeedbackModal.tsx b/app/components/chat-with-history/FeedbackModal.tsx index 979bb2f..63a210d 100644 --- a/app/components/chat-with-history/FeedbackModal.tsx +++ b/app/components/chat-with-history/FeedbackModal.tsx @@ -1,10 +1,11 @@ import React, { useState } from 'react'; import { Modal, Checkbox, Input, message } from 'antd'; +import { useTranslation } from 'react-i18next' const { TextArea } = Input; interface FeedbackModalProps { - open: boolean; + open: boolean; onOk: (selectedOption: number | null, feedbackText: string) => void; onCancel: () => void; } @@ -12,10 +13,10 @@ interface FeedbackModalProps { const FeedbackModal: React.FC = ({ open, onOk, onCancel }) => { const [selectedOption, setSelectedOption] = useState(null); const [feedbackText, setFeedbackText] = useState(''); - + const { t } = useTranslation() const handleOk = () => { - if (selectedOption === null || !feedbackText) { - message.warning('请选择操作类型并填写反馈建议'); + if (!feedbackText) { + message.warning('请填写反馈建议'); return; } onOk(selectedOption, feedbackText); @@ -24,11 +25,13 @@ const FeedbackModal: React.FC = ({ open, onOk, onCancel }) = return ( -
+ {/*
setSelectedOption(0)} @@ -41,7 +44,7 @@ const FeedbackModal: React.FC = ({ open, onOk, onCancel }) = > 修改 -
+
*/}