Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
ec0a8e18
Commit
ec0a8e18
authored
Nov 25, 2024
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(个人设置): 内容保存空提示
parent
f3d95013
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
personal-settings.vue
src/views/personal-settings/personal-settings.vue
+17
-6
No files found.
src/views/personal-settings/personal-settings.vue
View file @
ec0a8e18
...
@@ -22,7 +22,7 @@ const imageCropperRef = useTemplateRef<InstanceType<typeof ImageCropper> | null>
...
@@ -22,7 +22,7 @@ const imageCropperRef = useTemplateRef<InstanceType<typeof ImageCropper> | null>
const
userInfoForm
=
ref
({
const
userInfoForm
=
ref
({
nickName
:
''
,
nickName
:
''
,
remark
:
userStore
.
userInfo
.
remark
,
remark
:
''
,
})
})
const
userInfoFormItemEdit
=
reactive
({
const
userInfoFormItemEdit
=
reactive
({
...
@@ -62,7 +62,7 @@ function userInfoUpdate(userInfo: {
...
@@ -62,7 +62,7 @@ function userInfoUpdate(userInfo: {
remark
?:
string
remark
?:
string
})
{
})
{
return
fetchUserInfoUpdate
(
userInfo
).
then
(()
=>
{
return
fetchUserInfoUpdate
(
userInfo
).
then
(()
=>
{
userStore
.
fetchUpdateUserInfo
()
return
userStore
.
fetchUpdateUserInfo
()
})
})
}
}
...
@@ -108,8 +108,6 @@ function handleAvatarUpload(e: Event) {
...
@@ -108,8 +108,6 @@ function handleAvatarUpload(e: Event) {
function
handleUserInfoFormItemEditUpdate
(
key
:
keyof
typeof
userInfoFormItemEdit
,
isSave
=
false
)
{
function
handleUserInfoFormItemEditUpdate
(
key
:
keyof
typeof
userInfoFormItemEdit
,
isSave
=
false
)
{
!
isSave
&&
(
userInfoForm
.
value
[
key
]
=
userInfo
.
value
[
key
])
!
isSave
&&
(
userInfoForm
.
value
[
key
]
=
userInfo
.
value
[
key
])
userInfoFormItemEdit
[
key
]
=
!
userInfoFormItemEdit
[
key
]
if
(
userInfoFormItemEdit
[
key
])
{
if
(
userInfoFormItemEdit
[
key
])
{
nextTick
(()
=>
{
nextTick
(()
=>
{
if
(
inputRefs
.
value
&&
!
Array
.
isArray
(
inputRefs
.
value
))
{
if
(
inputRefs
.
value
&&
!
Array
.
isArray
(
inputRefs
.
value
))
{
...
@@ -119,12 +117,25 @@ function handleUserInfoFormItemEditUpdate(key: keyof typeof userInfoFormItemEdit
...
@@ -119,12 +117,25 @@ function handleUserInfoFormItemEditUpdate(key: keyof typeof userInfoFormItemEdit
}
}
if
(
isSave
)
{
if
(
isSave
)
{
if
(
!
userInfoForm
.
value
[
key
])
{
window
.
$message
.
warning
(
t
(
'personal_space_module.knowledge_module.knowledge_chunk_content_input_rule'
))
return
}
saveBtnLoading
.
value
=
true
userInfoUpdate
({
userInfoUpdate
({
[
key
]:
userInfoForm
.
value
[
key
],
[
key
]:
userInfoForm
.
value
[
key
],
}).
then
(()
=>
{
window
.
$message
.
success
(
t
(
'common_module.successful_update'
))
})
})
.
then
(()
=>
{
window
.
$message
.
success
(
t
(
'common_module.successful_update'
))
})
.
finally
(()
=>
{
saveBtnLoading
.
value
=
false
})
}
}
userInfoFormItemEdit
[
key
]
=
!
userInfoFormItemEdit
[
key
]
}
}
</
script
>
</
script
>
...
...
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