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
451d697e
Commit
451d697e
authored
Jul 29, 2024
by
qjeslks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.29.3
parent
4d58f27d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
2 deletions
+94
-2
AlarmInfoPage.vue
src/views/AlarmPage/AlarmInfoPage.vue
+3
-2
home.vue
src/views/home.vue
+91
-0
No files found.
src/views/AlarmPage/AlarmInfoPage.vue
View file @
451d697e
...
...
@@ -150,12 +150,13 @@ if (day >= 1 && day <= 9) {
day
=
"0"
+
day
;
}
var
startTime
=
sessionStorage
.
getItem
(
"DeviceQueryStart"
);
if
(
!
startTime
){
console
.
log
(
!!
startTime
);
if
(
!!
startTime
){
startTime
=
year
+
"-"
+
dateArr
[
0
]
+
'-'
+
day
+
" "
+
dateArr
[
2
]
+
":"
+
dateArr
[
3
]
+
":"
+
dateArr
[
4
];
sessionStorage
.
setItem
(
"DeviceQueryStart"
,
startTime
);
}
var
endTime
=
sessionStorage
.
getItem
(
"DeviceQueryEnd"
);
if
(
!
endTime
){
if
(
!
!
endTime
){
endTime
=
year
+
"-"
+
dateArr
[
0
]
+
"-"
+
dateArr
[
1
]
+
" "
+
dateArr
[
2
]
+
":"
+
dateArr
[
3
]
+
":"
+
dateArr
[
4
];
sessionStorage
.
setItem
(
"DeviceQueryEnd"
,
endTime
);
}
...
...
src/views/home.vue
View file @
451d697e
...
...
@@ -212,11 +212,14 @@ import {
}
from
'@element-plus/icons-vue'
;
import
DataMenu
from
'../components/DataMenu.vue'
;
import
EventBus
from
'../utils/event-bus.js'
;
import
{
ElNotification
}
from
'element-plus'
//import {RoleEnum} from '../utils/enumData';
var
$this
;
var
$interval
;
const
enterpriseId
=
ref
();
const
componentView
=
ref
(
null
);
localStorage
.
setItem
(
'tabWidth'
,
''
);
...
...
@@ -636,6 +639,94 @@ export default defineComponent({
},
});
//报警弹窗
const
userId
=
ref
();
const
roleId
=
ref
();
const
title
=
ref
();
const
msg
=
ref
();
const
id
=
ref
();
const
counttitle
=
ref
();
const
countmsg
=
ref
();
const
countid
=
ref
();
const
route
=
useRoute
();
//获取用户信息
function
getuser
(){
var
user
=
store
.
getters
.
getUserInfo
();
if
(
user
){
enterpriseId
.
value
=
user
.
enterpriseId
;
userId
.
value
=
user
.
userId
;
roleId
.
value
=
user
.
roleId
;
}
}
const
AlarmInfo
=
ref
({});
function
getinfo
(){
AlarmInfo
.
value
=
{
"enterpriseId"
:
enterpriseId
.
value
,
"UserId"
:
userId
.
value
,
"RoleId"
:
roleId
.
value
};
}
function
alarm
(){
http
.
post
(
"/api/alarm/GetAlarmMsg"
,
AlarmInfo
.
value
).
then
((
result
)
=>
{
if
(
result
.
data
!==
null
){
if
(
result
.
data
!==
null
&&
title
.
value
!==
result
.
data
[
0
].
title
||
msg
.
value
!==
result
.
data
[
0
].
msg
){
title
.
value
=
result
.
data
[
0
].
title
;
msg
.
value
=
result
.
data
[
0
].
msg
;
id
.
value
=
result
.
data
[
0
].
id
;
ElNotification
({
title
:
title
.
value
,
message
:
msg
.
value
,
position
:
'bottom-right'
,
type
:
'warning'
,
duration
:
0
,
// onClick() {
// console.log(111111)
// const routePath = '/Home/Video'; // 要导航到的路由路径
// const routeQuery = { id: id.value }; // 如果需要,可以传递参数
// // 序列化查询参数
// const queryString = new URLSearchParams(routeQuery).toString();
// // 打开新窗口并导航到指定路由
// window.open(
// `${routePath}?${queryString}`,
// '_blank',
// 'toolbar=yes,location=yes,status=yes,menubar=yes,width=600,height=400,scrollbars=yes'
// );
// },
})
}
}
});
}
const
router
=
useRouter
()
function
countalarm
(){
http
.
post
(
"/api/alarm/GetAlarmMsg"
,
AlarmInfo
.
value
).
then
((
result
)
=>
{
if
(
result
.
data
!==
null
){
if
(
result
.
data
!==
null
&&
counttitle
.
value
!==
result
.
data
[
1
].
title
||
countmsg
.
value
!==
result
.
data
[
1
].
msg
){
counttitle
.
value
=
result
.
data
[
1
].
title
;
countmsg
.
value
=
result
.
data
[
1
].
msg
;
countid
.
value
=
result
.
data
[
1
].
id
;
ElNotification
({
title
:
counttitle
.
value
,
message
:
countmsg
.
value
,
position
:
'bottom-right'
,
type
:
'warning'
,
duration
:
0
,
// onClick() {
// router.push({ path: '/GisHome'})
// },
})
}
}
});
}
setInterval
(()
=>
{
getuser
()
getinfo
();
alarm
();
countalarm
();
},
10
*
1000
);
// 每分钟执行一次
</
script
>
<
style
lang=
"less"
scoped
>
...
...
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