Commit 034a9223 authored by qjeslks's avatar qjeslks

菜单栏搜索功能

parent dd9a44a0
......@@ -2,10 +2,10 @@
<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">
<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 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>
</div>
......@@ -78,8 +78,10 @@
import {
Menu as IconMenu
} from '@element-plus/icons-vue'
import { useRouter } from 'vue-router';
const searchValue = ref('');
const searchValue = ref();
const router = useRouter();
// const proxy = getCurrentInstance();
// const props = defineProps(['meun', 'thisIndex']);
// const emit = defineEmits(['subEvent']);
......@@ -97,10 +99,9 @@
setTimeout(() => {
getoptions(); // 调用你的函数
}, 1000);
}, 2000);
function getoptions(){
var menus = store.state.menus;
console.log(menus[1].childs[0])
for(let i = 0;i < 100;i++){
if(menus[i] === undefined)break;
for(let j = 0;j < 100;j++){
......@@ -132,5 +133,10 @@
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
......@@ -209,7 +209,6 @@ const InstantFlow = ref();
getSupplysList();
function getSupplysList() {
var result = store.getters.getEnterprise();
console.log(result);
if (result) {
enterpriseId.value = result[0].enterpriseId;
result[0].serviceCenterList.forEach(center => {
......@@ -325,7 +324,6 @@ function getPipeData() {
setInterval(() => {
getBoilerData();
console.log(refreshTime.value)
}, 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