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
80578a08
authored
Jun 15, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: app store
parent
2463e11c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
50 deletions
+60
-50
client/src/pages/model/share/components/list.tsx
+12
-6
client/src/pages/model/share/index.module.scss
+5
-0
client/src/pages/model/share/index.tsx
+43
-44
No files found.
client/src/pages/model/share/components/list.tsx
View file @
80578a08
import
React
from
'react'
;
import
{
Box
,
Flex
,
Button
,
Tooltip
}
from
'@chakra-ui/react'
;
import
{
Box
,
Flex
,
Button
,
Tooltip
,
Card
}
from
'@chakra-ui/react'
;
import
type
{
ShareModelItem
}
from
'@/types/model'
;
import
{
useRouter
}
from
'next/router'
;
import
MyIcon
from
'@/components/Icon'
;
...
...
@@ -18,14 +18,20 @@ const ShareModelList = ({
return
(
<>
{
models
.
map
((
model
)
=>
(
<
Flex
<
Card
key=
{
model
.
_id
}
display=
{
'flex'
}
w=
{
'100%'
}
flexDirection=
{
'column'
}
key=
{
model
.
_id
}
p=
{
4
}
border=
{
'1px solid'
}
borderColor=
{
'gray.200'
}
borderRadius=
{
'md'
}
border=
{
'1px solid '
}
userSelect=
{
'none'
}
boxShadow=
{
'none'
}
borderColor=
{
'myGray.200'
}
_hover=
{
{
boxShadow
:
'lg'
}
}
>
<
Flex
alignItems=
{
'center'
}
>
<
Avatar
...
...
@@ -76,7 +82,7 @@ const ShareModelList = ({
</
Button
>
</
Box
>
</
Flex
>
</
Flex
>
</
Card
>
))
}
</>
);
...
...
client/src/pages/model/share/index.module.scss
View file @
80578a08
...
...
@@ -5,3 +5,8 @@
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.textlg
{
background
:
linear-gradient
(
to
bottom
right
,
#1237b3
0%
,
#3370ff
40%
,
#4e83fd
80%
,
#85b1ff
100%
);
-webkit-background-clip
:
text
;
-webkit-text-fill-color
:
transparent
;
}
client/src/pages/model/share/index.tsx
View file @
80578a08
...
...
@@ -6,6 +6,7 @@ import { usePagination } from '@/hooks/usePagination';
import
type
{
ShareModelItem
}
from
'@/types/model'
;
import
{
useUserStore
}
from
'@/store/user'
;
import
ShareModelList
from
'./components/list'
;
import
styles
from
'./index.module.scss'
;
const
modelList
=
()
=>
{
const
{
Loading
}
=
useLoading
();
...
...
@@ -42,53 +43,51 @@ const modelList = () => {
);
return
(
<
Box
py=
{
[
5
,
10
]
}
px=
{
'5vw'
}
>
<
Card
px=
{
6
}
py=
{
3
}
>
<
Box
display=
{
[
'block'
,
'flex'
]
}
alignItems=
{
'center'
}
justifyContent=
{
'space-between'
}
>
<
Box
fontWeight=
{
'bold'
}
flex=
{
1
}
fontSize=
{
'xl'
}
>
应用市场
</
Box
>
<
Box
mt=
{
[
2
,
0
]
}
textAlign=
{
'right'
}
>
<
Input
w=
{
[
'200px'
,
'250px'
]
}
size=
{
'sm'
}
value=
{
searchText
}
placeholder=
"搜索应用,回车确认"
onChange=
{
(
e
)
=>
setSearchText
(
e
.
target
.
value
)
}
onBlur=
{
()
=>
{
if
(
searchText
===
lastSearch
.
current
)
return
;
<
Box
px=
{
[
5
,
10
]
}
py=
{
[
4
,
6
]
}
position=
{
'relative'
}
minH=
{
'109vh'
}
>
<
Flex
alignItems=
{
'center'
}
mb=
{
2
}
>
<
Box
className=
{
styles
.
textlg
}
fontWeight=
{
'bold'
}
fontSize=
{
'3xl'
}
>
AI 应用市场
</
Box
>
{
/* <Box mt={[2, 0]} textAlign={'right'}>
<Input
w={['200px', '250px']}
size={'sm'}
value={searchText}
placeholder="搜索应用,回车确认"
onChange={(e) => setSearchText(e.target.value)}
onBlur={() => {
if (searchText === lastSearch.current) return;
getData(1);
lastSearch.current = searchText;
}}
onKeyDown={(e) => {
if (searchText === lastSearch.current) return;
if (e.key === 'Enter') {
getData(1);
lastSearch.current = searchText;
}
}
onKeyDown=
{
(
e
)
=>
{
if
(
searchText
===
lastSearch
.
current
)
return
;
if
(
e
.
key
===
'Enter'
)
{
getData
(
1
);
lastSearch
.
current
=
searchText
;
}
}
}
/>
</
Box
>
</
Box
>
<
Grid
templateColumns=
{
[
'repeat(1,1fr)'
,
'repeat(2,1fr)'
,
'repeat(3,1fr)'
,
'repeat(4,1fr)'
,
'repeat(5,1fr)'
]
}
gridGap=
{
4
}
mt=
{
4
}
>
<
ShareModelList
models=
{
models
}
onclickCollection=
{
onclickCollection
}
/>
</
Grid
>
<
Flex
mt=
{
4
}
justifyContent=
{
'flex-end'
}
>
<
Pagination
/>
</
Flex
>
</
Card
>
}
}}
/>
</Box> */
}
</
Flex
>
<
Grid
templateColumns=
{
[
'repeat(1,1fr)'
,
'repeat(2,1fr)'
,
'repeat(3,1fr)'
,
'repeat(4,1fr)'
,
'repeat(5,1fr)'
]
}
gridGap=
{
4
}
mt=
{
4
}
>
<
ShareModelList
models=
{
models
}
onclickCollection=
{
onclickCollection
}
/>
</
Grid
>
<
Flex
mt=
{
4
}
justifyContent=
{
'center'
}
>
<
Pagination
/>
</
Flex
>
<
Loading
loading=
{
isLoading
}
/>
<
Loading
loading=
{
isLoading
}
fixed=
{
false
}
/>
</
Box
>
);
};
...
...
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