|
|
@@ -111,32 +111,39 @@ const handleChangePassword = () => {
|
|
|
changePasswordDialogRef.value.openDialog()
|
|
|
}
|
|
|
|
|
|
+const userManualLoading = ref(false)
|
|
|
const handleUserManual = () => {
|
|
|
+ userManualLoading.value = true
|
|
|
try {
|
|
|
- $api.getUserGuide().then(async (res) => {
|
|
|
- if (res.status !== 200) {
|
|
|
- ElMessageBox.alert('The request failed. Please try again later', 'Prompt', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- confirmButtonClass: 'el-button--dark'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (res.data?.code === 403) {
|
|
|
- sessionStorage.clear()
|
|
|
- router.push('/login')
|
|
|
- userStore.logout()
|
|
|
- ElMessage.warning({
|
|
|
- message: 'Please log in to use this feature.',
|
|
|
- grouping: true
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // 创建一个 Blob 对象
|
|
|
- const blob = new Blob([res.data], { type: 'application/pdf' })
|
|
|
- const url = URL.createObjectURL(blob)
|
|
|
- // 在新标签页中打开 PDF
|
|
|
- window.open(url, '_blank')
|
|
|
- })
|
|
|
+ $api
|
|
|
+ .getUserGuide()
|
|
|
+ .then(async (res) => {
|
|
|
+ if (res.status !== 200) {
|
|
|
+ ElMessageBox.alert('The request failed. Please try again later', 'Prompt', {
|
|
|
+ confirmButtonText: 'OK',
|
|
|
+ confirmButtonClass: 'el-button--dark'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data?.code === 403) {
|
|
|
+ sessionStorage.clear()
|
|
|
+ router.push('/login')
|
|
|
+ userStore.logout()
|
|
|
+ ElMessage.warning({
|
|
|
+ message: 'Please log in to use this feature.',
|
|
|
+ grouping: true
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 创建一个 Blob 对象
|
|
|
+ const blob = new Blob([res.data], { type: 'application/pdf' })
|
|
|
+ const url = URL.createObjectURL(blob)
|
|
|
+ // 在新标签页中打开 PDF
|
|
|
+ window.open(url, '_blank')
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ userManualLoading.value = false
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
ElMessageBox.alert('The request failed. Please try again later', 'Prompt', {
|
|
|
confirmButtonText: 'OK',
|
|
|
@@ -170,7 +177,13 @@ const closePopover = () => {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div class="layout-toolbar">
|
|
|
+ <div
|
|
|
+ class="layout-toolbar"
|
|
|
+ v-loading.fullscreen.lock="userManualLoading"
|
|
|
+ element-loading-text="Loading..."
|
|
|
+ element-loading-custom-class="element-loading"
|
|
|
+ element-loading-background="rgb(43, 47, 54, 0.7)"
|
|
|
+ >
|
|
|
<VBreadcrumb></VBreadcrumb>
|
|
|
<div class="right-info">
|
|
|
<el-input
|