Commit ec0a8e18 authored by tyyin lan's avatar tyyin lan

chore(个人设置): 内容保存空提示

parent f3d95013
......@@ -22,7 +22,7 @@ const imageCropperRef = useTemplateRef<InstanceType<typeof ImageCropper> | null>
const userInfoForm = ref({
nickName: '',
remark: userStore.userInfo.remark,
remark: '',
})
const userInfoFormItemEdit = reactive({
......@@ -62,7 +62,7 @@ function userInfoUpdate(userInfo: {
remark?: string
}) {
return fetchUserInfoUpdate(userInfo).then(() => {
userStore.fetchUpdateUserInfo()
return userStore.fetchUpdateUserInfo()
})
}
......@@ -108,8 +108,6 @@ function handleAvatarUpload(e: Event) {
function handleUserInfoFormItemEditUpdate(key: keyof typeof userInfoFormItemEdit, isSave = false) {
!isSave && (userInfoForm.value[key] = userInfo.value[key])
userInfoFormItemEdit[key] = !userInfoFormItemEdit[key]
if (userInfoFormItemEdit[key]) {
nextTick(() => {
if (inputRefs.value && !Array.isArray(inputRefs.value)) {
......@@ -119,12 +117,25 @@ function handleUserInfoFormItemEditUpdate(key: keyof typeof userInfoFormItemEdit
}
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({
[key]: userInfoForm.value[key],
}).then(() => {
})
.then(() => {
window.$message.success(t('common_module.successful_update'))
})
.finally(() => {
saveBtnLoading.value = false
})
}
userInfoFormItemEdit[key] = !userInfoFormItemEdit[key]
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment