From ae8d9d380854076d0b2da145576ae08f14a8f835 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期三, 19 三月 2025 17:26:47 +0800 Subject: [PATCH] feat: 添加生态流量页面&做大屏分辨率适配 --- src/screen/flow.vue | 81 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 78 insertions(+), 3 deletions(-) diff --git a/src/screen/flow.vue b/src/screen/flow.vue index 3d7067f..c2bd3f7 100644 --- a/src/screen/flow.vue +++ b/src/screen/flow.vue @@ -1,18 +1,34 @@ <template> <div class="main"> <div class="header"> - <div class="top">金川水电站生态流量监测系统 </div> + <div class="top"> + <div class="top-name">金川水电站生态流量监测系统</div> + <div class="top-modal"> + 公告弹窗提示 + <el-switch v-model="openWarn" /> + </div> + </div> <div class="nav"> - <div v-for="(item,index) in btnList" :key="index" @click="navTo(item)" class="plain" :class="item.url === route.path ? 'active' : ''">{{ item.name }}</div> + <div v-for="(item,index) in btnList" :key="index" @click="navTo(item)" class="plain" :class="item.url === route.path ? 'active' : ''"> + <span>{{ item.name }}</span> + </div> </div> </div> <div class="content"> <router-view></router-view> + <div class="warningBox" v-if="openWarn"> + <img src="@/assets/images/flow/warn-icon.png"> + <div class="text">{{text}}</div> + </div> </div> </div> </template> <script setup> import{ useRouter,useRoute } from 'vue-router' +import useUserStore from '@/store/modules/user.js' +import {onMounted, ref, watch} from "vue"; + +const userStore = useUserStore() const router = useRouter() const route = ref(useRoute()) @@ -24,9 +40,36 @@ {name:'报警管理',url:'/flow/warning'}, {name:'报表管理',url:'/flow/report'}, ]) + +const openWarn = ref(false) +const text = ref('新扎沟口流量监测点水位到达下限值, 金川水电站生态流量监测点水位到达下限值,流量监测点水位到达下限值') +let timer = null; + +watch(openWarn, (newVal) => { + if(newVal){ + splitText() + } else { + clearInterval(timer) + } +}) + +// 设置警告滚动 +const splitText = () => { + timer = setInterval(function () { + const val = text.value.substring(1) + text.value.substring(0,1) + text.value = val + }, 300) +} + const navTo = (item) =>{ router.push(item.url) } + +onMounted(() => { + if(userStore.userType == 1) { + btnList.value.push({name:'系统管理',url:'/user'}) + } +}) </script> @@ -44,11 +87,18 @@ display: flex; align-items: center; justify-content: center; - font-size: 38px; font-weight: 700; color: #fff; position: relative; z-index: 100; + .top-name{ + font-size: 48px; + } + .top-modal{ + position: absolute; + right: 100px; + cursor: pointer; + } } .nav{ display: flex; @@ -75,6 +125,31 @@ .content{ width: 100%; height: 86%; + position: relative; + .warningBox{ + position: absolute; + left: 0; + top: 2%; + z-index: 100; + width: 100%; + padding: 0 150px; + height: 100px; + display: flex; + align-items: center; + background: linear-gradient( 270deg, + rgba(255,74,74,0) 0%, + rgba(255,74,74,0.5) 8%, + rgba(255,74,74,0.5) 50%, + rgba(255,74,74,0.5) 92%, + rgba(255,74,74,0) 100%); + .text{ + margin: 0 30px; + color: #fff; + font-size: 36px; + overflow: hidden; + white-space: nowrap; + } + } } } </style> \ No newline at end of file -- Gitblit v1.9.3