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
4f0dd966
authored
Feb 24, 2025
by
Archer
Committed by
GitHub
Feb 24, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: work order tip (#3874)
parent
fb6dbaf2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
82 additions
and
28 deletions
+82
-28
packages/global/support/user/type.d.ts
+0
-1
packages/web/components/common/Icon/icons/feedback.svg
+1
-1
packages/web/i18n/en/common.json
+1
-0
packages/web/i18n/zh-CN/common.json
+2
-2
packages/web/i18n/zh-Hant/common.json
+1
-0
projects/app/src/components/Layout/WorkorderButton.tsx
+51
-20
projects/app/src/components/Layout/auth.tsx
+0
-1
projects/app/src/components/Layout/index.tsx
+4
-3
projects/app/src/pages/account/info/index.tsx
+22
-0
No files found.
packages/global/support/user/type.d.ts
View file @
4f0dd966
...
...
@@ -27,7 +27,6 @@ export type UserType = {
timezone
:
string
;
promotionRate
:
UserModelSchema
[
'promotionRate'
];
team
:
TeamTmbItemType
;
standardInfo
?:
standardInfoType
;
notificationAccount
?:
string
;
permission
:
TeamPermission
;
contact
?:
string
;
...
...
packages/web/components/common/Icon/icons/feedback.svg
View file @
4f0dd966
<svg
width=
"29"
height=
"28"
viewBox=
"0 0 29 28"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<svg
viewBox=
"0 0 29 28"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M8.49993 10.1261C8.49993 9.48174 9.02226 8.9594 9.6666 8.9594H14.3333C14.9776 8.9594 15.4999 9.48174 15.4999 10.1261C15.4999 10.7704 14.9776 11.2927 14.3333 11.2927H9.6666C9.02226 11.2927 8.49993 10.7704 8.49993 10.1261Z"
fill=
"url(#paint0_linear_17422_2138)"
/>
<path
d=
"M8.49993 14.7927C8.49993 14.1484 9.02226 13.6261 9.6666 13.6261H18.4041C19.0485 13.6261 19.5708 14.1484 19.5708 14.7927C19.5708 15.4371 19.0485 15.9594 18.4041 15.9594H9.6666C9.02226 15.9594 8.49993 15.4371 8.49993 14.7927Z"
fill=
"url(#paint1_linear_17422_2138)"
/>
<path
d=
"M17.6859 9.1641C17.3948 9.37757 17.2057 9.72212 17.2057 10.1108V11.2504C17.2057 11.2738 17.2247 11.2927 17.248 11.2927H18.3745C18.7286 11.2927 19.0462 11.1358 19.262 10.8878L25.8249 4.32494C26.2805 3.86933 26.2805 3.13063 25.8249 2.67502C25.3693 2.21941 24.6306 2.21941 24.175 2.67502L17.6859 9.1641Z"
fill=
"url(#paint2_linear_17422_2138)"
/>
...
...
packages/web/i18n/en/common.json
View file @
4f0dd966
...
...
@@ -1012,6 +1012,7 @@
"plugin.go to laf"
:
"Go to Write"
,
"plugin.path"
:
"Path"
,
"prompt_input_placeholder"
:
"Please enter the prompt word"
,
"question_feedback"
:
"Work order"
,
"read_quote"
:
"View citations"
,
"required"
:
"Required"
,
"resume_failed"
:
"Resume Failed"
,
...
...
packages/web/i18n/zh-CN/common.json
View file @
4f0dd966
...
...
@@ -1015,6 +1015,7 @@
"plugin.go to laf"
:
"去编写"
,
"plugin.path"
:
"路径"
,
"prompt_input_placeholder"
:
"请输入提示词"
,
"question_feedback"
:
"工单咨询"
,
"read_quote"
:
"查看引用"
,
"required"
:
"必须"
,
"resume_failed"
:
"恢复失败"
,
...
...
@@ -1283,6 +1284,5 @@
"xx_search_result"
:
"{{key}} 的搜索结果"
,
"yes"
:
"是"
,
"yesterday"
:
"昨天"
,
"yesterday_detail_time"
:
"昨天 {{time}}"
,
"question_feedback"
:
"问题反馈"
"yesterday_detail_time"
:
"昨天 {{time}}"
}
packages/web/i18n/zh-Hant/common.json
View file @
4f0dd966
...
...
@@ -1011,6 +1011,7 @@
"plugin.go to laf"
:
"前往編寫"
,
"plugin.path"
:
"路徑"
,
"prompt_input_placeholder"
:
"請輸入提示詞"
,
"question_feedback"
:
"工單諮詢"
,
"read_quote"
:
"查看引用"
,
"required"
:
"必填"
,
"resume_failed"
:
"恢復失敗"
,
...
...
projects/app/src/components/
support/workorder
/WorkorderButton.tsx
→
projects/app/src/components/
Layout
/WorkorderButton.tsx
View file @
4f0dd966
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
import
{
getWorkorderURL
}
from
'@/web/common/workorder/api'
;
import
{
useUserStore
}
from
'@/web/support/user/useUserStore'
;
import
{
Box
,
Flex
}
from
'@chakra-ui/react'
;
import
{
StandardSubLevelEnum
}
from
'@fastgpt/global/support/wallet/sub/constants'
;
import
Icon
from
'@fastgpt/web/components/common/Icon'
;
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
import
{
useSystem
}
from
'@fastgpt/web/hooks/useSystem'
;
import
{
useToggle
}
from
'ahooks'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useMemo
}
from
'react'
;
const
WorkOrderShowRouter
:
{
[
key
:
string
]:
boolean
}
=
{
'/app/list'
:
true
,
'/dataset/list'
:
true
,
'/toolkit'
:
true
};
function
WorkorderButton
()
{
const
router
=
useRouter
();
const
[
open
,
setOpen
]
=
useToggle
(
true
);
const
{
t
}
=
useTranslation
();
const
{
data
,
runAsync
}
=
useRequest2
(
getWorkorderURL
,
{
manual
:
true
});
const
{
feConfigs
,
subPlans
}
=
useSystemStore
();
const
{
teamPlanStatus
}
=
useUserStore
();
const
onFeedback
=
async
()
=>
{
await
runAsync
();
if
(
data
)
{
window
.
open
(
data
.
redirectUrl
);
const
{
isPc
}
=
useSystem
();
const
{
runAsync
:
onFeedback
}
=
useRequest2
(
getWorkorderURL
,
{
manual
:
true
,
onSuccess
(
data
)
{
if
(
data
)
{
window
.
open
(
data
.
redirectUrl
);
}
}
};
return
(
});
const
showWorkorder
=
WorkOrderShowRouter
[
router
.
pathname
];
const
isPlanUser
=
useMemo
(()
=>
{
if
(
!
teamPlanStatus
)
return
false
;
if
(
teamPlanStatus
.
standard
?.
currentSubLevel
!==
StandardSubLevelEnum
.
free
)
return
true
;
if
(
teamPlanStatus
.
datasetMaxSize
!==
subPlans
?.
standard
?.
free
?.
maxDatasetSize
)
return
true
;
if
(
teamPlanStatus
.
totalPoints
!==
subPlans
?.
standard
?.
free
?.
totalPoints
)
return
true
;
return
false
;
},
[
subPlans
?.
standard
?.
free
?.
maxDatasetSize
,
subPlans
?.
standard
?.
free
?.
totalPoints
,
teamPlanStatus
]);
return
showWorkorder
&&
feConfigs
?.
show_workorder
&&
isPlanUser
&&
isPc
?
(
<>
{
open
?
(
<
Flex
position=
"fixed"
bottom=
"
2
0%"
bottom=
"
1
0%"
right=
"0"
height=
"
62
px"
width=
"5
8
px"
height=
"
56
px"
width=
"5
6
px"
zIndex=
{
100
}
boxShadow=
"0px 12px 32px -4px #00175633"
alignItems=
"center"
...
...
@@ -39,16 +70,16 @@ function WorkorderButton() {
borderColor=
{
'#DFE6F2'
}
>
<
Box
zIndex=
{
10
1
}
width=
"1
4px
"
height=
"1
4px
"
zIndex=
{
10
}
width=
"1
rem
"
height=
"1
rem
"
position=
"absolute"
left=
"-6px"
top=
"-6px"
borderRadius=
"full"
background=
"white"
border=
"1px"
borderColor=
{
'myGray.
25
'
}
borderColor=
{
'myGray.
100
'
}
bgColor=
"myGray.25"
_hover=
{
{
cursor
:
'pointer'
,
...
...
@@ -73,8 +104,8 @@ function WorkorderButton() {
borderBottomLeftRadius=
"8px"
onClick=
{
onFeedback
}
>
<
Icon
name=
"feedback"
width=
"2
8px"
height=
"28
px"
/>
<
Box
fontSize=
"
11px
"
fontWeight=
"500"
>
<
Icon
name=
"feedback"
width=
"2
4px"
height=
"24
px"
/>
<
Box
fontSize=
"
xs
"
fontWeight=
"500"
>
{
t
(
'common:question_feedback'
)
}
</
Box
>
</
Flex
>
...
...
@@ -82,7 +113,7 @@ function WorkorderButton() {
)
:
(
<
Flex
position=
"fixed"
bottom=
"
2
0%"
bottom=
"
1
0%"
right=
"0"
height=
"44px"
width=
"19px"
...
...
@@ -106,7 +137,7 @@ function WorkorderButton() {
</
Flex
>
)
}
</>
);
)
:
null
;
}
export
default
WorkorderButton
;
projects/app/src/components/Layout/auth.tsx
View file @
4f0dd966
...
...
@@ -3,7 +3,6 @@ import { useUserStore } from '@/web/support/user/useUserStore';
import
{
useQuery
}
from
'@tanstack/react-query'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useToast
}
from
'@fastgpt/web/hooks/useToast'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
const
unAuthPage
:
{
[
key
:
string
]:
boolean
}
=
{
'/'
:
true
,
...
...
projects/app/src/components/Layout/index.tsx
View file @
4f0dd966
...
...
@@ -14,7 +14,7 @@ import { useSystem } from '@fastgpt/web/hooks/useSystem';
import
{
useDebounceEffect
,
useMount
}
from
'ahooks'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useToast
}
from
'@fastgpt/web/hooks/useToast'
;
import
WorkorderButton
from
'.
./support/workorder
/WorkorderButton'
;
import
WorkorderButton
from
'./WorkorderButton'
;
const
Navbar
=
dynamic
(()
=>
import
(
'./navbar'
));
const
NavbarPhone
=
dynamic
(()
=>
import
(
'./navbarPhone'
));
...
...
@@ -57,7 +57,8 @@ const Layout = ({ children }: { children: JSX.Element }) => {
const
{
loading
,
feConfigs
,
notSufficientModalType
,
llmModelList
,
embeddingModelList
}
=
useSystemStore
();
const
{
isPc
}
=
useSystem
();
const
{
userInfo
,
isUpdateNotification
,
setIsUpdateNotification
}
=
useUserStore
();
const
{
userInfo
,
teamPlanStatus
,
isUpdateNotification
,
setIsUpdateNotification
}
=
useUserStore
();
const
{
setUserDefaultLng
}
=
useI18nLng
();
const
isChatPage
=
useMemo
(
...
...
@@ -122,7 +123,6 @@ const Layout = ({ children }: { children: JSX.Element }) => {
<
Auth
>
<
Box
h=
{
'100%'
}
position=
{
'fixed'
}
left=
{
0
}
top=
{
0
}
w=
{
navbarWidth
}
>
<
Navbar
unread=
{
unread
}
/>
{
feConfigs
.
show_workorder
&&
<
WorkorderButton
/>
}
</
Box
>
<
Box
h=
{
'100%'
}
ml=
{
navbarWidth
}
overflow=
{
'overlay'
}
>
{
children
}
...
...
@@ -161,6 +161,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
{
!!
userInfo
&&
importantInforms
.
length
>
0
&&
(
<
ImportantInform
informs=
{
importantInforms
}
refetch=
{
refetchUnRead
}
/>
)
}
<
WorkorderButton
/>
</>
)
}
...
...
projects/app/src/pages/account/info/index.tsx
View file @
4f0dd966
...
...
@@ -42,6 +42,8 @@ import AccountContainer from '@/pageComponents/account/AccountContainer';
import
{
serviceSideProps
}
from
'@fastgpt/web/common/system/nextjs'
;
import
{
useRouter
}
from
'next/router'
;
import
TeamSelector
from
'@/pageComponents/account/TeamSelector'
;
import
{
getWorkorderURL
}
from
'@/web/common/workorder/api'
;
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
const
StandDetailModal
=
dynamic
(
()
=>
import
(
'@/pageComponents/account/info/standardDetailModal'
),
...
...
@@ -580,9 +582,19 @@ const ButtonStyles = {
};
const
Other
=
({
onOpenContact
}:
{
onOpenContact
:
()
=>
void
})
=>
{
const
{
feConfigs
}
=
useSystemStore
();
const
{
teamPlanStatus
}
=
useUserStore
();
const
{
t
}
=
useTranslation
();
const
{
isPc
}
=
useSystem
();
const
{
runAsync
:
onFeedback
}
=
useRequest2
(
getWorkorderURL
,
{
manual
:
true
,
onSuccess
(
data
)
{
if
(
data
)
{
window
.
open
(
data
.
redirectUrl
);
}
}
});
return
(
<
Box
>
<
Grid
gridGap=
{
4
}
mt=
{
3
}
>
...
...
@@ -619,6 +631,16 @@ const Other = ({ onOpenContact }: { onOpenContact: () => void }) => {
</
Box
>
</
Flex
>
)
}
{
feConfigs
?.
show_workorder
&&
teamPlanStatus
&&
teamPlanStatus
.
standard
?.
currentSubLevel
!==
StandardSubLevelEnum
.
free
&&
(
<
Flex
onClick=
{
onFeedback
}
{
...
ButtonStyles
}
>
<
MyIcon
name=
{
'feedback'
}
w=
{
'18px'
}
color=
{
'myGray.600'
}
/>
<
Box
ml=
{
2
}
flex=
{
1
}
>
{
t
(
'common:question_feedback'
)
}
</
Box
>
</
Flex
>
)
}
</
Grid
>
</
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