Przeglądaj źródła

feat: 解决首页重复刷新bug

Jack Zhou 1 tydzień temu
rodzic
commit
048d5d784f

+ 5 - 3
src/views/Dashboard/src/DashboardView.vue

@@ -100,13 +100,13 @@ const GetDashboardData = () => {
       co2DestinationDefaultData.value = res.data.DestinationCo2Top10faultData
       revenueDefaultData.value = res.data.RevenueDefaultData
       nextTick(() => {
-        getTableData(recentDefaultData.value, false)
+        getTableData(recentDefaultData.value, false, true)
       })
     }
   })
 }
 // 获取表单数据
-const getTableData = (val: any, isPage?: any) => {
+const getTableData = (val: any, isPage?: any, isInit: boolean = false) => {
   const rc = isPage ? pageInfo.value.total : -1
   $api
     .GetDashboardData({
@@ -118,7 +118,9 @@ const getTableData = (val: any, isPage?: any) => {
     .then((res: any) => {
       if (res.code === 200) {
         pageInfo.value.total = Number(res.data.rc)
-        Management.value = res.data.Management
+        if (isInit) {
+          Management.value = res.data.Management
+        }
         RecentStatusList.value = res.data.searchData
       }
     })

+ 1 - 1
src/views/Dashboard/src/components/RecentStatus.vue

@@ -84,7 +84,7 @@ const SubscribeShipments = (val: any) => {
       </div>
       <div class="recent-header-right">
         <el-button
-          class="recent_button"
+          class="el-button--default"
           @click="SubscribeShipments(item)"
           :class="item.is_subscribe ? 'IsSubscribe' : ''"
         >