Commit 034a9223 authored by qjeslks's avatar qjeslks

菜单栏搜索功能

parent dd9a44a0
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<el-scrollbar> <el-scrollbar>
<div class="ams-el-menu"> <div class="ams-el-menu">
<div class="menu-search"> <div class="menu-search">
<el-select placement="bottom" v-model="searchValue" clearable filterable remote reserve-keyword <el-select placement="bottom" v-model="searchValue" clearable filterable
:placeholder="'请输入关键字搜索...'" :remote-method="remoteMethod" @change="selectChange" :loading="loading"> :placeholder="'请输入关键字搜索...'" @change="save(searchValue)">
<template #prefix><i class="el-icon-search"></i></template> <template #prefix><i class="el-icon-search"></i></template>
<el-option v-for="item in options" :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> </el-select>
</div> </div>
...@@ -78,8 +78,10 @@ ...@@ -78,8 +78,10 @@
import { import {
Menu as IconMenu Menu as IconMenu
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
const searchValue = ref(''); const searchValue = ref();
const router = useRouter();
// const proxy = getCurrentInstance(); // const proxy = getCurrentInstance();
// const props = defineProps(['meun', 'thisIndex']); // const props = defineProps(['meun', 'thisIndex']);
// const emit = defineEmits(['subEvent']); // const emit = defineEmits(['subEvent']);
...@@ -97,10 +99,9 @@ ...@@ -97,10 +99,9 @@
setTimeout(() => { setTimeout(() => {
getoptions(); // 调用你的函数 getoptions(); // 调用你的函数
}, 1000); }, 2000);
function getoptions(){ function getoptions(){
var menus = store.state.menus; var menus = store.state.menus;
console.log(menus[1].childs[0])
for(let i = 0;i < 100;i++){ for(let i = 0;i < 100;i++){
if(menus[i] === undefined)break; if(menus[i] === undefined)break;
for(let j = 0;j < 100;j++){ for(let j = 0;j < 100;j++){
...@@ -132,5 +133,10 @@ ...@@ -132,5 +133,10 @@
defaultActive.value=path defaultActive.value=path
window.sessionStorage.setItem('activePath',path) window.sessionStorage.setItem('activePath',path)
} }
const save=(routePath)=>{
defaultActive.value=routePath
window.sessionStorage.setItem('activePath',routePath)
router.push({ path: routePath});
}
</script> </script>
\ No newline at end of file
...@@ -209,7 +209,6 @@ const InstantFlow = ref(); ...@@ -209,7 +209,6 @@ const InstantFlow = ref();
getSupplysList(); getSupplysList();
function getSupplysList() { function getSupplysList() {
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
console.log(result);
if (result) { if (result) {
enterpriseId.value = result[0].enterpriseId; enterpriseId.value = result[0].enterpriseId;
result[0].serviceCenterList.forEach(center => { result[0].serviceCenterList.forEach(center => {
...@@ -325,7 +324,6 @@ function getPipeData() { ...@@ -325,7 +324,6 @@ function getPipeData() {
setInterval(() => { setInterval(() => {
getBoilerData(); getBoilerData();
console.log(refreshTime.value)
}, refreshTime.value * 1000); // 每分钟执行一次 }, refreshTime.value * 1000); // 每分钟执行一次
......
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