浏览代码

feat: (dashborad) 增加重置参数

gemercheung 2 年之前
父节点
当前提交
ce5074eb72
共有 2 个文件被更改,包括 24 次插入5 次删除
  1. 14 5
      src/views/dashboard/analysis/enterprise.vue
  2. 10 0
      src/views/dashboard/analysis/index.vue

+ 14 - 5
src/views/dashboard/analysis/enterprise.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="p-4">
     <!-- <GrowCard :loading="loading" class="enter-y" /> -->
-    <BasicTable @register="registerTable">
+    <BasicTable @register="registerTable" :loading="loading">
       <template #toolbar>
         <a-button type="primary" @click="handleExport">导出数据</a-button>
       </template>
@@ -189,10 +189,13 @@
         },
       },
     ],
+    resetFunc: handleReset,
   };
 
   const searchInfo = ref({
     liveRoomId: '',
+    companyId: '',
+    brandId: '',
     limit: 20,
     page: 1,
     time: [priorDate, today],
@@ -232,8 +235,14 @@
     a.click();
     window.URL.revokeObjectURL(url);
   }
-
-  setTimeout(() => {
-    loading.value = false;
-  }, 1500);
+  async function handleReset() {
+    searchInfo.value = {
+      liveRoomId: '',
+      companyId: '',
+      brandId: '',
+      limit: 20,
+      page: 1,
+      time: [priorDate, today],
+    };
+  }
 </script>

+ 10 - 0
src/views/dashboard/analysis/index.vue

@@ -157,6 +157,7 @@
         },
       },
     ],
+    resetFunc: handleReset,
   };
 
   const searchInfo = ref({
@@ -225,6 +226,15 @@
     window.URL.revokeObjectURL(url);
   }
 
+  async function handleReset() {
+    searchInfo.value = {
+      liveRoomId: '',
+      limit: 20,
+      page: 1,
+      time: [priorDate, today],
+    };
+  }
+
   // setTimeout(() => {
   //   loading.value = false;
   // }, 1500);