Browse Source

表格增加刷新按钮

cxmo 9 months ago
parent
commit
a98672d969
2 changed files with 24 additions and 0 deletions
  1. 6 0
      src/request/api.ts
  2. 18 0
      src/views/sheetShow/index.vue

+ 6 - 0
src/request/api.ts

@@ -60,6 +60,9 @@ interface IExcelParams {
 	UniqueCode: string | any
 	FromScene: number
 }
+interface IFreshParams {
+	UniqueCode: string | any
+}
 export const SheetApi = {
 	/**
 	 * 获取表格详情
@@ -68,5 +71,8 @@ export const SheetApi = {
 	 */
 	getInfo: (params: IExcelParams) => {
 		return get('/excel_info/detail',params);
+	},
+	refreshInfo:(params:IFreshParams) => {
+		return get('excel_info/refresh',params)
 	}
 }

+ 18 - 0
src/views/sheetShow/index.vue

@@ -44,6 +44,14 @@ const getInfo = async() => {
 }
 getInfo()
 
+const refreshSheet = async()=>{
+    loading.value = true;
+    let res: any=null;
+    res = await SheetApi.refreshInfo({UniqueCode: code.value})
+    if(res.Ret!==200) return 
+    loading.value = false;
+    getInfo()
+}
 
 </script>
 
@@ -58,6 +66,9 @@ getInfo()
     <h3 class="title">{{info.ExcelName}}</h3>
     
     <sheet :data="info.TableInfo.TableDataList" :config="info.Config"/>
+    <div class="tool">
+        <span @click="refreshSheet">刷新</span>
+    </div>
   </div>
 </template>
 
@@ -75,5 +86,12 @@ getInfo()
     // text-align: center;
     margin-bottom: 8px;
   }
+  .tool{
+    text-align: right;
+    margin-top: 5px;
+    span{
+        cursor: pointer;
+    }
+  }
 }
 </style>