perf: 知识库数据结构

This commit is contained in:
archer
2023-04-01 22:31:56 +08:00
parent 5759cbeae0
commit ae4243b522
26 changed files with 611 additions and 518 deletions

View File

@@ -45,24 +45,22 @@ const InputDataModal = ({
setImporting(true);
try {
await postModelDataInput({
const res = await postModelDataInput({
modelId: modelId,
data: [
{
text: e.text,
q: [
{
id: nanoid(),
text: e.q
}
]
q: {
id: nanoid(),
text: e.q
}
}
]
});
toast({
title: '导入数据成功,需要一段时间训练',
status: 'success'
title: res === 0 ? '导入数据成功,需要一段时间训练' : '数据导入异常',
status: res === 0 ? 'success' : 'warning'
});
onClose();
onSuccess();
@@ -88,8 +86,15 @@ const InputDataModal = ({
<ModalHeader></ModalHeader>
<ModalCloseButton />
<Flex flex={'1 0 0'} h={0} px={6} pb={2}>
<Box flex={2} mr={4} h={'100%'}>
<Box
display={['block', 'flex']}
flex={'1 0 0'}
h={['100%', 0]}
overflowY={'auto'}
px={6}
pb={2}
>
<Box flex={2} mr={[0, 4]} mb={[4, 0]} h={['230px', '100%']}>
<Box h={'30px'}></Box>
<Textarea
placeholder="相关问题,可以回车输入多个问法, 最多500字"
@@ -101,10 +106,11 @@ const InputDataModal = ({
})}
/>
</Box>
<Box flex={3} h={'100%'}>
<Box flex={3} h={['330px', '100%']}>
<Box h={'30px'}></Box>
<Textarea
placeholder="知识点"
placeholder="知识点,最多1000字"
maxLength={1000}
resize={'none'}
h={'calc(100% - 30px)'}
{...register(`text`, {
@@ -112,7 +118,7 @@ const InputDataModal = ({
})}
/>
</Box>
</Flex>
</Box>
<Flex px={6} pt={2} pb={4}>
<Box flex={1}></Box>