Browse Source

优化提示语

cxmo 1 year ago
parent
commit
436c379de1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/views/report/PreviewPDF.vue

+ 4 - 1
src/views/report/PreviewPDF.vue

@@ -18,6 +18,7 @@ const pdfState = reactive({
 })
 let showHint = ref(true)
 let hasRight = ref(false)
+let hintText = ref('')
 const loadingFailed = ()=>{
     LOADING.close()
     ElMessage.error('加载PDF失败!')
@@ -26,10 +27,12 @@ const loadingFailed = ()=>{
 const loadedPDF=()=>{
     LOADING.close()
     showHint.value = false
+    hintText.value = ''
 }
 const getPDFDetail = (pdf_id)=>{
     if(!pdf_id){
         ElMessage.error('未找到PDF')
+        hintText.value="获取PDF失败"
         LOADING&&LOADING.close()
         return
     }
@@ -119,7 +122,7 @@ onMounted(async ()=>{
             <p v-if="showHint" class="hint">加载PDF失败!</p>
         </template>
         <template v-else>
-            <p class="hint">获取PDF失败!</p>
+            <p class="hint">{{hintText}}</p>
         </template>
         
     </div>