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} {db.param}
</> </>
), ),
value: db.space_id || db.param, value: db.param,
}; };
}), }),
[dbs], [dbs],

View File

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

View File

@@ -251,20 +251,26 @@ const Chat: React.FC = () => {
} }
}, [isChatDefault]); }, [isChatDefault]);
// if (scene === 'chat_dashboard') { const contentRender = () => {
// return ( if (scene === 'chat_dashboard') {
// <div> return (isContract ?
// <ChatSider <DbEditor /> :
// refresh={refreshDialogList} <ChatContainer />);
// dialogueList={dialogueList} } else {
// listLoading={listLoading} return (isChatDefault ? (
// historyLoading={historyLoading} <Content>
// order={order} <ChatDefault />
// /> </Content>
// {isContract ? <DbEditor /> : <ChatContainer />} ) : (
// </div> <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 ( return (
<ChatContentContext.Provider <ChatContentContext.Provider
@@ -304,19 +310,7 @@ const Chat: React.FC = () => {
order={order} order={order}
/> />
<Layout className="bg-transparent"> <Layout className="bg-transparent">
{scene === 'chat_dashboard' ? (isContract ? <DbEditor /> : <ChatContainer />) : null} {contentRender()}
{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}
</Layout> </Layout>
</Layout> </Layout>
</Flex> </Flex>