Sfoglia il codice sorgente

预警查询增加loading效果

baiyanting 1 anno fa
parent
commit
c25c91bab6
1 ha cambiato i file con 9 aggiunte e 5 eliminazioni
  1. 9 5
      src/views/IntegratedAlarm/safe/customWarning/index.vue

+ 9 - 5
src/views/IntegratedAlarm/safe/customWarning/index.vue

@@ -1,5 +1,10 @@
 <template>
-  <div class="custom-warning">
+  <div
+    class="custom-warning"
+    v-loading="tableLoading"
+    element-loading-text="加载中..."
+    element-loading-background="rgba(4, 12, 11, 0.8)"
+  >
     <div class="form-wrapper">
       <div class="search-wrapper">
         <div class="search-item">
@@ -9,7 +14,6 @@
               v-model="state.typeVal"
               clearable
               size="mini"
-             
               placeholder="全部"
               popper-class="select"
               @change="
@@ -210,7 +214,6 @@
             width="100"
             header-align="center"
             align="center"
-            
           >
             <template #default="scope">
               <el-button
@@ -261,7 +264,6 @@
             width="100"
             header-align="center"
             align="center"
-        
           >
             <template #default="scope">
               <el-button
@@ -539,12 +541,13 @@ const query = reactive({
   limit: 20,
   pageTotal: null,
 });
-
+const tableLoading = ref(false);
 // 获取历史记录表
 const getAlarmHistoryt = async () => {
   //   if (route.params.deviceId && route.params.alarmId) {
   //     state.stationId = "";
   //   }
+  tableLoading.value = true;
   let params = {
     pageNum: query.page,
     pageSize: query.limit,
@@ -561,6 +564,7 @@ const getAlarmHistoryt = async () => {
     end: state.dateTime[1],
   };
   const { data } = await alarm_history(params);
+  tableLoading.value = false;
   query.pageTotal = data?.total;
   data?.ls?.forEach((ele) => {
     ele.isCloseName = ele.endts ? "已解除" : "未解除";