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
623018f4
authored
Jun 11, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: ui
parent
6b6da76a
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
228 additions
and
154 deletions
+228
-154
client/src/components/Tabs/index.tsx
+74
-0
client/src/components/WxConcat/index.tsx
+1
-1
client/src/constants/theme.ts
+25
-6
client/src/hooks/useConfirm.tsx
+1
-1
client/src/hooks/useEditInfo.tsx
+1
-1
client/src/pages/chat/components/History.tsx
+2
-2
client/src/pages/chat/components/PhoneSliderBar.tsx
+1
-1
client/src/pages/chat/index.tsx
+2
-2
client/src/pages/chat/share.tsx
+1
-1
client/src/pages/index.module.scss
+12
-0
client/src/pages/index.tsx
+35
-5
client/src/pages/kb/components/DataCard.tsx
+4
-4
client/src/pages/kb/components/Info.tsx
+1
-1
client/src/pages/kb/components/InputDataModal.tsx
+1
-1
client/src/pages/kb/components/KbList.tsx
+4
-4
client/src/pages/kb/components/SelectCsvModal.tsx
+1
-1
client/src/pages/kb/components/SelectFileModal.tsx
+1
-1
client/src/pages/model/components/ModelList.tsx
+18
-41
client/src/pages/model/components/detail/components/ModelEditForm.tsx
+4
-23
client/src/pages/model/components/detail/index.tsx
+2
-2
client/src/pages/model/share/components/list.tsx
+1
-1
client/src/pages/number/components/InformTable.tsx
+2
-2
client/src/pages/number/components/PayModal.tsx
+1
-1
client/src/pages/number/index.tsx
+32
-51
client/src/pages/openapi/index.tsx
+1
-1
No files found.
client/src/components/Tabs/index.tsx
0 → 100644
View file @
623018f4
import
React
,
{
useMemo
}
from
'react'
;
import
{
Box
,
Grid
,
useTheme
}
from
'@chakra-ui/react'
;
import
type
{
GridProps
}
from
'@chakra-ui/react'
;
// @ts-ignore
interface
Props
extends
GridProps
{
list
:
{
id
:
string
;
label
:
string
}[];
activeId
:
string
;
size
?:
'sm'
|
'md'
|
'lg'
;
onChange
:
(
id
:
string
)
=>
void
;
}
const
Tabs
=
({
list
,
size
=
'md'
,
activeId
,
onChange
,
...
props
}:
Props
)
=>
{
const
theme
=
useTheme
();
const
sizeMap
=
useMemo
(()
=>
{
switch
(
size
)
{
case
'sm'
:
return
{
fontSize
:
'sm'
,
outP
:
'3px'
,
inlineP
:
1
};
case
'md'
:
return
{
fontSize
:
'md'
,
outP
:
'4px'
,
inlineP
:
2
};
case
'lg'
:
return
{
fontSize
:
'lg'
,
outP
:
'5px'
,
inlineP
:
3
};
}
},
[
size
]);
return
(
<
Grid
gridTemplateColumns=
{
`repeat(${list.length},1fr)`
}
p=
{
sizeMap
.
outP
}
borderRadius=
{
'sm'
}
fontSize=
{
sizeMap
.
fontSize
}
{
...
props
}
>
{
list
.
map
((
item
)
=>
(
<
Box
key=
{
item
.
id
}
py=
{
sizeMap
.
inlineP
}
borderRadius=
{
'sm'
}
textAlign=
{
'center'
}
{
...
(
activeId
===
item
.
id
?
{
boxShadow
:
'0
px
2
px
2
px
rgba
(137,
156,
171,
0
.
25)',
backgroundImage
:
theme
.
lgColor
.
primary2
,
color
:
'
white
',
cursor
:
'
default
'
}
:
{
cursor
:
'
pointer
'
})}
onClick=
{
()
=>
{
if
(
activeId
===
item
.
id
)
return
;
onChange
(
item
.
id
);
}
}
>
{
item
.
label
}
</
Box
>
))
}
</
Grid
>
);
};
export
default
Tabs
;
client/src/components/WxConcat/index.tsx
View file @
623018f4
...
@@ -30,7 +30,7 @@ const WxConcat = ({ onClose }: { onClose: () => void }) => {
...
@@ -30,7 +30,7 @@ const WxConcat = ({ onClose }: { onClose: () => void }) => {
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
variant=
{
'
outlin
e'
}
onClick=
{
onClose
}
>
<
Button
variant=
{
'
bas
e'
}
onClick=
{
onClose
}
>
关闭
关闭
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
client/src/constants/theme.ts
View file @
623018f4
...
@@ -66,10 +66,11 @@ const Button = defineStyleConfig({
...
@@ -66,10 +66,11 @@ const Button = defineStyleConfig({
},
},
variants
:
{
variants
:
{
primary
:
{
primary
:
{
background
:
'myBlue.700 !important'
,
backgroundImage
:
'linear-gradient(to bottom right, #2152d9 0%,#3370ff 40%, #4e83fd 100%) !important'
,
color
:
'white'
,
color
:
'white'
,
_hover
:
{
_hover
:
{
filter
:
'brightness(11
0
%)'
filter
:
'brightness(11
5
%)'
}
}
},
},
base
:
{
base
:
{
...
@@ -77,12 +78,15 @@ const Button = defineStyleConfig({
...
@@ -77,12 +78,15 @@ const Button = defineStyleConfig({
border
:
'1px solid'
,
border
:
'1px solid'
,
borderColor
:
'myGray.200'
,
borderColor
:
'myGray.200'
,
bg
:
'transparent'
,
bg
:
'transparent'
,
transition
:
'background 0.3s'
,
_hover
:
{
_hover
:
{
color
:
'myBlue.600'
color
:
'myBlue.600'
,
bg
:
'myWhite.400'
},
},
_active
:
{
_active
:
{
color
:
'myBlue.700'
color
:
'myBlue.700'
}
},
_disabled
:
{
bg
:
'myGray.100 !important'
,
color
:
'myGray.700 !important'
}
}
}
},
},
defaultProps
:
{
defaultProps
:
{
...
@@ -180,6 +184,18 @@ export const theme = extendTheme({
...
@@ -180,6 +184,18 @@ export const theme = extendTheme({
}
}
},
},
colors
:
{
colors
:
{
myWhite
:
{
100
:
'#FEFEFE'
,
200
:
'#FDFDFE'
,
300
:
'#FBFBFC'
,
400
:
'#F8FAFB'
,
500
:
'#F6F8F9'
,
600
:
'#F4F6F8'
,
700
:
'#C3C5C6'
,
800
:
'#929495'
,
900
:
'#626263'
,
1000
:
'#313132'
},
myGray
:
{
myGray
:
{
100
:
'#EFF0F1'
,
100
:
'#EFF0F1'
,
200
:
'#DEE0E2'
,
200
:
'#DEE0E2'
,
...
@@ -204,6 +220,7 @@ export const theme = extendTheme({
...
@@ -204,6 +220,7 @@ export const theme = extendTheme({
900
:
'#1237b3'
,
900
:
'#1237b3'
,
1000
:
'#07228c'
1000
:
'#07228c'
},
},
myRead
:
{
myRead
:
{
600
:
'#ff4d4f'
600
:
'#ff4d4f'
}
}
...
@@ -232,9 +249,11 @@ export const theme = extendTheme({
...
@@ -232,9 +249,11 @@ export const theme = extendTheme({
xl
:
'1800px'
,
xl
:
'1800px'
,
'2xl'
:
'2100px'
'2xl'
:
'2100px'
},
},
active
:
{
lgColor
:
{
activeBlueGradient
:
'linear-gradient(120deg, #d6e8ff 0%, #f0f7ff 100%)'
,
activeBlueGradient
:
'linear-gradient(120deg, #d6e8ff 0%, #f0f7ff 100%)'
,
hoverBlueGradient
:
'linear-gradient(60deg, #f0f7ff 0%, #d6e8ff 100%)'
hoverBlueGradient
:
'linear-gradient(60deg, #f0f7ff 0%, #d6e8ff 100%)'
,
primary
:
'linear-gradient(to bottom right, #2152d9 0%,#3370ff 40%, #4e83fd 100%)'
,
primary2
:
'linear-gradient(to bottom right, #2152d9 0%,#3370ff 30%,#4e83fd 80%, #85b1ff 100%)'
},
},
components
:
{
components
:
{
Modal
:
ModalTheme
,
Modal
:
ModalTheme
,
...
...
client/src/hooks/useConfirm.tsx
View file @
623018f4
...
@@ -39,7 +39,7 @@ export const useConfirm = ({ title = '提示', content }: { title?: string; cont
...
@@ -39,7 +39,7 @@ export const useConfirm = ({ title = '提示', content }: { title?: string; cont
<
AlertDialogFooter
>
<
AlertDialogFooter
>
<
Button
<
Button
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
onClose
();
onClose
();
typeof
cancelCb
.
current
===
'function'
&&
cancelCb
.
current
();
typeof
cancelCb
.
current
===
'function'
&&
cancelCb
.
current
();
...
...
client/src/hooks/useEditInfo.tsx
View file @
623018f4
...
@@ -73,7 +73,7 @@ export const useEditInfo = ({
...
@@ -73,7 +73,7 @@ export const useEditInfo = ({
/>
/>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
mr=
{
3
}
variant=
{
'
outlin
e'
}
onClick=
{
onClose
}
>
<
Button
mr=
{
3
}
variant=
{
'
bas
e'
}
onClick=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
onClick=
{
onclickConfirm
}
>
确认
</
Button
>
<
Button
onClick=
{
onclickConfirm
}
>
确认
</
Button
>
...
...
client/src/pages/chat/components/History.tsx
View file @
623018f4
...
@@ -158,11 +158,11 @@ const PcSliderBar = ({
...
@@ -158,11 +158,11 @@ const PcSliderBar = ({
cursor=
{
'pointer'
}
cursor=
{
'pointer'
}
transition=
{
'background-color .2s ease-in'
}
transition=
{
'background-color .2s ease-in'
}
_hover=
{
{
_hover=
{
{
backgroundImage
:
[
''
,
theme
.
active
.
hoverBlueGradient
]
backgroundImage
:
[
''
,
theme
.
lgColor
.
hoverBlueGradient
]
}
}
}
}
{
...
(
item
.
_id
===
chatId
{
...
(
item
.
_id
===
chatId
?
{
?
{
backgroundImage
:
`
$
{
theme
.
active
.
activeBlueGradient
}`
backgroundImage
:
`
$
{
theme
.
lgColor
.
activeBlueGradient
}`
}
}
:
{
:
{
bg
:
item
.
top
?
'
myGray
.
200'
:
''
bg
:
item
.
top
?
'
myGray
.
200'
:
''
...
...
client/src/pages/chat/components/PhoneSliderBar.tsx
View file @
623018f4
...
@@ -78,7 +78,7 @@ const PhoneSliderBar = ({
...
@@ -78,7 +78,7 @@ const PhoneSliderBar = ({
{
/* 新对话 */
}
{
/* 新对话 */
}
<
Button
<
Button
w=
{
'50%'
}
w=
{
'50%'
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
colorScheme=
{
'white'
}
colorScheme=
{
'white'
}
mb=
{
2
}
mb=
{
2
}
leftIcon=
{
<
AddIcon
/>
}
leftIcon=
{
<
AddIcon
/>
}
...
...
client/src/pages/chat/index.tsx
View file @
623018f4
...
@@ -749,7 +749,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
...
@@ -749,7 +749,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
size={'xs'}
size={'xs'}
fontWeight={'normal'}
fontWeight={'normal'}
colorScheme={'gray'}
colorScheme={'gray'}
variant={'
outlin
e'}
variant={'
bas
e'}
px={[2, 4]}
px={[2, 4]}
onClick={() => setShowSystemPrompt(item.systemPrompt || '')}
onClick={() => setShowSystemPrompt(item.systemPrompt || '')}
>
>
...
@@ -762,7 +762,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
...
@@ -762,7 +762,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
size={'xs'}
size={'xs'}
fontWeight={'normal'}
fontWeight={'normal'}
colorScheme={'gray'}
colorScheme={'gray'}
variant={'
outlin
e'}
variant={'
bas
e'}
px={[2, 4]}
px={[2, 4]}
onClick={() => setShowHistoryQuote(item._id)}
onClick={() => setShowHistoryQuote(item._id)}
>
>
...
...
client/src/pages/chat/share.tsx
View file @
623018f4
...
@@ -828,7 +828,7 @@ const Chat = ({ shareId, historyId }: { shareId: string; historyId: string }) =>
...
@@ -828,7 +828,7 @@ const Chat = ({ shareId, historyId }: { shareId: string; historyId: string }) =>
<
/Flex
>
<
/Flex
>
<
/ModalBody
>
<
/ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
variant=
{
'
outlin
e'
}
mr=
{
3
}
onClick=
{
onClosePassword
}
>
<
Button
variant=
{
'
bas
e'
}
mr=
{
3
}
onClick=
{
onClosePassword
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
onClick=
{
loadChatInfo
}
>
确定
</
Button
>
<
Button
onClick=
{
loadChatInfo
}
>
确定
</
Button
>
...
...
client/src/pages/index.module.scss
View file @
623018f4
...
@@ -2,4 +2,16 @@
...
@@ -2,4 +2,16 @@
*
{
*
{
position
:
relative
;
position
:
relative
;
}
}
.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/index.tsx
View file @
623018f4
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Box
,
Link
,
Flex
,
Image
,
Button
}
from
'@chakra-ui/react'
;
import
{
Card
,
Box
,
Link
,
Flex
,
Image
,
Button
}
from
'@chakra-ui/react'
;
import
Markdown
from
'@/components/Markdown'
;
import
Markdown
from
'@/components/Markdown'
;
import
{
useMarkdown
}
from
'@/hooks/useMarkdown'
;
import
{
useMarkdown
}
from
'@/hooks/useMarkdown'
;
...
@@ -6,6 +6,8 @@ import { useRouter } from 'next/router';
...
@@ -6,6 +6,8 @@ import { useRouter } from 'next/router';
import
{
useGlobalStore
}
from
'@/store/global'
;
import
{
useGlobalStore
}
from
'@/store/global'
;
import
styles
from
'./index.module.scss'
;
import
styles
from
'./index.module.scss'
;
import
axios
from
'axios'
;
import
MyIcon
from
'@/components/Icon'
;
const
Home
=
()
=>
{
const
Home
=
()
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -15,6 +17,7 @@ const Home = () => {
...
@@ -15,6 +17,7 @@ const Home = () => {
isPc
,
isPc
,
initData
:
{
beianText
}
initData
:
{
beianText
}
}
=
useGlobalStore
();
}
=
useGlobalStore
();
const
[
star
,
setStar
]
=
useState
(
1500
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
inviterId
)
{
if
(
inviterId
)
{
...
@@ -135,6 +138,13 @@ const Home = () => {
...
@@ -135,6 +138,13 @@ const Home = () => {
},
500
);
},
500
);
},
[
isPc
]);
},
[
isPc
]);
useEffect
(()
=>
{
(
async
()
=>
{
const
{
data
:
git
}
=
await
axios
.
get
(
'https://api.github.com/repos/c121914yu/FastGPT'
);
setStar
(
git
.
stargazers_count
);
})();
},
[]);
return
(
return
(
<
Flex
<
Flex
className=
{
styles
.
home
}
className=
{
styles
.
home
}
...
@@ -155,22 +165,41 @@ const Home = () => {
...
@@ -155,22 +165,41 @@ const Home = () => {
>
>
<
Image
src=
"/icon/logo.png"
w=
{
[
'70px'
,
'120px'
]
}
h=
{
[
'70px'
,
'120px'
]
}
alt=
{
''
}
></
Image
>
<
Image
src=
"/icon/logo.png"
w=
{
[
'70px'
,
'120px'
]
}
h=
{
[
'70px'
,
'120px'
]
}
alt=
{
''
}
></
Image
>
<
Box
<
Box
className=
{
styles
.
textlg
}
fontWeight=
{
'bold'
}
fontWeight=
{
'bold'
}
fontSize=
{
[
'40px'
,
'70px'
]
}
fontSize=
{
[
'40px'
,
'70px'
]
}
letterSpacing=
{
'5px'
}
letterSpacing=
{
'5px'
}
color=
{
'myBlue.600'
}
>
>
FastGpt
FastGpt
</
Box
>
</
Box
>
<
Box
c
olor=
{
'myBlue.600
'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
<
Box
c
lassName=
{
styles
.
textlg
}
fontWeight=
{
'bold
'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
三分钟
三分钟
</
Box
>
</
Box
>
<
Box
c
olor=
{
'myBlue.600
'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
<
Box
c
lassName=
{
styles
.
textlg
}
fontWeight=
{
'bold
'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
搭建 AI 知识库
搭建 AI 知识库
</
Box
>
</
Box
>
<
Flex
flexDirection=
{
[
'column'
,
'row'
]
}
my=
{
5
}
>
<
Button
mr=
{
[
0
,
5
]
}
mb=
{
[
5
,
0
]
}
fontSize=
{
[
'xl'
,
'3xl'
]
}
h=
{
'auto'
}
py=
{
[
2
,
3
]
}
variant=
{
'base'
}
border=
{
'2px solid'
}
borderColor=
{
'myGray.800'
}
transition=
{
'0.3s'
}
_hover=
{
{
bg
:
'myGray.800'
,
color
:
'white'
}
}
leftIcon=
{
<
MyIcon
name=
{
'git'
}
w=
{
'20px'
}
/>
}
onClick=
{
()
=>
window
.
open
(
'https://github.com/c121914yu/FastGPT'
,
'_blank'
)
}
>
Stars
{
(
star
/
1000
).
toFixed
(
1
)
}
k
</
Button
>
<
Button
<
Button
my=
{
5
}
fontSize=
{
[
'xl'
,
'3xl'
]
}
fontSize=
{
[
'xl'
,
'3xl'
]
}
h=
{
'auto'
}
h=
{
'auto'
}
py=
{
[
2
,
3
]
}
py=
{
[
2
,
3
]
}
...
@@ -179,6 +208,7 @@ const Home = () => {
...
@@ -179,6 +208,7 @@ const Home = () => {
点击开始
点击开始
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
</
Flex
>
<
Box
w=
{
'100%'
}
mt=
{
'100vh'
}
px=
{
[
5
,
10
]
}
pb=
{
[
5
,
10
]
}
>
<
Box
w=
{
'100%'
}
mt=
{
'100vh'
}
px=
{
[
5
,
10
]
}
pb=
{
[
5
,
10
]
}
>
<
Card
p=
{
5
}
lineHeight=
{
2
}
>
<
Card
p=
{
5
}
lineHeight=
{
2
}
>
...
...
client/src/pages/kb/components/DataCard.tsx
View file @
623018f4
...
@@ -157,7 +157,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
...
@@ -157,7 +157,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
<
IconButton
<
IconButton
icon=
{
<
RepeatIcon
/>
}
icon=
{
<
RepeatIcon
/>
}
aria
-
label=
{
'refresh'
}
aria
-
label=
{
'refresh'
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
mr=
{
[
2
,
4
]
}
mr=
{
[
2
,
4
]
}
size=
{
'sm'
}
size=
{
'sm'
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
@@ -166,7 +166,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
...
@@ -166,7 +166,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
}
}
}
}
/>
/>
<
Button
<
Button
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
mr=
{
2
}
mr=
{
2
}
size=
{
'sm'
}
size=
{
'sm'
}
isLoading=
{
isLoadingExport
}
isLoading=
{
isLoadingExport
}
...
@@ -259,7 +259,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
...
@@ -259,7 +259,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
<
IconButton
<
IconButton
mr=
{
5
}
mr=
{
5
}
icon=
{
<
EditIcon
/>
}
icon=
{
<
EditIcon
/>
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
aria
-
label=
{
'delete'
}
aria
-
label=
{
'delete'
}
size=
{
'sm'
}
size=
{
'sm'
}
onClick=
{
()
=>
onClick=
{
()
=>
...
@@ -272,7 +272,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
...
@@ -272,7 +272,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
/>
/>
<
IconButton
<
IconButton
icon=
{
<
DeleteIcon
/>
}
icon=
{
<
DeleteIcon
/>
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
colorScheme=
{
'gray'
}
colorScheme=
{
'gray'
}
aria
-
label=
{
'delete'
}
aria
-
label=
{
'delete'
}
size=
{
'sm'
}
size=
{
'sm'
}
...
...
client/src/pages/kb/components/Info.tsx
View file @
623018f4
...
@@ -211,7 +211,7 @@ const Info = (
...
@@ -211,7 +211,7 @@ const Info = (
.split(' ')
.split(' ')
.filter((item) => item)
.filter((item) => item)
.map((item, i) => (
.map((item, i) => (
<Tag mr={2} mb={2} key={i} variant={'
outlin
e'} colorScheme={'blue'}>
<Tag mr={2} mb={2} key={i} variant={'
bas
e'} colorScheme={'blue'}>
{item}
{item}
</Tag>
</Tag>
))}
))}
...
...
client/src/pages/kb/components/InputDataModal.tsx
View file @
623018f4
...
@@ -171,7 +171,7 @@ const InputDataModal = ({
...
@@ -171,7 +171,7 @@ const InputDataModal = ({
<
Flex
px=
{
6
}
pt=
{
2
}
pb=
{
4
}
>
<
Flex
px=
{
6
}
pt=
{
2
}
pb=
{
4
}
>
<
Box
flex=
{
1
}
></
Box
>
<
Box
flex=
{
1
}
></
Box
>
<
Button
variant=
{
'
outlin
e'
}
mr=
{
3
}
onClick=
{
onClose
}
>
<
Button
variant=
{
'
bas
e'
}
mr=
{
3
}
onClick=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
<
Button
...
...
client/src/pages/kb/components/KbList.tsx
View file @
623018f4
...
@@ -82,7 +82,7 @@ const KbList = ({ kbId }: { kbId: string }) => {
...
@@ -82,7 +82,7 @@ const KbList = ({ kbId }: { kbId: string }) => {
h=
{
'32px'
}
h=
{
'32px'
}
icon=
{
<
AddIcon
/>
}
icon=
{
<
AddIcon
/>
}
aria
-
label=
{
''
}
aria
-
label=
{
''
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
onClick=
{
handleCreateModel
}
onClick=
{
handleCreateModel
}
/>
/>
</
Tooltip
>
</
Tooltip
>
...
@@ -98,11 +98,11 @@ const KbList = ({ kbId }: { kbId: string }) => {
...
@@ -98,11 +98,11 @@ const KbList = ({ kbId }: { kbId: string }) => {
cursor=
{
'pointer'
}
cursor=
{
'pointer'
}
transition=
{
'background-color .2s ease-in'
}
transition=
{
'background-color .2s ease-in'
}
_hover=
{
{
_hover=
{
{
backgroundImage
:
[
''
,
theme
.
active
.
hoverBlueGradient
]
backgroundImage
:
[
''
,
theme
.
lgColor
.
hoverBlueGradient
]
}
}
}
}
{
...
(
kbId
===
item
.
_id
{
...
(
kbId
===
item
.
_id
?
{
?
{
backgroundImage
:
`
$
{
theme
.
active
.
activeBlueGradient
}
!
important
`
backgroundImage
:
`
$
{
theme
.
lgColor
.
activeBlueGradient
}
!
important
`
}
}
:
{})}
:
{})}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
@@ -121,7 +121,7 @@ const KbList = ({ kbId }: { kbId: string }) => {
...
@@ -121,7 +121,7 @@ const KbList = ({ kbId }: { kbId: string }) => {
<>
{
item
.
tags
||
'你还没设置标签~'
}
</>
<>
{
item
.
tags
||
'你还没设置标签~'
}
</>
)
:
(
)
:
(
item
.
tags
.
split
(
' '
).
map
((
item
,
i
)
=>
(
item
.
tags
.
split
(
' '
).
map
((
item
,
i
)
=>
(
<
Tag
key=
{
i
}
mr=
{
2
}
mb=
{
2
}
variant=
{
'
outlin
e'
}
colorScheme=
{
'blue'
}
size=
{
'sm'
}
>
<
Tag
key=
{
i
}
mr=
{
2
}
mb=
{
2
}
variant=
{
'
bas
e'
}
colorScheme=
{
'blue'
}
size=
{
'sm'
}
>
{
item
}
{
item
}
</
Tag
>
</
Tag
>
))
))
...
...
client/src/pages/kb/components/SelectCsvModal.tsx
View file @
623018f4
...
@@ -159,7 +159,7 @@ const SelectJsonModal = ({
...
@@ -159,7 +159,7 @@ const SelectJsonModal = ({
<
Flex
px=
{
6
}
pt=
{
2
}
pb=
{
4
}
>
<
Flex
px=
{
6
}
pt=
{
2
}
pb=
{
4
}
>
<
Box
flex=
{
1
}
></
Box
>
<
Box
flex=
{
1
}
></
Box
>
<
Button
variant=
{
'
outlin
e'
}
isLoading=
{
uploading
}
mr=
{
3
}
onClick=
{
onClose
}
>
<
Button
variant=
{
'
bas
e'
}
isLoading=
{
uploading
}
mr=
{
3
}
onClick=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
isDisabled=
{
fileData
.
length
===
0
||
uploading
}
onClick=
{
openConfirm
(
mutate
)
}
>
<
Button
isDisabled=
{
fileData
.
length
===
0
||
uploading
}
onClick=
{
openConfirm
(
mutate
)
}
>
...
...
client/src/pages/kb/components/SelectFileModal.tsx
View file @
623018f4
...
@@ -292,7 +292,7 @@ const SelectFileModal = ({
...
@@ -292,7 +292,7 @@ const SelectFileModal = ({
选择文件
选择文件
</
Button
>
</
Button
>
<
Box
flex=
{
1
}
></
Box
>
<
Box
flex=
{
1
}
></
Box
>
<
Button
variant=
{
'
outlin
e'
}
isLoading=
{
uploading
}
mr=
{
3
}
onClick=
{
onClose
}
>
<
Button
variant=
{
'
bas
e'
}
isLoading=
{
uploading
}
mr=
{
3
}
onClick=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
<
Button
...
...
client/src/pages/model/components/ModelList.tsx
View file @
623018f4
import
React
,
{
useCallback
,
useMemo
,
useRef
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
useMemo
,
useRef
,
useState
}
from
'react'
;
import
{
import
{
Box
,
Flex
,
Input
,
IconButton
,
Tooltip
,
Tab
,
useTheme
}
from
'@chakra-ui/react'
;
Box
,
Flex
,
Input
,
IconButton
,
Tooltip
,
Tabs
,
TabList
,
Tab
,
useTheme
}
from
'@chakra-ui/react'
;
import
{
AddIcon
}
from
'@chakra-ui/icons'
;
import
{
AddIcon
}
from
'@chakra-ui/icons'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useRouter
}
from
'next/router'
;
import
MyIcon
from
'@/components/Icon'
;
import
MyIcon
from
'@/components/Icon'
;
...
@@ -18,14 +8,12 @@ import { useLoading } from '@/hooks/useLoading';
...
@@ -18,14 +8,12 @@ import { useLoading } from '@/hooks/useLoading';
import
{
useToast
}
from
'@/hooks/useToast'
;
import
{
useToast
}
from
'@/hooks/useToast'
;
import
{
useQuery
}
from
'@tanstack/react-query'
;
import
{
useQuery
}
from
'@tanstack/react-query'
;
import
{
useUserStore
}
from
'@/store/user'
;
import
{
useUserStore
}
from
'@/store/user'
;
import
Avatar
from
'@/components/Avatar'
;
import
{
MyModelsTypeEnum
}
from
'@/constants/user'
;
import
{
MyModelsTypeEnum
}
from
'@/constants/user'
;
import
Avatar
from
'@/components/Avatar'
;
import
Tabs
from
'@/components/Tabs'
;
const
ModelList
=
({
modelId
}:
{
modelId
:
string
})
=>
{
const
ModelList
=
({
modelId
}:
{
modelId
:
string
})
=>
{
const
tabs
=
useRef
([
{
label
:
'我的'
,
value
:
MyModelsTypeEnum
.
my
},
{
label
:
'收藏'
,
value
:
MyModelsTypeEnum
.
collection
}
]);
const
[
currentTab
,
setCurrentTab
]
=
useState
(
MyModelsTypeEnum
.
my
);
const
[
currentTab
,
setCurrentTab
]
=
useState
(
MyModelsTypeEnum
.
my
);
const
theme
=
useTheme
();
const
theme
=
useTheme
();
...
@@ -86,7 +74,7 @@ const ModelList = ({ modelId }: { modelId: string }) => {
...
@@ -86,7 +74,7 @@ const ModelList = ({ modelId }: { modelId: string }) => {
bg=
{
'white'
}
bg=
{
'white'
}
borderRight=
{
[
''
,
theme
.
borders
.
base
]
}
borderRight=
{
[
''
,
theme
.
borders
.
base
]
}
>
>
<
Flex
w=
{
'90%'
}
m
y=
{
5
}
mx=
{
'auto'
}
>
<
Flex
w=
{
'90%'
}
m
t=
{
5
}
mb=
{
3
}
mx=
{
'auto'
}
>
<
Flex
flex=
{
1
}
mr=
{
2
}
position=
{
'relative'
}
alignItems=
{
'center'
}
>
<
Flex
flex=
{
1
}
mr=
{
2
}
position=
{
'relative'
}
alignItems=
{
'center'
}
>
<
Input
<
Input
h=
{
'32px'
}
h=
{
'32px'
}
...
@@ -113,34 +101,23 @@ const ModelList = ({ modelId }: { modelId: string }) => {
...
@@ -113,34 +101,23 @@ const ModelList = ({ modelId }: { modelId: string }) => {
h=
{
'32px'
}
h=
{
'32px'
}
icon=
{
<
AddIcon
/>
}
icon=
{
<
AddIcon
/>
}
aria
-
label=
{
''
}
aria
-
label=
{
''
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
onClick=
{
onclickCreateModel
}
onClick=
{
onclickCreateModel
}
/>
/>
</
Tooltip
>
</
Tooltip
>
</
Flex
>
</
Flex
>
<
Flex
mb=
{
4
}
userSelect=
{
'none'
}
>
<
Flex
mb=
{
3
}
userSelect=
{
'none'
}
>
<
Box
flex=
{
1
}
></
Box
>
<
Box
flex=
{
1
}
></
Box
>
<
Tabs
<
Tabs
variant=
"unstyled"
w=
{
'130px'
}
defaultIndex=
{
tabs
.
current
.
findIndex
((
item
)
=>
item
.
value
===
currentTab
)
}
list=
{
[
onChange=
{
(
i
)
=>
setCurrentTab
(
tabs
.
current
[
i
].
value
)
}
{
label
:
'我的'
,
id
:
MyModelsTypeEnum
.
my
},
>
{
label
:
'收藏'
,
id
:
MyModelsTypeEnum
.
collection
}
<
TabList
whiteSpace=
{
'nowrap'
}
>
]
}
{
tabs
.
current
.
map
((
item
)
=>
(
activeId=
{
currentTab
}
<
Tab
size=
{
'sm'
}
key=
{
item
.
value
}
onChange=
{
(
id
:
any
)
=>
setCurrentTab
(
id
)
}
py=
{
'2px'
}
/>
px=
{
4
}
borderRadius=
{
'sm'
}
mr=
{
2
}
transition=
{
'none'
}
_selected=
{
{
color
:
'white'
,
bg
:
'myBlue.600'
}
}
>
{
item
.
label
}
</
Tab
>
))
}
</
TabList
>
</
Tabs
>
</
Flex
>
</
Flex
>
<
Box
flex=
{
'1 0 0'
}
h=
{
0
}
overflow=
{
'overlay'
}
userSelect=
{
'none'
}
>
<
Box
flex=
{
'1 0 0'
}
h=
{
0
}
overflow=
{
'overlay'
}
userSelect=
{
'none'
}
>
{
currentModels
.
list
.
map
((
item
)
=>
(
{
currentModels
.
list
.
map
((
item
)
=>
(
...
@@ -153,11 +130,11 @@ const ModelList = ({ modelId }: { modelId: string }) => {
...
@@ -153,11 +130,11 @@ const ModelList = ({ modelId }: { modelId: string }) => {
cursor=
{
'pointer'
}
cursor=
{
'pointer'
}
transition=
{
'background-color .2s ease-in'
}
transition=
{
'background-color .2s ease-in'
}
_hover=
{
{
_hover=
{
{
backgroundImage
:
[
''
,
theme
.
active
.
hoverBlueGradient
]
backgroundImage
:
[
''
,
theme
.
lgColor
.
hoverBlueGradient
]
}
}
}
}
{
...
(
modelId
===
item
.
_id
{
...
(
modelId
===
item
.
_id
?
{
?
{
backgroundImage
:
`
$
{
theme
.
active
.
activeBlueGradient
}
!
important
`
backgroundImage
:
`
$
{
theme
.
lgColor
.
activeBlueGradient
}
!
important
`
}
}
:
{})}
:
{})}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
...
client/src/pages/model/components/detail/components/ModelEditForm.tsx
View file @
623018f4
...
@@ -278,7 +278,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -278,7 +278,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
<
Box
flex=
{
'0 0 100px'
}
>
删除应用
</
Box
>
<
Box
flex=
{
'0 0 100px'
}
>
删除应用
</
Box
>
<
Button
<
Button
colorScheme=
{
'gray'
}
colorScheme=
{
'gray'
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
size=
{
'sm'
}
size=
{
'sm'
}
onClick=
{
openConfirm
(
handleDelModel
)
}
onClick=
{
openConfirm
(
handleDelModel
)
}
>
>
...
@@ -388,20 +388,6 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -388,20 +388,6 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
setRefresh
(
!
refresh
);
setRefresh
(
!
refresh
);
}
}
}
}
/>
/>
<
Box
ml=
{
12
}
mr=
{
1
}
fontSize=
{
[
'sm'
,
'md'
]
}
>
分享模型细节:
</
Box
>
<
Tooltip
label=
"开启分享详情后,其他用户可以查看该模型的特有数据:温度、提示词和数据集。"
>
<
QuestionOutlineIcon
mr=
{
3
}
/>
</
Tooltip
>
<
Switch
isChecked=
{
getValues
(
'share.isShareDetail'
)
}
onChange=
{
()
=>
{
setValue
(
'share.isShareDetail'
,
!
getValues
(
'share.isShareDetail'
));
setRefresh
(
!
refresh
);
}
}
/>
</
Flex
>
</
Flex
>
<
Box
mt=
{
5
}
>
<
Box
mt=
{
5
}
>
<
Box
>
模型介绍
</
Box
>
<
Box
>
模型介绍
</
Box
>
...
@@ -418,12 +404,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -418,12 +404,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
<
Card
p=
{
4
}
>
<
Card
p=
{
4
}
>
<
Flex
justifyContent=
{
'space-between'
}
>
<
Flex
justifyContent=
{
'space-between'
}
>
<
Box
fontWeight=
{
'bold'
}
>
关联的知识库
</
Box
>
<
Box
fontWeight=
{
'bold'
}
>
关联的知识库
</
Box
>
<
Button
<
Button
size=
{
'sm'
}
variant=
{
'base'
}
colorScheme=
{
'myBlue'
}
onClick=
{
onOpenKbSelect
}
>
size=
{
'sm'
}
variant=
{
'outline'
}
colorScheme=
{
'myBlue'
}
onClick=
{
onOpenKbSelect
}
>
选择
选择
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
@@ -443,7 +424,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -443,7 +424,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
</
Box
>
</
Box
>
<
Button
<
Button
size=
{
'sm'
}
size=
{
'sm'
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
colorScheme=
{
'myBlue'
}
colorScheme=
{
'myBlue'
}
{
...
(
shareChatList
.
length
>
= 10
{
...
(
shareChatList
.
length
>
= 10
?
{
?
{
...
@@ -585,7 +566,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -585,7 +566,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
variant=
{
'
outlin
e'
}
mr=
{
3
}
onClick=
{
onCloseCreateShareChat
}
>
<
Button
variant=
{
'
bas
e'
}
mr=
{
3
}
onClick=
{
onCloseCreateShareChat
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
onClick=
{
submitShareChat
(
onclickCreateShareChat
)
}
>
确认
</
Button
>
<
Button
onClick=
{
submitShareChat
(
onclickCreateShareChat
)
}
>
确认
</
Button
>
...
...
client/src/pages/model/components/detail/index.tsx
View file @
623018f4
...
@@ -141,7 +141,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
...
@@ -141,7 +141,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
{
modelDetail
.
name
}
{
modelDetail
.
name
}
</
Box
>
</
Box
>
<
Box
flex=
{
1
}
/>
<
Box
flex=
{
1
}
/>
<
Button
variant=
{
'
outlin
e'
}
onClick=
{
handlePreviewChat
}
>
<
Button
variant=
{
'
bas
e'
}
onClick=
{
handlePreviewChat
}
>
开始对话
开始对话
</
Button
>
</
Button
>
{
isOwner
&&
(
{
isOwner
&&
(
...
@@ -173,7 +173,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
...
@@ -173,7 +173,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
</
Box
>
</
Box
>
</
Flex
>
</
Flex
>
<
Box
mt=
{
4
}
textAlign=
{
'right'
}
>
<
Box
mt=
{
4
}
textAlign=
{
'right'
}
>
<
Button
variant=
{
'
outlin
e'
}
size=
{
'sm'
}
onClick=
{
handlePreviewChat
}
>
<
Button
variant=
{
'
bas
e'
}
size=
{
'sm'
}
onClick=
{
handlePreviewChat
}
>
开始对话
开始对话
</
Button
>
</
Button
>
{
isOwner
&&
(
{
isOwner
&&
(
...
...
client/src/pages/model/share/components/list.tsx
View file @
623018f4
...
@@ -68,7 +68,7 @@ const ShareModelList = ({
...
@@ -68,7 +68,7 @@ const ShareModelList = ({
<
Box
>
<
Box
>
<
Button
<
Button
size=
{
'sm'
}
size=
{
'sm'
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
w=
{
[
'60px'
,
'70px'
]
}
w=
{
[
'60px'
,
'70px'
]
}
onClick=
{
()
=>
router
.
push
(
`/chat?modelId=${model._id}`
)
}
onClick=
{
()
=>
router
.
push
(
`/chat?modelId=${model._id}`
)
}
>
>
...
...
client/src/pages/number/components/InformTable.tsx
View file @
623018f4
...
@@ -31,7 +31,7 @@ const BillTable = () => {
...
@@ -31,7 +31,7 @@ const BillTable = () => {
});
});
return
(
return
(
<>
<
Box
mt=
{
2
}
>
<
Accordion
defaultIndex=
{
[
0
,
1
,
2
]
}
allowMultiple
>
<
Accordion
defaultIndex=
{
[
0
,
1
,
2
]
}
allowMultiple
>
{
informs
.
map
((
item
)
=>
(
{
informs
.
map
((
item
)
=>
(
<
AccordionItem
<
AccordionItem
...
@@ -84,7 +84,7 @@ const BillTable = () => {
...
@@ -84,7 +84,7 @@ const BillTable = () => {
</
Flex
>
</
Flex
>
)
}
)
}
<
Loading
loading=
{
isLoading
&&
informs
.
length
===
0
}
fixed=
{
false
}
/>
<
Loading
loading=
{
isLoading
&&
informs
.
length
===
0
}
fixed=
{
false
}
/>
</>
</
Box
>
);
);
};
};
...
...
client/src/pages/number/components/PayModal.tsx
View file @
623018f4
...
@@ -130,7 +130,7 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
...
@@ -130,7 +130,7 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
<
ModalFooter
>
<
ModalFooter
>
{
!
payId
&&
(
{
!
payId
&&
(
<>
<>
<
Button
variant=
{
'
outlin
e'
}
onClick=
{
onClose
}
>
<
Button
variant=
{
'
bas
e'
}
onClick=
{
onClose
}
>
取消
取消
</
Button
>
</
Button
>
<
Button
<
Button
...
...
client/src/pages/number/index.tsx
View file @
623018f4
import
React
,
{
useCallback
,
useRef
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
useRef
,
useState
}
from
'react'
;
import
{
import
{
Card
,
Box
,
Flex
,
Button
,
Input
,
Grid
,
useDisclosure
}
from
'@chakra-ui/react'
;
Card
,
Box
,
Flex
,
Button
,
Input
,
Grid
,
useDisclosure
,
Tabs
,
TabList
,
TabPanels
,
Tab
,
TabPanel
}
from
'@chakra-ui/react'
;
import
{
useForm
}
from
'react-hook-form'
;
import
{
useForm
}
from
'react-hook-form'
;
import
{
UserUpdateParams
}
from
'@/types/user'
;
import
{
UserUpdateParams
}
from
'@/types/user'
;
import
{
putUserInfo
,
getPromotionInitData
}
from
'@/api/user'
;
import
{
putUserInfo
,
getPromotionInitData
}
from
'@/api/user'
;
...
@@ -30,6 +17,7 @@ import { useCopyData } from '@/utils/tools';
...
@@ -30,6 +17,7 @@ import { useCopyData } from '@/utils/tools';
import
Loading
from
'@/components/Loading'
;
import
Loading
from
'@/components/Loading'
;
import
Avatar
from
'@/components/Avatar'
;
import
Avatar
from
'@/components/Avatar'
;
import
MyIcon
from
'@/components/Icon'
;
import
MyIcon
from
'@/components/Icon'
;
import
Tabs
from
'@/components/Tabs'
;
const
PayRecordTable
=
dynamic
(()
=>
import
(
'./components/PayRecordTable'
),
{
const
PayRecordTable
=
dynamic
(()
=>
import
(
'./components/PayRecordTable'
),
{
loading
:
()
=>
<
Loading
fixed=
{
false
}
/>,
loading
:
()
=>
<
Loading
fixed=
{
false
}
/>,
...
@@ -65,11 +53,13 @@ enum TableEnum {
...
@@ -65,11 +53,13 @@ enum TableEnum {
const
NumberSetting
=
({
tableType
}:
{
tableType
:
`
${
TableEnum
}
`
})
=>
{
const
NumberSetting
=
({
tableType
}:
{
tableType
:
`
${
TableEnum
}
`
})
=>
{
const
tableList
=
useRef
([
const
tableList
=
useRef
([
{
label
:
'账单'
,
value
:
TableEnum
.
bill
,
Component
:
BilTable
},
{
label
:
'账单'
,
id
:
TableEnum
.
bill
,
Component
:
<
BilTable
/>
},
{
label
:
'充值'
,
value
:
TableEnum
.
pay
,
Component
:
PayRecordTable
},
{
label
:
'充值'
,
id
:
TableEnum
.
pay
,
Component
:
<
PayRecordTable
/>
},
{
label
:
'佣金'
,
value
:
TableEnum
.
promotion
,
Component
:
PromotionTable
},
{
label
:
'佣金'
,
id
:
TableEnum
.
promotion
,
Component
:
<
PromotionTable
/>
},
{
label
:
'通知'
,
value
:
TableEnum
.
inform
,
Component
:
InformTable
}
{
label
:
'通知'
,
id
:
TableEnum
.
inform
,
Component
:
<
InformTable
/>
}
]);
]);
const
[
currentTab
,
setCurrentTab
]
=
useState
(
tableType
);
const
router
=
useRouter
();
const
router
=
useRouter
();
const
{
copyData
}
=
useCopyData
();
const
{
copyData
}
=
useCopyData
();
const
{
userInfo
,
updateUserInfo
,
initUserInfo
,
setUserInfo
}
=
useUserStore
();
const
{
userInfo
,
updateUserInfo
,
initUserInfo
,
setUserInfo
}
=
useUserStore
();
...
@@ -98,8 +88,14 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
...
@@ -98,8 +88,14 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
async
(
data
:
UserUpdateParams
)
=>
{
async
(
data
:
UserUpdateParams
)
=>
{
setLoading
(
true
);
setLoading
(
true
);
try
{
try
{
await
putUserInfo
(
data
);
await
putUserInfo
({
updateUserInfo
(
data
);
openaiKey
:
data
.
openaiKey
,
avatar
:
data
.
avatar
});
updateUserInfo
({
openaiKey
:
data
.
openaiKey
,
avatar
:
data
.
avatar
});
reset
(
data
);
reset
(
data
);
toast
({
toast
({
title
:
'更新成功'
,
title
:
'更新成功'
,
...
@@ -159,7 +155,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
...
@@ -159,7 +155,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
<
Box
fontSize=
{
'xl'
}
fontWeight=
{
'bold'
}
>
<
Box
fontSize=
{
'xl'
}
fontWeight=
{
'bold'
}
>
账号信息
账号信息
</
Box
>
</
Box
>
<
Button
variant=
{
'
outlin
e'
}
size=
{
'xs'
}
onClick=
{
onclickLogOut
}
>
<
Button
variant=
{
'
bas
e'
}
size=
{
'xs'
}
onClick=
{
onclickLogOut
}
>
退出登录
退出登录
</
Button
>
</
Button
>
</
Flex
>
</
Flex
>
...
@@ -224,7 +220,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
...
@@ -224,7 +220,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
))
}
))
}
<
Button
<
Button
mt=
{
4
}
mt=
{
4
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
w=
{
'100%'
}
w=
{
'100%'
}
onClick=
{
()
=>
onClick=
{
()
=>
copyData
(
`${location.origin}/?inviterId=${userInfo?._id}`
,
'已复制邀请链接'
)
copyData
(
`${location.origin}/?inviterId=${userInfo?._id}`
,
'已复制邀请链接'
)
...
@@ -238,7 +234,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
...
@@ -238,7 +234,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
px=
{
4
}
px=
{
4
}
title=
{
residueAmount
<
50
?
'最低提现额度为50元'
:
''
}
title=
{
residueAmount
<
50
?
'最低提现额度为50元'
:
''
}
isDisabled=
{
residueAmount
<
50
}
isDisabled=
{
residueAmount
<
50
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
colorScheme=
{
'myBlue'
}
colorScheme=
{
'myBlue'
}
onClick=
{
onOpenWxConcat
}
onClick=
{
onOpenWxConcat
}
>
>
...
@@ -249,34 +245,19 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
...
@@ -249,34 +245,19 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
<
Card
mt=
{
4
}
px=
{
[
3
,
6
]
}
py=
{
4
}
>
<
Card
mt=
{
4
}
px=
{
[
3
,
6
]
}
py=
{
4
}
>
<
Tabs
<
Tabs
variant=
"unstyled"
w=
{
'200px'
}
isLazy
list=
{
tableList
.
current
}
defaultIndex=
{
tableList
.
current
.
findIndex
((
item
)
=>
item
.
value
===
tableType
)
}
activeId=
{
currentTab
}
onChange=
{
(
i
)
=>
router
.
replace
(
`/number?type=${tableList.current[i].value}`
)
}
size=
{
'sm'
}
>
onChange=
{
(
id
:
any
)
=>
setCurrentTab
(
id
)
}
<
TabList
whiteSpace=
{
'nowrap'
}
>
/>
{
tableList
.
current
.
map
((
item
)
=>
(
<
Box
>
<
Tab
{
(()
=>
{
key=
{
item
.
value
}
const
item
=
tableList
.
current
.
find
((
item
)
=>
item
.
id
===
currentTab
);
py=
{
'2px'
}
px=
{
4
}
return
item
?
item
.
Component
:
null
;
borderRadius=
{
'sm'
}
})()
}
mr=
{
2
}
</
Box
>
transition=
{
'none'
}
_selected=
{
{
color
:
'white'
,
bg
:
'myBlue.600'
}
}
>
{
item
.
label
}
</
Tab
>
))
}
</
TabList
>
<
TabPanels
>
{
tableList
.
current
.
map
((
Item
)
=>
(
<
TabPanel
minH=
{
'550px'
}
key=
{
Item
.
value
}
>
<
Item
.
Component
/>
</
TabPanel
>
))
}
</
TabPanels
>
</
Tabs
>
</
Card
>
</
Card
>
{
isOpenPayModal
&&
<
PayModal
onClose=
{
onClosePayModal
}
/>
}
{
isOpenPayModal
&&
<
PayModal
onClose=
{
onClosePayModal
}
/>
}
...
...
client/src/pages/openapi/index.tsx
View file @
623018f4
...
@@ -97,7 +97,7 @@ const OpenApi = () => {
...
@@ -97,7 +97,7 @@ const OpenApi = () => {
icon=
{
<
DeleteIcon
/>
}
icon=
{
<
DeleteIcon
/>
}
size=
{
'xs'
}
size=
{
'xs'
}
aria
-
label=
{
'delete'
}
aria
-
label=
{
'delete'
}
variant=
{
'
outlin
e'
}
variant=
{
'
bas
e'
}
colorScheme=
{
'gray'
}
colorScheme=
{
'gray'
}
onClick=
{
()
=>
onclickRemove
(
id
)
}
onClick=
{
()
=>
onclickRemove
(
id
)
}
/>
/>
...
...
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