Merge remote-tracking branch 'origin/feat/dev-0.6' into feat/dev-0.6

This commit is contained in:
yhjun1026
2024-08-16 18:09:39 +08:00
3 changed files with 25 additions and 31 deletions

View File

@@ -75,7 +75,7 @@ const Resource: React.FC<{
{db.param}
</>
),
value: db.space_id || db.param,
value: db.param,
};
}),
[dbs],

View File

@@ -233,7 +233,7 @@ export default function DocPanel(props: IProps) {
const { run: search, loading: searchLoading } = useRequest(
async (id, doc_name: string) => {
const [, res] = await apiInterceptors(searchDocumentList(id, { doc_name }));
const [, res] = await apiInterceptors(searchDocumentList(space.name, { doc_name }));
return res;
},
{
@@ -249,7 +249,7 @@ export default function DocPanel(props: IProps) {
const { run: editChunkRun, loading: chunkLoading } = useRequest(
async (values: any) => {
return await editChunk(props.space.name, {
questions: values.questions.map((item: any) => item.question),
questions: values.questions?.map((item: any) => item.question),
doc_id: curDoc?.id || '',
doc_name: values.doc_name,
});

View File

@@ -250,21 +250,27 @@ const Chat: React.FC = () => {
setHistory([]);
}
}, [isChatDefault]);
// if (scene === 'chat_dashboard') {
// return (
// <div>
// <ChatSider
// refresh={refreshDialogList}
// dialogueList={dialogueList}
// listLoading={listLoading}
// historyLoading={historyLoading}
// order={order}
// />
// {isContract ? <DbEditor /> : <ChatContainer />}
// </div>
// );
// }
const contentRender = () => {
if (scene === 'chat_dashboard') {
return (isContract ?
<DbEditor /> :
<ChatContainer />);
} else {
return (isChatDefault ? (
<Content>
<ChatDefault />
</Content>
) : (
<Spin spinning={historyLoading} className="w-full h-full m-auto">
<Content className="flex flex-col h-screen">
<ChatContentContainer ref={scrollRef} />
<ChatInputPanel ctrl={ctrl} />
</Content>
</Spin>
));
}
}
return (
<ChatContentContext.Provider
@@ -304,19 +310,7 @@ const Chat: React.FC = () => {
order={order}
/>
<Layout className="bg-transparent">
{scene === 'chat_dashboard' ? (isContract ? <DbEditor /> : <ChatContainer />) : null}
{scene !== 'chat_dashboard' ? (isChatDefault ? (
<Content>
<ChatDefault />
</Content>
) : (
<Spin spinning={historyLoading} className="w-full h-full m-auto">
<Content className="flex flex-col h-screen">
<ChatContentContainer ref={scrollRef} />
<ChatInputPanel ctrl={ctrl} />
</Content>
</Spin>
)) : null}
{contentRender()}
</Layout>
</Layout>
</Flex>