web
2 天以前 55373c6b400d879ba4a4cdae752fe5140c7b11f6
src/screen/flow.vue
@@ -7,10 +7,11 @@
                    <span>选择系统</span>
                </div>
                <div class="top-name">金川水电站生态流量监测系统</div>
                <div class="top-modal">
                <div class="top-modal" v-if="text">
                    公告弹窗提示
                    <el-switch v-model="openWarn" />
                </div>
                <div class="top-login" v-if="userType !== '1'" @click="loginOut">退出登录</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' : ''">
@@ -30,8 +31,9 @@
<script setup>
import{ useRouter,useRoute } from 'vue-router'
import {onMounted, ref, watch, onUnmounted} from "vue";
import { getUserType } from '@/utils/auth'
import {getUserType, removeToken} from '@/utils/auth'
import { warnHistory } from '@/api/screen/warning/index.js'
import {ElMessageBox} from "element-plus";
const router = useRouter()
@@ -72,12 +74,28 @@
// 获取报警内容
const getWarnList = () => {
    let errorCode = [10, 20]
    let str = ''
    warnHistory({limit: 10, page: 1, monitorType: 2}).then(res => {
        res.data.list?.forEach((item)=>{
            str += item.description + ','
            if(errorCode.includes(item.isConfirm)){
                str += item.description + ','
            }
        })
        text.value = str
    })
}
// 退出登录
const loginOut = () => {
    ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then((e) => {
        removeToken()
        window.location.reload();
    })
}
@@ -133,6 +151,11 @@
                right: 100px;
                cursor: pointer;
            }
            .top-login{
                position: absolute;
                right: 20px;
                cursor: pointer;
            }
        }
        .nav{
            display: flex;