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
25eea47d
Commit
25eea47d
authored
Jul 27, 2024
by
qjeslks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.27.2
parent
9853fbaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
38 deletions
+121
-38
AlarmInfoPage.vue
src/views/AlarmPage/AlarmInfoPage.vue
+39
-31
AlarmStatusPage.vue
src/views/AlarmPage/AlarmStatusPage.vue
+0
-7
home.vue
src/views/home.vue
+82
-0
No files found.
src/views/AlarmPage/AlarmInfoPage.vue
View file @
25eea47d
...
...
@@ -59,6 +59,7 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import
http
from
'../../api/http'
;
import
zhCn
from
'element-plus/dist/locale/zh-cn.mjs'
import
store
from
"../../store/index"
;
import
{
getFileName
}
from
'../../utils/utils'
;
//分页设置
const
currentPage
=
ref
(
1
)
...
...
@@ -66,6 +67,7 @@ var pageSize = ref(30)
const
disabled
=
ref
(
false
)
const
background
=
ref
(
false
)
const
total
=
ref
()
const
exporter
=
ref
(
"TransExport"
)
const
options
=
reactive
([]);
const
tableData
=
ref
([]);
const
tableHeight
=
ref
(
500
);
...
...
@@ -118,7 +120,6 @@ function sortMethod({ order, prop }){
}
AlarmInfo
.
sort
=
sortnames
;
}
console
.
log
(
AlarmInfo
.
sort
)
getdata
()
//调用后端查询接口
}
...
...
@@ -180,10 +181,13 @@ function getdata() {
function
getoptions
(){
if
(
type
.
value
===
"GetPipeAlarmData"
){
getPipes
();
exporter
.
value
=
"PipeExport"
;
}
else
if
(
type
.
value
===
"GetBoilerAlarmData"
){
getBoilers
();
exporter
.
value
=
"BoilerExport"
;
}
else
{
getSupplys
();
exporter
.
value
=
"TransExport"
;
}
gettransfer
();
}
...
...
@@ -224,7 +228,7 @@ function getBoilers(){
//获取总管列表
function
getPipes
(){
loading
.
value
=
true
;
tableData
.
value
.
length
=
0
;
tableData
.
length
=
0
;
AlarmInfo
.
Id
.
length
=
0
;
var
result
=
store
.
getters
.
getEnterprise
();
if
(
result
)
{
...
...
@@ -331,37 +335,41 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
return
css_color
;
}
// // 导出表格 按钮点击后触发事件
// async function exportExcel () {
// sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
// sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
// AlarmInfo.pageIndex = 0;
// AlarmInfo.pageCount = 100000;
// 导出表格 按钮点击后触发事件
async
function
exportExcel
()
{
if
(
tableData
.
value
!==
null
){
sessionStorage
.
setItem
(
"DeviceQueryStart"
,
AlarmInfo
.
startTime
);
sessionStorage
.
setItem
(
"DeviceQueryEnd"
,
AlarmInfo
.
endTime
);
AlarmInfo
.
pageIndex
=
0
;
AlarmInfo
.
pageCount
=
100000
;
//
var fileName = getFileName("报警信息历史数据");
var
fileName
=
getFileName
(
"报警信息历史数据"
);
// await http.post("/api/transfer/hisExport", AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
// try{
// const blob = new Blob([content]);
// if ('download' in document.createElement('a')) {
// // 非IE下载
// const elink = document.createElement('a');
// elink.download = fileName;
// elink.style.display = 'none';
// elink.href = URL.createObjectURL(blob);
// document.body.appendChild(elink);
// elink.click();
// URL.revokeObjectURL(elink.href);
// document.body.removeChild(elink);
// } else {
// // IE10+下载
// navigator.msSaveBlob(blob, fileName);
// }
// }catch(error){
// console.log(error);
// }
// });
// }
console
.
log
(
AlarmInfo
);
console
.
log
(
exporter
.
value
);
await
http
.
post
(
"/api/alarm/"
+
exporter
.
value
,
AlarmInfo
,
'正在导出数据....'
,
{
responseType
:
'blob'
}).
then
((
content
)
=>
{
try
{
const
blob
=
new
Blob
([
content
]);
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
const
elink
=
document
.
createElement
(
'a'
);
elink
.
download
=
fileName
;
elink
.
style
.
display
=
'none'
;
elink
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
elink
);
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
document
.
body
.
removeChild
(
elink
);
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
);
}
}
catch
(
error
){
console
.
log
(
error
);
}
});
}
}
onMounted
(()
=>
{
setContentHeight
();
window
.
addEventListener
(
'resize'
,
setContentHeight
);
...
...
src/views/AlarmPage/AlarmStatusPage.vue
View file @
25eea47d
...
...
@@ -218,13 +218,6 @@
})
}
}
//获取用户信息
getuser
()
function
getuser
(){
var
user
=
store
.
getters
.
getUserInfo
();
console
.
log
(
user
);
}
//获取总管列表
function
getPipes
(){
...
...
src/views/home.vue
View file @
25eea47d
...
...
@@ -209,6 +209,7 @@ 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';
...
...
@@ -633,6 +634,87 @@ export default defineComponent({
},
});
//报警弹窗
const
enterpriseId
=
ref
();
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
();
//获取用户信息
getuser
()
function
getuser
(){
var
user
=
store
.
getters
.
getUserInfo
();
if
(
user
){
enterpriseId
.
value
=
user
.
enterpriseId
;
userId
.
value
=
user
.
userId
;
roleId
.
value
=
user
.
roleId
;
}
}
const
AlarmInfo
=
reactive
({
"enterpriseId"
:
enterpriseId
.
value
,
"UserId"
:
userId
.
value
,
"RoleId"
:
roleId
.
value
});
function
alarm
(){
http
.
post
(
"/api/alarm/GetAlarmMsg"
,
AlarmInfo
).
then
((
result
)
=>
{
if
(
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
).
then
((
result
)
=>
{
if
(
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
(()
=>
{
alarm
();
countalarm
();
},
6
*
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