Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
海康威视
web-project
Commits
80b1a6a1
Commit
80b1a6a1
authored
Aug 16, 2024
by
qjeslks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报警提示报错和菜单搜索功能
parent
6955c08e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
14 deletions
+34
-14
MyMenu.vue
src/components/MyMenu.vue
+32
-12
home.vue
src/views/home.vue
+2
-2
No files found.
src/components/MyMenu.vue
View file @
80b1a6a1
<
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'
)
...
...
@@ -116,4 +130,10 @@
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
src/views/home.vue
View file @
80b1a6a1
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment