Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
973af7cc
Commit
973af7cc
authored
Jan 23, 2025
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 更新heroui事件click to press
parent
90d0c62f
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
89 additions
and
60 deletions
+89
-60
src/components/ChatEditor/index.tsx
+1
-1
src/components/ConversationModal/index.tsx
+1
-1
src/components/LoginModal/index.tsx
+2
-2
src/components/UnLikeModal/index.tsx
+2
-2
src/layouts/HistoryBar/HistoryBar.tsx
+2
-2
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
+1
-1
src/layouts/Navbar/components/NavBarItem/NavBarItem.tsx
+1
-1
src/layouts/Navbar/components/User/index.tsx
+1
-1
src/pages/Chat/Chat.tsx
+29
-31
src/pages/Chat/components/ChatItem/ChatAnswerAttchment.tsx
+1
-1
src/pages/Chat/components/ChatItem/ChatAnswerBox.tsx
+3
-2
src/pages/Chat/components/ChatItem/ChatAnswerOperate.tsx
+4
-4
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
+1
-1
src/pages/Chat/components/ChatItem/ChatMaxCount.tsx
+34
-4
src/pages/Collect/Collect.tsx
+3
-3
src/pages/Home/components/QuestionList/QuestionList.tsx
+2
-2
src/pages/Home/components/WelcomeWord/WelcomeWord.tsx
+1
-1
No files found.
src/components/ChatEditor/index.tsx
View file @
973af7cc
...
@@ -127,7 +127,7 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
...
@@ -127,7 +127,7 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
/>
/>
<
Tooltip
isOpen=
{
Boolean
(
token
)
&&
showContentTips
&&
!
isAsking
&&
!
content
}
color=
"foreground"
content=
"请输入您的问题📖"
placement=
"top-end"
>
<
Tooltip
isOpen=
{
Boolean
(
token
)
&&
showContentTips
&&
!
isAsking
&&
!
content
}
color=
"foreground"
content=
"请输入您的问题📖"
placement=
"top-end"
>
<
Button
className=
"ask-send"
on
Click
=
{
handleSubmit
}
radius=
"full"
isDisabled=
{
!
content
||
isAsking
}
isIconOnly
color=
"primary"
>
<
Button
className=
"ask-send"
on
Press
=
{
handleSubmit
}
radius=
"full"
isDisabled=
{
!
content
||
isAsking
}
isIconOnly
color=
"primary"
>
<
SendIcon
/>
<
SendIcon
/>
</
Button
>
</
Button
>
</
Tooltip
>
</
Tooltip
>
...
...
src/components/ConversationModal/index.tsx
View file @
973af7cc
...
@@ -89,7 +89,7 @@ export const ConversationModal: React.FC<ConversationModalProps> = ({ isOpen, on
...
@@ -89,7 +89,7 @@ export const ConversationModal: React.FC<ConversationModalProps> = ({ isOpen, on
<
Button
onPress=
{
onClose
}
>
<
Button
onPress=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
isDisabled=
{
[...
selectedKeys
].
length
===
0
}
color=
"primary"
on
Click
=
{
handleDelete
}
>
<
Button
isDisabled=
{
[...
selectedKeys
].
length
===
0
}
color=
"primary"
on
Press
=
{
handleDelete
}
>
删除所选
删除所选
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
src/components/LoginModal/index.tsx
View file @
973af7cc
...
@@ -48,8 +48,8 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
...
@@ -48,8 +48,8 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
>
>
</
Checkbox
>
</
Checkbox
>
我已阅读并同意
我已阅读并同意
<
Link
isExternal
on
Click
=
{
()
=>
handleJump2Protocol
(
'01'
)
}
showAnchorIcon
underline=
"hover"
>
《服务协议》
</
Link
>
<
Link
isExternal
on
Press
=
{
()
=>
handleJump2Protocol
(
'01'
)
}
showAnchorIcon
underline=
"hover"
>
《服务协议》
</
Link
>
<
Link
isExternal
on
Click
=
{
()
=>
handleJump2Protocol
(
'02'
)
}
showAnchorIcon
underline=
"hover"
>
《隐私政策》
</
Link
>
<
Link
isExternal
on
Press
=
{
()
=>
handleJump2Protocol
(
'02'
)
}
showAnchorIcon
underline=
"hover"
>
《隐私政策》
</
Link
>
</
p
>
</
p
>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
...
...
src/components/UnLikeModal/index.tsx
View file @
973af7cc
...
@@ -64,7 +64,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
...
@@ -64,7 +64,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
color=
"primary"
color=
"primary"
variant=
"light"
variant=
"light"
className=
{
`bg-[#F8F8F8] text-left text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary ${item.answerValue === '1' ? 'bg-[#E5F6FF] text-primary' : ''}`
}
className=
{
`bg-[#F8F8F8] text-left text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary ${item.answerValue === '1' ? 'bg-[#E5F6FF] text-primary' : ''}`
}
on
Click
=
{
()
=>
handleClick
(
item
,
index
)
}
on
Press
=
{
()
=>
handleClick
(
item
,
index
)
}
>
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
span
>
{
item
.
answerName
}
</
span
>
<
span
>
{
item
.
answerName
}
</
span
>
...
@@ -85,7 +85,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
...
@@ -85,7 +85,7 @@ export const UnLikeModal: React.FC<UnLikeModalProps> = ({ isOpen, onClose, answe
<
Button
onPress=
{
onClose
}
>
<
Button
onPress=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
on
Click
=
{
onSubmit
}
color=
"primary"
>
<
Button
on
Press
=
{
onSubmit
}
color=
"primary"
>
提交
提交
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
src/layouts/HistoryBar/HistoryBar.tsx
View file @
973af7cc
...
@@ -43,7 +43,7 @@ export const HistoryBar: React.FC<HistoryBarProps> = ({ isVisible, onSetHistoryV
...
@@ -43,7 +43,7 @@ export const HistoryBar: React.FC<HistoryBarProps> = ({ isVisible, onSetHistoryV
<
div
className=
"pt-[24px] flex flex-col h-full"
>
<
div
className=
"pt-[24px] flex flex-col h-full"
>
<
div
className=
"flex gap-[12px] px-[32px] h-[40px] sm:block"
>
<
div
className=
"flex gap-[12px] px-[32px] h-[40px] sm:block"
>
<
Input
value=
{
searchValue
}
onValueChange=
{
setSearchValue
}
classNames=
{
{
inputWrapper
:
[
'bg-white'
,
'data-[hover=true]:bg-[#fff]'
,
'group-data-[focus=true]:bg-white'
,
'rounded-[24px]'
]
}
}
placeholder=
"搜索历史记录"
startContent=
{
<
SearchIcon
/>
}
/>
<
Input
value=
{
searchValue
}
onValueChange=
{
setSearchValue
}
classNames=
{
{
inputWrapper
:
[
'bg-white'
,
'data-[hover=true]:bg-[#fff]'
,
'group-data-[focus=true]:bg-white'
,
'rounded-[24px]'
]
}
}
placeholder=
"搜索历史记录"
startContent=
{
<
SearchIcon
/>
}
/>
<
Button
className=
"flex sm:hidden"
on
Click
=
{
()
=>
onSetHistoryVisible
(
false
)
}
isIconOnly
color=
"danger"
>
<
Button
className=
"flex sm:hidden"
on
Press
=
{
()
=>
onSetHistoryVisible
(
false
)
}
isIconOnly
color=
"danger"
>
<
CloseIcon
/>
<
CloseIcon
/>
</
Button
>
</
Button
>
</
div
>
</
div
>
...
@@ -51,7 +51,7 @@ export const HistoryBar: React.FC<HistoryBarProps> = ({ isVisible, onSetHistoryV
...
@@ -51,7 +51,7 @@ export const HistoryBar: React.FC<HistoryBarProps> = ({ isVisible, onSetHistoryV
<
HistoryBarList
onSetHistoryVisible=
{
onSetHistoryVisible
}
searchValue=
{
searchValue
}
/>
<
HistoryBarList
onSetHistoryVisible=
{
onSetHistoryVisible
}
searchValue=
{
searchValue
}
/>
</
div
>
</
div
>
<
div
className=
"text-[12px] border-t-solid border-t-[1px] border-t-[#82969C12] w-full h-[48px] flex items-center justify-center"
>
<
div
className=
"text-[12px] border-t-solid border-t-[1px] border-t-[#82969C12] w-full h-[48px] flex items-center justify-center"
>
<
Button
on
Click
=
{
handleOpen
}
className=
"w-full"
color=
"primary"
variant=
"light"
startContent=
{
<
HistoryMenuIcon
/>
}
>
<
Button
on
Press
=
{
handleOpen
}
className=
"w-full"
color=
"primary"
variant=
"light"
startContent=
{
<
HistoryMenuIcon
/>
}
>
<
span
className=
"text-[#82969C]"
>
管理对话记录
</
span
>
<
span
className=
"text-[#82969C]"
>
管理对话记录
</
span
>
</
Button
>
</
Button
>
</
div
>
</
div
>
...
...
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
View file @
973af7cc
...
@@ -62,7 +62,7 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
...
@@ -62,7 +62,7 @@ export const HistoryBarList: React.FC<HistoryBarListProps> = ({ searchValue, onS
color=
"primary"
color=
"primary"
variant=
"light"
variant=
"light"
className=
{
`text-left w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary ${currentConversationId === item.conversationId ? 'bg-[#E5F6FF] text-primary' : ''}`
}
className=
{
`text-left w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary ${currentConversationId === item.conversationId ? 'bg-[#E5F6FF] text-primary' : ''}`
}
on
Click
=
{
()
=>
handleClick
(
item
)
}
on
Press
=
{
()
=>
handleClick
(
item
)
}
>
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
span
>
{
item
.
conversationTitle
}
</
span
>
<
span
>
{
item
.
conversationTitle
}
</
span
>
...
...
src/layouts/Navbar/components/NavBarItem/NavBarItem.tsx
View file @
973af7cc
...
@@ -60,7 +60,7 @@ export const NavBarItem: React.FC<NavBarItemProps> = ({ isHistoryVisible, onClic
...
@@ -60,7 +60,7 @@ export const NavBarItem: React.FC<NavBarItemProps> = ({ isHistoryVisible, onClic
<
motion
.
div
className=
{
`${styles.NavBarItem}`
}
>
<
motion
.
div
className=
{
`${styles.NavBarItem}`
}
>
<
div
className=
{
`${styles.icon}`
}
>
<
div
className=
{
`${styles.icon}`
}
>
<
Tooltip
color=
"foreground"
content=
{
label
}
placement=
"right"
>
<
Tooltip
color=
"foreground"
content=
{
label
}
placement=
"right"
>
<
Button
className=
{
handleActive
()
?
'bg-[#e4e4e5]'
:
''
}
on
Click
=
{
()
=>
onClick
(
type
)
}
variant=
"light"
isIconOnly
aria
-
label=
"Like"
>
<
Button
className=
{
handleActive
()
?
'bg-[#e4e4e5]'
:
''
}
on
Press
=
{
()
=>
onClick
(
type
)
}
variant=
"light"
isIconOnly
aria
-
label=
"Like"
>
{
React
.
createElement
(
icon
)
}
{
React
.
createElement
(
icon
)
}
</
Button
>
</
Button
>
</
Tooltip
>
</
Tooltip
>
...
...
src/layouts/Navbar/components/User/index.tsx
View file @
973af7cc
...
@@ -91,7 +91,7 @@ const UserNotLoginBase: React.FC<WithAuthProps> = ({ showLoginTip, checkAuth })
...
@@ -91,7 +91,7 @@ const UserNotLoginBase: React.FC<WithAuthProps> = ({ showLoginTip, checkAuth })
return
(
return
(
<
Tooltip
isOpen=
{
navBarVisible
&&
showLoginTip
&&
!
isMobile
()
}
color=
"foreground"
content=
"登录体验更多功能"
placement=
"right"
>
<
Tooltip
isOpen=
{
navBarVisible
&&
showLoginTip
&&
!
isMobile
()
}
color=
"foreground"
content=
"登录体验更多功能"
placement=
"right"
>
<
Button
on
Click
=
{
checkAuth
}
variant=
"light"
isIconOnly
aria
-
label=
"Like"
>
<
Button
on
Press
=
{
checkAuth
}
variant=
"light"
isIconOnly
aria
-
label=
"Like"
>
<
UserIcon
/>
<
UserIcon
/>
</
Button
>
</
Button
>
</
Tooltip
>
</
Tooltip
>
...
...
src/pages/Chat/Chat.tsx
View file @
973af7cc
...
@@ -3,7 +3,6 @@ import { useParams } from 'react-router-dom'
...
@@ -3,7 +3,6 @@ import { useParams } from 'react-router-dom'
import
{
Button
}
from
'@heroui/react'
import
{
Button
}
from
'@heroui/react'
import
{
motion
}
from
'framer-motion'
import
{
motion
}
from
'framer-motion'
import
{
useScroll
}
from
'ahooks'
import
{
useScroll
}
from
'ahooks'
import
{
toast
}
from
'react-hot-toast'
import
styles
from
'./Chat.module.less'
import
styles
from
'./Chat.module.less'
import
{
ChatSlogan
}
from
'./components/ChatSlogan'
import
{
ChatSlogan
}
from
'./components/ChatSlogan'
import
{
ChatMaskBar
}
from
'./components/ChatMaskBar'
import
{
ChatMaskBar
}
from
'./components/ChatMaskBar'
...
@@ -16,13 +15,12 @@ import { ChatEditor } from '@/components/ChatEditor'
...
@@ -16,13 +15,12 @@ import { ChatEditor } from '@/components/ChatEditor'
import
type
{
ChatRecord
}
from
'@/types/chat'
import
type
{
ChatRecord
}
from
'@/types/chat'
import
{
fetchUserQaRecordPage
}
from
'@/api/conversation'
import
{
fetchUserQaRecordPage
}
from
'@/api/conversation'
import
{
fetchCheckTokenApi
,
fetchStreamResponse
}
from
'@/api/chat'
import
{
fetchCheckTokenApi
,
fetchStreamResponse
}
from
'@/api/chat'
import
{
clearShouldSendQuestion
,
createConversation
,
fetchConversations
}
from
'@/store/conversationSlice'
import
{
clearShouldSendQuestion
,
fetchConversations
}
from
'@/store/conversationSlice'
import
type
{
RootState
}
from
'@/store'
import
type
{
RootState
}
from
'@/store'
import
{
useAppDispatch
,
useAppSelector
}
from
'@/store/hook'
import
{
useAppDispatch
,
useAppSelector
}
from
'@/store/hook'
import
ScrollBtoIcon
from
'@/assets/svg/scrollBto.svg?react'
import
ScrollBtoIcon
from
'@/assets/svg/scrollBto.svg?react'
import
{
setIsAsking
}
from
'@/store/chatSlice'
import
{
setIsAsking
}
from
'@/store/chatSlice'
import
SdreamLoading
from
'@/components/SdreamLoading'
import
SdreamLoading
from
'@/components/SdreamLoading'
import
AddNewChat
from
'@/assets/svg/addNewChat.svg?react'
export
const
Chat
:
React
.
FC
=
()
=>
{
export
const
Chat
:
React
.
FC
=
()
=>
{
let
ignore
=
false
let
ignore
=
false
...
@@ -59,33 +57,33 @@ export const Chat: React.FC = () => {
...
@@ -59,33 +57,33 @@ export const Chat: React.FC = () => {
/** 处理超过最大条数的数据 */
/** 处理超过最大条数的数据 */
const
handleChatMaxCount
=
(
msg
:
any
,
question
:
string
)
=>
{
const
handleChatMaxCount
=
(
msg
:
any
,
question
:
string
)
=>
{
toast
(
t
=>
(
//
toast(t => (
<
div
className=
"flex items-center"
>
//
<div className="flex items-center">
<
p
className=
"text-[14px]"
>
⚠️ 超过最大轮数上限!请新建对话 👉🏻
</
p
>
//
<p className="text-[14px]">⚠️ 超过最大轮数上限!请新建对话 👉🏻</p>
<
Button
//
<Button
color=
"primary"
//
color="primary"
size=
"sm"
//
size="sm"
variant=
"light"
//
variant="light"
isIconOnly
//
isIconOnly
onClick=
{
()
=>
{
//
onClick={() => {
dispatch
(
createConversation
({
//
dispatch(createConversation({
conversationData
:
{},
//
conversationData: {},
shouldNavigate
:
true
,
//
shouldNavigate: true,
shouldSendQuestion
:
''
,
//
shouldSendQuestion: '',
}))
//
}))
toast
.
dismiss
(
t
.
id
)
//
toast.dismiss(t.id)
}
}
//
}}
>
//
>
<
AddNewChat
/>
//
<AddNewChat />
</
Button
>
//
</Button>
</
div
>
//
</div>
),
{
//
), {
position
:
'bottom-center'
,
//
position: 'bottom-center',
duration
:
0
,
//
duration: 0,
style
:
{
//
style: {
marginBottom
:
'120px'
,
//
marginBottom: '120px',
},
//
},
})
//
})
setAllItems
((
prevItems
)
=>
{
setAllItems
((
prevItems
)
=>
{
const
newItems
=
[...
prevItems
]
// 创建数组的浅拷贝
const
newItems
=
[...
prevItems
]
// 创建数组的浅拷贝
const
lastIndex
=
newItems
.
length
-
1
const
lastIndex
=
newItems
.
length
-
1
...
@@ -243,7 +241,7 @@ export const Chat: React.FC = () => {
...
@@ -243,7 +241,7 @@ export const Chat: React.FC = () => {
}
}
}
}
transition=
{
{
duration
:
0.3
,
ease
:
'easeInOut'
}
}
transition=
{
{
duration
:
0.3
,
ease
:
'easeInOut'
}
}
>
>
<
Button
on
Click
=
{
scrollToBottom
}
radius=
"full"
isIconOnly
color=
"primary"
>
<
Button
on
Press
=
{
scrollToBottom
}
radius=
"full"
isIconOnly
color=
"primary"
>
<
ScrollBtoIcon
/>
<
ScrollBtoIcon
/>
</
Button
>
</
Button
>
</
motion
.
div
>
</
motion
.
div
>
...
...
src/pages/Chat/components/ChatItem/ChatAnswerAttchment.tsx
View file @
973af7cc
...
@@ -87,7 +87,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
...
@@ -87,7 +87,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
<
motion
.
li
<
motion
.
li
key=
{
product
.
productCode
}
key=
{
product
.
productCode
}
>
>
<
Button
on
Click
=
{
()
=>
handleClickBoxItem
(
product
.
productName
,
product
.
productCode
)
}
isDisabled=
{
!
isLastAnswer
}
color=
"primary"
variant=
"light"
className=
"text-left bg-[#F7FCFF] w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary"
>
<
Button
on
Press
=
{
()
=>
handleClickBoxItem
(
product
.
productName
,
product
.
productCode
)
}
isDisabled=
{
!
isLastAnswer
}
color=
"primary"
variant=
"light"
className=
"text-left bg-[#F7FCFF] w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
span
className=
"ml-[8px]"
>
{
product
.
productName
}
</
span
>
<
span
className=
"ml-[8px]"
>
{
product
.
productName
}
</
span
>
</
div
>
</
div
>
...
...
src/pages/Chat/components/ChatItem/ChatAnswerBox.tsx
View file @
973af7cc
...
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'
...
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'
import
{
ChatAnswerShower
}
from
'./ChatAnswerShower'
import
{
ChatAnswerShower
}
from
'./ChatAnswerShower'
import
{
ChatAnswerParser
}
from
'./ChatAnswerParser'
import
{
ChatAnswerParser
}
from
'./ChatAnswerParser'
import
{
ChatAnswerRecommend
}
from
'./ChatAnswerRecommend'
import
{
ChatAnswerRecommend
}
from
'./ChatAnswerRecommend'
import
{
ChatMaxCount
}
from
'./ChatMaxCount'
import
type
{
Answer
,
ChatRecord
}
from
'@/types/chat'
import
type
{
Answer
,
ChatRecord
}
from
'@/types/chat'
import
AvatarBot
from
'@/assets/avatarBot.png'
import
AvatarBot
from
'@/assets/avatarBot.png'
import
{
useAppDispatch
}
from
'@/store/hook'
import
{
useAppDispatch
}
from
'@/store/hook'
...
@@ -61,7 +62,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex,
...
@@ -61,7 +62,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex,
<
div
className=
"content"
>
<
div
className=
"content"
>
{
item
.
isShow
&&
<
ChatAnswerShower
onSubmitQuestion=
{
onSubmitQuestion
}
isLastAnswer=
{
isLastAnswer
}
answer=
{
item
}
/>
}
{
item
.
isShow
&&
<
ChatAnswerShower
onSubmitQuestion=
{
onSubmitQuestion
}
isLastAnswer=
{
isLastAnswer
}
answer=
{
item
}
/>
}
{
!
item
.
isShow
&&
!
item
.
isChatMaxCount
&&
<
ChatAnswerParser
onSubmitQuestion=
{
onSubmitQuestion
}
isLastAnswer=
{
isLastAnswer
}
isStopTyping=
{
item
.
isStopTyping
}
onTyping=
{
handleTyping
}
onComplate=
{
()
=>
handleComplate
(
item
)
}
answer=
{
item
}
/>
}
{
!
item
.
isShow
&&
!
item
.
isChatMaxCount
&&
<
ChatAnswerParser
onSubmitQuestion=
{
onSubmitQuestion
}
isLastAnswer=
{
isLastAnswer
}
isStopTyping=
{
item
.
isStopTyping
}
onTyping=
{
handleTyping
}
onComplate=
{
()
=>
handleComplate
(
item
)
}
answer=
{
item
}
/>
}
{
!
item
.
isShow
&&
item
.
isChatMaxCount
&&
<
div
>
{
item
.
answer
}
</
div
>
}
{
!
item
.
isShow
&&
item
.
isChatMaxCount
&&
<
ChatMaxCount
/
>
}
</
div
>
</
div
>
)
)
:
<
SdreamLoading
/>
}
:
<
SdreamLoading
/>
}
...
@@ -71,7 +72,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex,
...
@@ -71,7 +72,7 @@ export const ChatAnswerBox: React.FC<ChatAnswerBoxProps> = ({ record, showIndex,
</
div
>
</
div
>
{
isTyping
&&
(
{
isTyping
&&
(
<
div
className=
"sm:pl-[62px] mt-[12px]"
>
<
div
className=
"sm:pl-[62px] mt-[12px]"
>
<
Button
on
Click
=
{
handleStopTyping
}
color=
"primary"
variant=
"bordered"
>
<
Button
on
Press
=
{
handleStopTyping
}
color=
"primary"
variant=
"bordered"
>
停止生成
停止生成
</
Button
>
</
Button
>
</
div
>
</
div
>
...
...
src/pages/Chat/components/ChatItem/ChatAnswerOperate.tsx
View file @
973af7cc
...
@@ -98,23 +98,23 @@ export const ChatAnswerOperate: React.FC<ChatAnswerOperateProps> = ({ answer })
...
@@ -98,23 +98,23 @@ export const ChatAnswerOperate: React.FC<ChatAnswerOperateProps> = ({ answer })
<
div
className=
"sm:mt-[12px] flex gap-[4px] justify-end"
>
<
div
className=
"sm:mt-[12px] flex gap-[4px] justify-end"
>
{
/* 点赞 */
}
{
/* 点赞 */
}
<
Tooltip
color=
"foreground"
content=
{
isLike
?
'取消点赞'
:
'点赞'
}
className=
"capitalize"
>
<
Tooltip
color=
"foreground"
content=
{
isLike
?
'取消点赞'
:
'点赞'
}
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"LikeIcon"
on
Click
=
{
handleLike
.
run
}
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"LikeIcon"
on
Press
=
{
handleLike
.
run
}
>
{
isLike
?
<
LikeIconA
/>
:
<
LikeIcon
/>
}
{
isLike
?
<
LikeIconA
/>
:
<
LikeIcon
/>
}
</
Button
>
</
Button
>
</
Tooltip
>
</
Tooltip
>
{
/* 点踩 */
}
{
/* 点踩 */
}
<
Tooltip
color=
"foreground"
content=
{
isUnLike
?
'取消点踩'
:
'点踩'
}
className=
"capitalize"
>
<
Tooltip
color=
"foreground"
content=
{
isUnLike
?
'取消点踩'
:
'点踩'
}
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"UnLikeIcon"
on
Click
=
{
handleUnLike
}
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"UnLikeIcon"
on
Press
=
{
handleUnLike
}
>
{
isUnLike
?
<
UnLikeIconA
/>
:
<
UnLikeIcon
/>
}
{
isUnLike
?
<
UnLikeIconA
/>
:
<
UnLikeIcon
/>
}
</
Button
>
</
Button
>
</
Tooltip
>
</
Tooltip
>
{
/* 复制 */
}
{
/* 复制 */
}
<
Tooltip
color=
"foreground"
content=
"复制"
className=
"capitalize"
>
<
Tooltip
color=
"foreground"
content=
"复制"
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CopyIcon"
on
Click
=
{
handleCopy
}
><
CopyIcon
/></
Button
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CopyIcon"
on
Press
=
{
handleCopy
}
><
CopyIcon
/></
Button
>
</
Tooltip
>
</
Tooltip
>
{
/* 收藏 */
}
{
/* 收藏 */
}
<
Tooltip
color=
"foreground"
content=
{
isCollect
?
'取消收藏'
:
'收藏'
}
className=
"capitalize"
>
<
Tooltip
color=
"foreground"
content=
{
isCollect
?
'取消收藏'
:
'收藏'
}
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CollectIcon"
on
Click
=
{
handleCollect
.
run
}
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CollectIcon"
on
Press
=
{
handleCollect
.
run
}
>
{
isCollect
?
<
CollectIconA
/>
:
<
CollectIcon
/>
}
{
isCollect
?
<
CollectIconA
/>
:
<
CollectIcon
/>
}
</
Button
>
</
Button
>
</
Tooltip
>
</
Tooltip
>
...
...
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
View file @
973af7cc
...
@@ -33,7 +33,7 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
...
@@ -33,7 +33,7 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
<
div
className=
"flex flex-col gap-[8px]"
>
<
div
className=
"flex flex-col gap-[8px]"
>
{
{
questionList
.
map
((
item
,
index
)
=>
(
questionList
.
map
((
item
,
index
)
=>
(
<
Button
on
Click
=
{
()
=>
onSubmitQuestion
(
item
)
}
key=
{
index
}
color=
"primary"
variant=
"light"
className=
"text-left bg-[#fff] w-fit max-w-full text-[#333] rounded-[8px] data-[hover=true]:bg-[#F6F6F8] data-[hover=true]:text-[#333]"
>
<
Button
on
Press
=
{
()
=>
onSubmitQuestion
(
item
)
}
key=
{
index
}
color=
"primary"
variant=
"light"
className=
"text-left bg-[#fff] w-fit max-w-full text-[#333] rounded-[8px] data-[hover=true]:bg-[#F6F6F8] data-[hover=true]:text-[#333]"
>
<
div
className=
"w-full sm:w-full text-nowrap text-ellipsis overflow-hidden"
>
<
div
className=
"w-full sm:w-full text-nowrap text-ellipsis overflow-hidden"
>
{
item
}
{
item
}
</
div
>
</
div
>
...
...
src/pages/Chat/components/ChatItem/ChatMaxCount.tsx
View file @
973af7cc
import
{
Alert
}
from
'@heroui/alert'
import
{
Button
}
from
'@heroui/react'
import
{
useAppDispatch
}
from
'@/store/hook'
import
{
createConversation
}
from
'@/store/conversationSlice'
export
const
ChatMaxCount
:
React
.
FC
=
()
=>
{
export
const
ChatMaxCount
:
React
.
FC
=
()
=>
{
const
dispatch
=
useAppDispatch
()
return
(
return
(
<
div
>
<
div
className=
"flex items-center justify-center"
>
<
div
className=
"flex items-center"
>
<
Alert
<
p
className=
"text-[14px] mr-[12px]"
>
⚠️ 超过最大轮数上限!请您新建对话~
</
p
>
color=
"warning"
</
div
>
description=
"超过最大轮数上限"
title=
"提示"
variant=
"faded"
endContent=
{
(
<
Button
color=
"warning"
size=
"sm"
variant=
"flat"
className=
"ml-[12px]"
onPress=
{
()
=>
{
dispatch
(
createConversation
({
conversationData
:
{},
shouldNavigate
:
true
,
shouldSendQuestion
:
''
,
}))
}
}
>
新建对话
</
Button
>
)
}
>
</
Alert
>
</
div
>
</
div
>
)
)
}
}
src/pages/Collect/Collect.tsx
View file @
973af7cc
...
@@ -138,10 +138,10 @@ export const Collect: React.FC = () => {
...
@@ -138,10 +138,10 @@ export const Collect: React.FC = () => {
</
div
>
</
div
>
<
div
>
<
div
>
<
Tooltip
color=
"foreground"
content=
"复制"
className=
"capitalize"
>
<
Tooltip
color=
"foreground"
content=
"复制"
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CopyIcon"
on
Click
=
{
()
=>
handleCopy
(
item
)
}
><
CopyIcon
/></
Button
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CopyIcon"
on
Press
=
{
()
=>
handleCopy
(
item
)
}
><
CopyIcon
/></
Button
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
color=
"foreground"
content=
"删除"
className=
"capitalize"
>
<
Tooltip
color=
"foreground"
content=
"删除"
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"DeleteIcon"
on
Click
=
{
()
=>
handleDelete
(
item
)
}
><
DeleteIcon
/></
Button
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"DeleteIcon"
on
Press
=
{
()
=>
handleDelete
(
item
)
}
><
DeleteIcon
/></
Button
>
</
Tooltip
>
</
Tooltip
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -165,7 +165,7 @@ export const Collect: React.FC = () => {
...
@@ -165,7 +165,7 @@ export const Collect: React.FC = () => {
{
{
!
isLoading
&&
collectList
.
length
<
total
&&
(
!
isLoading
&&
collectList
.
length
<
total
&&
(
<
div
className=
"w-full max-w-[912px] mx-auto flex justify-center mt-[24px]"
>
<
div
className=
"w-full max-w-[912px] mx-auto flex justify-center mt-[24px]"
>
<
Button
on
Click
=
{
handleLoadMore
}
color=
"primary"
variant=
"light"
>
<
Button
on
Press
=
{
handleLoadMore
}
color=
"primary"
variant=
"light"
>
加载更多
加载更多
</
Button
>
</
Button
>
</
div
>
</
div
>
...
...
src/pages/Home/components/QuestionList/QuestionList.tsx
View file @
973af7cc
...
@@ -88,7 +88,7 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({ checkAu
...
@@ -88,7 +88,7 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({ checkAu
showRefresh
showRefresh
?
(
?
(
<
Button
<
Button
on
Click
=
{
handleRefresh
}
on
Press
=
{
handleRefresh
}
isDisabled=
{
isRotating
}
isDisabled=
{
isRotating
}
isIconOnly
isIconOnly
color=
"primary"
color=
"primary"
...
@@ -130,7 +130,7 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({ checkAu
...
@@ -130,7 +130,7 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({ checkAu
layout
layout
className=
"w-full"
className=
"w-full"
>
>
<
Button
on
Click
=
{
()
=>
handleClick
(
item
)
}
color=
"primary"
variant=
"light"
className=
"text-left bg-[#F7FCFF] w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary"
>
<
Button
on
Press
=
{
()
=>
handleClick
(
item
)
}
color=
"primary"
variant=
"light"
className=
"text-left bg-[#F7FCFF] w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
span
style=
{
{
color
:
dotColor
}
}
>
·
</
span
>
<
span
style=
{
{
color
:
dotColor
}
}
>
·
</
span
>
<
span
className=
"ml-[8px]"
>
{
item
}
</
span
>
<
span
className=
"ml-[8px]"
>
{
item
}
</
span
>
...
...
src/pages/Home/components/WelcomeWord/WelcomeWord.tsx
View file @
973af7cc
...
@@ -77,7 +77,7 @@ const WelcomeWordBase: React.FC<WithAuthProps> = ({ checkAuth }) => {
...
@@ -77,7 +77,7 @@ const WelcomeWordBase: React.FC<WithAuthProps> = ({ checkAuth }) => {
<
div
className=
"px-[18px] pt-[58px] pb-[18px] relative z-[1] box-border sm:pb-0 sm:px-[24px] sm:pt-[68px]"
>
<
div
className=
"px-[18px] pt-[58px] pb-[18px] relative z-[1] box-border sm:pb-0 sm:px-[24px] sm:pt-[68px]"
>
<
SayHi
/>
<
SayHi
/>
<
p
className=
"mt-[16px] text-[#27353C] text-[15px] sm:mt-[24px] mb-[16px]"
>
作为您的智能保险伙伴,您有各类专业相关的问题都可以抛给我哟~让我们互相帮助共同成长吧~
</
p
>
<
p
className=
"mt-[16px] text-[#27353C] text-[15px] sm:mt-[24px] mb-[16px]"
>
作为您的智能保险伙伴,您有各类专业相关的问题都可以抛给我哟~让我们互相帮助共同成长吧~
</
p
>
<
Button
className=
"bg-white w-full text-[#20ABD9] font-medium rounded-[20px] sm:w-auto"
on
Click
=
{
handleGo
}
>
立即前往 ➔
</
Button
>
<
Button
className=
"bg-white w-full text-[#20ABD9] font-medium rounded-[20px] sm:w-auto"
on
Press
=
{
handleGo
}
>
立即前往 ➔
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment