feat: The dialog list shows logical changes

This commit is contained in:
wb-lh513319
2024-08-13 18:26:30 +08:00
parent c3337e4370
commit ac37433f5c
2 changed files with 19 additions and 6 deletions

View File

@@ -155,7 +155,7 @@ const ChatSider: React.FC<{
}> = ({ dialogueList = [], refresh, historyLoading, listLoading, order }) => {
const { t } = useTranslation();
const { mode } = useContext(ChatContext);
const [collapsed, setCollapsed] = useState<boolean>(false);
const [collapsed, setCollapsed] = useState<boolean>(true);
// 展开或收起列表按钮样式
const triggerStyle: React.CSSProperties = useMemo(() => {
@@ -194,6 +194,7 @@ const ChatSider: React.FC<{
theme={mode}
width={280}
collapsible={true}
collapsed={collapsed}
collapsedWidth={0}
trigger={collapsed ? <CaretRightOutlined className="text-base" /> : <CaretLeftOutlined className="text-base" />}
zeroWidthTriggerStyle={triggerStyle}

View File

@@ -251,9 +251,20 @@ const Chat: React.FC = () => {
}
}, [isChatDefault]);
if (scene === 'chat_dashboard') {
return <>{isContract ? <DbEditor /> : <ChatContainer />}</>;
}
// if (scene === 'chat_dashboard') {
// return (
// <div>
// <ChatSider
// refresh={refreshDialogList}
// dialogueList={dialogueList}
// listLoading={listLoading}
// historyLoading={historyLoading}
// order={order}
// />
// {isContract ? <DbEditor /> : <ChatContainer />}
// </div>
// );
// }
return (
<ChatContentContext.Provider
@@ -293,7 +304,8 @@ const Chat: React.FC = () => {
order={order}
/>
<Layout className="bg-transparent">
{isChatDefault ? (
{scene === 'chat_dashboard' ? (isContract ? <DbEditor /> : <ChatContainer />) : null}
{scene !== 'chat_dashboard' ? (isChatDefault ? (
<Content>
<ChatDefault />
</Content>
@@ -304,7 +316,7 @@ const Chat: React.FC = () => {
<ChatInputPanel ctrl={ctrl} />
</Content>
</Spin>
)}
)) : null}
</Layout>
</Layout>
</Flex>