Commit 80b1a6a1 authored by qjeslks's avatar qjeslks

报警提示报错和菜单搜索功能

parent 6955c08e
<template>
<el-scrollbar>
<div class="ams-el-menu">
<!-- <div class="menu-search">
<el-select placement="bottom" v-model="searchValue" clearable filterable remote reserve-keyword
:placeholder="'请输入关键字搜索...'" :remote-method="remoteMethod" @change="selectChange" :loading="loading">
<div class="menu-search">
<el-select placement="bottom" v-model="searchValue" clearable filterable
:placeholder="'请输入关键字搜索...'" @change="save(searchValue)">
<template #prefix><i class="el-icon-search"></i></template>
<el-option v-for="item in menus" :key="item.menuId" :label="item.menuName" :value="item.menuName" />
<el-option v-for="item in options" :key="item.menuId" :label="item.menuName" :value="item.navigateUrl" />
</el-select>
</div> -->
</div>
<el-menu unique-opened :collapse-transition='false' :collapse='$store.state.iscollapse' router :default-active="defaultActive" active-text-color="#409EFF" background-color="#32363f" text-color="#fff">
<!-- 一级菜单 -->
......@@ -78,15 +78,29 @@
import {
Menu as IconMenu
} from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
// const searchValue = ref('');
// const proxy = getCurrentInstance();
// const props = defineProps(['meun', 'thisIndex']);
// const emit = defineEmits(['subEvent']);
// const options = ref([]);
// const loading = ref(false);
const searchValue = ref();
const router = useRouter();
const options = ref([]);
const store = useStore()
setTimeout(() => {
getoptions(); // 调用你的函数
}, 2000);
function getoptions(){
var menus = store.state.menus;
for(let i = 0;i < 100;i++){
if(menus[i] === undefined)break;
for(let j = 0;j < 100;j++){
if(menus[i].childs[j] === undefined)break;
options.value.push(menus[i].childs[j])
}
}
console.log(options.value)
}
//定义默认展开
let defaultActive = ref('/home')
......@@ -115,5 +129,11 @@
defaultActive.value=path
window.sessionStorage.setItem('activePath',path)
}
const save=(routePath)=>{
defaultActive.value=routePath
window.sessionStorage.setItem('activePath',routePath)
router.push({ path: routePath});
}
</script>
\ No newline at end of file
......@@ -799,7 +799,7 @@ export default defineComponent({
http
.post("/api/alarm/GetAlarmMsg", AlarmInfo.value, false)
.then((result) => {
if (result.data !== null && sta.value === 0) {
if (result.data.lenth === 0 && sta.value === 0) {
sta.value = 1;
title.value = result.data[0].title;
msg.value = result.data[0].msg;
......@@ -832,7 +832,7 @@ export default defineComponent({
}
function countalarm() {
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if (result.data !== null && consta.value === 0) {
if (result.data.lenth === 0 && consta.value === 0) {
consta.value = 1;
counttitle.value = result.data[1].title;
countmsg.value = result.data[1].msg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment