Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
4061b119
authored
Oct 31, 2024
by
Archer
Committed by
GitHub
Oct 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dataset select check (#3048)
parent
bc171db9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
projects/app/src/components/core/app/DatasetSelectModal.tsx
+13
-7
No files found.
projects/app/src/components/core/app/DatasetSelectModal.tsx
View file @
4061b119
...
...
@@ -55,6 +55,9 @@ export const DatasetSelectModal = ({
)
};
},
[
datasets
,
allDatasets
,
selectedDatasets
]);
const
activeVectorModel
=
allDatasets
.
find
(
(
dataset
)
=>
dataset
.
_id
===
selectedDatasets
[
0
]?.
datasetId
)?.
vectorModel
?.
model
;
return
(
<
DatasetSelectContainer
...
...
@@ -141,11 +144,7 @@ export const DatasetSelectModal = ({
if
(
item
.
type
===
DatasetTypeEnum
.
folder
)
{
setParentId
(
item
.
_id
);
}
else
{
const
vectorModel
=
datasets
.
find
(
(
dataset
)
=>
dataset
.
_id
===
selectedDatasets
[
0
]?.
datasetId
)?.
vectorModel
?.
model
;
if
(
vectorModel
&&
vectorModel
!==
item
.
vectorModel
.
model
)
{
if
(
activeVectorModel
&&
activeVectorModel
!==
item
.
vectorModel
.
model
)
{
return
toast
({
status
:
'warning'
,
title
:
t
(
'common:dataset.Select Dataset Tips'
)
...
...
@@ -168,13 +167,20 @@ export const DatasetSelectModal = ({
{
item
.
name
}
</
Box
>
</
Flex
>
<
Flex
justifyContent=
{
'flex-end'
}
alignItems=
{
'center'
}
fontSize=
{
'sm'
}
>
<
Flex
justifyContent=
{
'flex-end'
}
alignItems=
{
'center'
}
fontSize=
{
'sm'
}
color=
{
activeVectorModel
===
item
.
vectorModel
.
name
?
'primary.600'
:
'myGray.500'
}
>
{
item
.
type
===
DatasetTypeEnum
.
folder
?
(
<
Box
color=
{
'myGray.500'
}
>
{
t
(
'common:Folder'
)
}
</
Box
>
)
:
(
<>
<
MyIcon
mr=
{
1
}
name=
"kbTest"
w=
{
'12px'
}
/>
<
Box
color=
{
'myGray.500'
}
>
{
item
.
vectorModel
.
name
}
</
Box
>
<
Box
>
{
item
.
vectorModel
.
name
}
</
Box
>
</>
)
}
</
Flex
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment