Browse Source

刷新成功提示

cxmo 9 months ago
parent
commit
41cdf4bdab
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/views/sheetShow/index.vue

+ 5 - 4
src/views/sheetShow/index.vue

@@ -4,6 +4,7 @@ import { useRoute } from 'vue-router';
 import { SheetApi } from '@/request/api';
 import sheet from '@/components/sheet.vue'
 import { IUnknowObject } from '@/types';
+import { ElMessage } from 'element-plus';
 
 const route = useRoute();
 const code = ref(route.query.code || '')
@@ -19,7 +20,7 @@ interface InfoType extends IUnknowObject {
 const showData = ref(false);
 const info = ref<InfoType|any>({});
 const loading = ref(false);
-const getInfo = async() => {
+const getInfo = async(type='') => {
   loading.value = true;
   const { Data,Ret } = await SheetApi.getInfo({  UniqueCode: code.value, FromScene: Number(route.query.fromScene||'') });
   
@@ -27,8 +28,8 @@ const getInfo = async() => {
   if(Ret !== 200) return
 
   info.value = Data;
-  showData.value = true;
-
+  showData.value = true; 
+  type==='refresh'&&ElMessage.success('刷新成功')
   nextTick(() => {
     let ele = document.getElementsByClassName('sheet-show-wrapper')[0] as HTMLElement;
 
@@ -50,7 +51,7 @@ const refreshSheet = async()=>{
     res = await SheetApi.refreshInfo({UniqueCode: code.value})
     if(res.Ret!==200) return 
     loading.value = false;
-    getInfo()
+    getInfo('refresh')
 }
 
 </script>