mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix 4.9.6 (#4631)
* fix debug quote list * delete next text node match * fix extract default boolean value * export latest 100 chat items * fix quote item ui * doc * fix doc
This commit is contained in:
@@ -44,27 +44,30 @@ const QuoteList = React.memo(function QuoteList({
|
||||
}),
|
||||
{
|
||||
refreshDeps: [rawSearch, RawSourceBoxProps.chatId],
|
||||
manual: false
|
||||
manual: !chatItemDataId
|
||||
}
|
||||
);
|
||||
|
||||
const formatedDataList = useMemo(() => {
|
||||
return rawSearch
|
||||
.map((item) => {
|
||||
const currentFilterItem = quoteList?.find((res) => res._id === item.id);
|
||||
|
||||
const processedData = rawSearch.map((item) => {
|
||||
if (chatItemDataId && quoteList) {
|
||||
const currentFilterItem = quoteList.find((res) => res._id === item.id);
|
||||
return {
|
||||
...item,
|
||||
q: currentFilterItem?.q || '',
|
||||
a: currentFilterItem?.a || ''
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
const aScore = formatScore(a.score);
|
||||
const bScore = formatScore(b.score);
|
||||
return (bScore.primaryScore?.value || 0) - (aScore.primaryScore?.value || 0);
|
||||
});
|
||||
}, [quoteList, rawSearch]);
|
||||
}
|
||||
|
||||
return item;
|
||||
});
|
||||
|
||||
return processedData.sort((a, b) => {
|
||||
const aScore = formatScore(a.score);
|
||||
const bScore = formatScore(b.score);
|
||||
return (bScore.primaryScore?.value || 0) - (aScore.primaryScore?.value || 0);
|
||||
});
|
||||
}, [rawSearch, quoteList, chatItemDataId]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@@ -64,13 +64,15 @@ const QuoteItem = ({
|
||||
fontSize={'10px'}
|
||||
h={'full'}
|
||||
alignItems={'center'}
|
||||
mr={1}
|
||||
flexShrink={0}
|
||||
>
|
||||
{index + 1}
|
||||
</Flex>
|
||||
<Flex px={1.5}>
|
||||
<MyIcon name={icon as any} mr={1} flexShrink={0} w={'12px'} />
|
||||
<Box
|
||||
className="textEllipsis3"
|
||||
className={'textEllipsis'}
|
||||
wordBreak={'break-all'}
|
||||
flex={'1 0 0'}
|
||||
fontSize={'mini'}
|
||||
@@ -81,7 +83,7 @@ const QuoteItem = ({
|
||||
</Flex>
|
||||
</Box>
|
||||
{score && !isDeleted && (
|
||||
<Box className="hover-data" visibility={'hidden'}>
|
||||
<Box className="hover-data" visibility={'hidden'} flexShrink={0}>
|
||||
<ScoreTag {...score} />
|
||||
</Box>
|
||||
)}
|
||||
|
@@ -67,7 +67,6 @@ async function handler(req: ApiRequestProps<ExportChatLogsBody, {}>, res: NextAp
|
||||
}
|
||||
}
|
||||
]);
|
||||
console.log(teamMemberWithContact);
|
||||
|
||||
const where = {
|
||||
teamId: new Types.ObjectId(teamId),
|
||||
@@ -161,7 +160,7 @@ async function handler(req: ApiRequestProps<ExportChatLogsBody, {}>, res: NextAp
|
||||
},
|
||||
chatDetails: {
|
||||
$map: {
|
||||
input: '$chatitems',
|
||||
input: { $slice: ['$chatitems', -1000] },
|
||||
as: 'item',
|
||||
in: {
|
||||
id: '$$item._id',
|
||||
|
Reference in New Issue
Block a user