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/pages/cameraAccess/components/SystemInfo.vue | 79 +++++++++++++++++++++++++-------------- 1 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/pages/cameraAccess/components/SystemInfo.vue b/src/pages/cameraAccess/components/SystemInfo.vue index 1f604d8..0458385 100644 --- a/src/pages/cameraAccess/components/SystemInfo.vue +++ b/src/pages/cameraAccess/components/SystemInfo.vue @@ -2,21 +2,21 @@ <div :class="showClass"> <div class="card-box"> <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,10 @@ :NoDeal="`${PollData.PollNoDeal}璺痐" /> </li> - <li style="max-width:120px" v-if="ShowLocalVedio"> + <li + style="max-width: 120px" + v-if="ShowLocalVedio && isShowPolling === 'show'" + > <!-- <local-vedio-card title="鏈湴绠楀姏" style="width:95%" @@ -50,7 +56,7 @@ />--> <DataStackCard title="鏁版嵁鏍堢畻鍔�" - style="width:95%" + style="width: 95%" fourTip="鏈煡鍘熷洜瀵艰嚧鏈鐞�" fourIcon="iconicon-test5" :total="`${PollData.stackChannelCount}璺痐" @@ -75,18 +81,25 @@ </li> </ul> </div>--> - <div class="eCharts-box" :style="`width:${liquidWidth}`" v-if="PollData.barCharts.length>0"> - <eChartsBar ref="cpuMeneryCharts" :xAxisData="PollData.barCharts"></eChartsBar> + <div + class="eCharts-box" + :style="`width:${liquidWidth}`" + v-if="PollData.barCharts.length > 0" + > + <eChartsBar + ref="cpuMeneryCharts" + :xAxisData="PollData.barCharts" + ></eChartsBar> </div> </div> </template> <script> -import DataStackCard from "@/components/subComponents/DataStackCard" -import BoardCard from "@/components/subComponents/BoardCard" -import LocalVedioCard from "@/components/subComponents/LocalVedioCard" -import LiquidFillChart from "@/components/subComponents/chartLiquid" -import eChartsBar from '@/components/subComponents/eChartsBar' +import DataStackCard from "@/components/subComponents/DataStackCard"; +import BoardCard from "@/components/subComponents/BoardCard"; +import LocalVedioCard from "@/components/subComponents/LocalVedioCard"; +import LiquidFillChart from "@/components/subComponents/chartLiquid"; +import eChartsBar from "@/components/subComponents/eChartsBar"; export default { name: "SystemInfo", @@ -97,42 +110,50 @@ 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: '70%' + default: "70%", }, liquidWidth: { type: String, - default: '30%' - } + default: "30%", + }, + }, + data() { + return { + isShowPolling: sessionStorage.getItem("isShowPolling"), + }; }, methods: { initCpuCharts() { this.$forceUpdate(); - } + }, }, mounted() { - console.log('PollData.RealTimeValidCount', this.PollData.RealTimeValidCount) - } -} + console.log( + "PollData.RealTimeValidCount", + this.PollData.RealTimeValidCount + ); + }, +}; </script> <style lang="scss"> .sysinfo-box { -- Gitblit v1.8.0