From a3f357e8a60443b74b64c7479113c68eb35ce1f5 Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期五, 15 七月 2022 19:44:57 +0800
Subject: [PATCH] 控制轮询

---
 src/components/subComponents/SystemInfo.vue |   68 ++++++++++++++++++++--------------
 1 files changed, 40 insertions(+), 28 deletions(-)

diff --git a/src/components/subComponents/SystemInfo.vue b/src/components/subComponents/SystemInfo.vue
index 6fa2b5f..03acc5b 100644
--- a/src/components/subComponents/SystemInfo.vue
+++ b/src/components/subComponents/SystemInfo.vue
@@ -1,22 +1,22 @@
 <template>
   <div :class="showClass">
-    <div class="card-box" :style="`width:${borderWidth};min-width:456px`" >
+    <div class="card-box" :style="`width:${borderWidth};min-width:456px`">
       <ul>
-        <li style="max-width:30px;" v-if="ShowLocalVedio">
+        <li style="max-width: 30px" v-if="ShowLocalVedio">
           <div class="total-box">
-            <div style="width:100%;margin-top:28px;">
+            <div style="width: 100%; margin-top: 28px">
               <div class="top-text">
-                <em>{{"鎬荤畻鍔�"}}</em>
+                <em>{{ "鎬荤畻鍔�" }}</em>
               </div>
               <div class="mid-text">
-                <em>{{` ${PollData.channelTotal}`}}</em>
+                <em>{{ ` ${PollData.channelTotal}` }}</em>
               </div>
             </div>
           </div>
         </li>
-        <li style="max-width:120px" v-if="showRealPoll">
+        <li style="max-width: 120px" v-if="showRealPoll">
           <DataStackCard
-            style="width:95%"
+            style="width: 95%"
             title="瀹炴椂绠楀姏"
             fourTip="鏁呴殰瀵艰嚧鏈鐞�"
             fourIcon="iconicon-test21"
@@ -27,12 +27,15 @@
             :NoDeal="`${PollData.RealTimeNoDeal}璺痐"
           />
         </li>
-        <li style="max-width:120px" v-if="showRealPoll">
+        <li
+          style="max-width: 120px"
+          v-if="showRealPoll && isShowPolling === 'show'"
+        >
           <DataStackCard
             title="杞绠楀姏"
             fourTip="绛夊緟杞澶勭悊"
             fourIcon="iconicon-test2"
-            style="width:95%"
+            style="width: 95%"
             :total="`${PollData.PollValidCount}璺痐"
             :ValidCount="`${PollData.PollSum}璺痐"
             :InValidCount="`${PollData.PollInvalid}璺痐"
@@ -40,7 +43,7 @@
             :NoDeal="`${PollData.PollNoDeal}璺痐"
           />
         </li>
-        <li style="max-width:120px" v-if="ShowLocalVedio">
+        <li style="max-width: 120px" v-if="ShowLocalVedio">
           <!-- <local-vedio-card
             title="鏈湴绠楀姏"
             style="width:95%"
@@ -49,8 +52,9 @@
             :warning="`${PollData.PollInvalid}璺痐"
           />-->
           <DataStackCard
+            v-if="isShowPolling === 'show'"
             title="鏁版嵁鏍堢畻鍔�"
-            style="width:95%"
+            style="width: 95%"
             fourTip="鏈煡鍘熷洜瀵艰嚧鏈鐞�"
             fourIcon="iconicon-test5"
             :total="`${PollData.stackChannelCount}璺痐"
@@ -75,15 +79,18 @@
         </li> 
       </ul>
     </div>-->
-    <div class="eCharts-box" v-if="PollData.barCharts.length>0">
-      <eChartsBar ref="cpuMeneryCharts" :xAxisData="PollData.barCharts"></eChartsBar>
+    <div class="eCharts-box" v-if="PollData.barCharts.length > 0">
+      <eChartsBar
+        ref="cpuMeneryCharts"
+        :xAxisData="PollData.barCharts"
+      ></eChartsBar>
     </div>
   </div>
 </template>
 
 <script>
-import DataStackCard from "@/components/subComponents/DataStackCard"
-import eChartsBar from '@/components/subComponents/eChartsBar'
+import DataStackCard from "@/components/subComponents/DataStackCard";
+import eChartsBar from "@/components/subComponents/eChartsBar";
 
 export default {
   name: "SystemInfo",
@@ -91,46 +98,51 @@
     DataStackCard,
     eChartsBar,
   },
+  data() {
+    return {
+      isShowPolling: sessionStorage.getItem("isShowPolling"),
+    };
+  },
   props: {
     showTask: {
       type: Boolean,
-      default: false
+      default: false,
     },
     showClass: {
       type: String,
-      default: 'sysinfo-box flex-box'
+      default: "sysinfo-box flex-box",
     },
     ShowLocalVedio: {
       type: Boolean,
-      default: false
+      default: false,
     },
     showRealPoll: {
       type: Boolean,
-      default: true
+      default: true,
     },
     marginTop: {
       type: String,
-      default: 'ma'
+      default: "ma",
     },
     borderWidth: {
       type: String,
-      default: '64%'
+      default: "64%",
     },
     liquidWidth: {
       type: String,
-      default: '30%'
-    }
+      default: "30%",
+    },
   },
   methods: {
     initCpuCharts() {
       this.$forceUpdate();
-    }
+    },
   },
-  mounted(){
+  mounted() {
     console.log(this.PollData);
     // console.log('PollData.RealTimeValidCount',this.PollData.RealTimeValidCount)
-  }
-}
+  },
+};
 </script>
 <style lang="scss">
 .sysinfo-box {
@@ -177,7 +189,7 @@
         font-weight: 700;
       }
     }
-    ul{
+    ul {
       padding-left: 0;
     }
   }

--
Gitblit v1.8.0