Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
Project
Project
Details
Activity
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
Administrator
web-monitor
Commits
ef4b9e38
Commit
ef4b9e38
authored
Mar 16, 2022
by
neogcg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export
parent
5f828a3b
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
119 additions
and
115 deletions
+119
-115
dist.zip
dist.zip
+0
-0
App.vue
src/App.vue
+46
-34
Navbar.vue
src/layout/components/Navbar.vue
+5
-2
index.js
src/router/index.js
+2
-0
user.js
src/store/modules/user.js
+1
-0
request.js
src/utils/request.js
+1
-0
websocket.js
src/utils/websocket.js
+6
-7
index.vue
src/views/alarm/cableTime/index.vue
+19
-16
index.vue
src/views/alarm/device/index.vue
+3
-0
index.vue
src/views/login/index.vue
+3
-1
fsuTable.vue
src/views/setting/statistics/comp/fsuTable.vue
+10
-9
leakyTable.vue
src/views/setting/statistics/comp/leakyTable.vue
+9
-18
monitorTable.vue
src/views/setting/statistics/comp/monitorTable.vue
+5
-11
railWayTable.vue
src/views/setting/statistics/comp/railWayTable.vue
+4
-9
stationTable.vue
src/views/setting/statistics/comp/stationTable.vue
+1
-4
index.vue
src/views/user/userLog/index.vue
+3
-3
vue.config.js
vue.config.js
+1
-1
No files found.
dist.zip
View file @
ef4b9e38
No preview for this file type
src/App.vue
View file @
ef4b9e38
<
template
>
<div
id=
"app"
>
<router-view
/>
<audio
controls=
"controls"
id=
"my_audio"
src=
"./assets/audio/alarm.mp3"
style=
"display:none;"
hidden=
"hidden"
/>
<div
class=
"tips"
v-if=
"tflag"
>
<audio
controls=
"controls"
id=
"my_audio"
src=
"./assets/audio/alarm.mp3"
style=
"display: none"
hidden=
"hidden"
/>
<!--
<div
class=
"tips"
v-if=
"tflag"
>
<p>
提示
</p>
<span>
有一条新告警
</span>
</div>
</div>
-->
</div>
</
template
>
<
script
>
import
{
receiveMessage
}
from
'@/utils/websocket'
import
socket
from
'@/utils/websocket'
import
{
mapState
}
from
'vuex'
import
EventBus
from
'@/utils/bus'
import
{
receiveMessage
}
from
"@/utils/websocket"
;
import
socket
from
"@/utils/websocket"
;
import
{
mapState
}
from
"vuex"
;
import
EventBus
from
"@/utils/bus"
;
export
default
{
name
:
'App'
,
name
:
"App"
,
data
()
{
return
{
return
{
websocket
:
null
,
tflag
:
false
,
}
}
;
},
computed
:
{
...
mapState
(
"user"
,
[
'userBaseInfo'
]),
...
mapState
(
"user"
,
[
"userBaseInfo"
]),
userId
()
{
return
this
.
userBaseInfo
.
userId
}
return
this
.
userBaseInfo
.
userId
;
}
,
},
methods
:
{
receiveMessage
,
closeWebsocket
()
{
if
(
this
.
websocket
)
{
this
.
websocket
.
close
()
this
.
websocket
.
close
()
;
}
},
},
mounted
()
{
this
.
websocket
=
socket
({
onmessage
:
this
.
receiveMessage
})
EventBus
.
$on
(
'dialogAlarm'
,
(
data
)
=>
{
onmessage
:
this
.
receiveMessage
,
});
EventBus
.
$on
(
"dialogAlarm"
,
(
data
)
=>
{
// 接收消息之后 声音弹窗显示
this
.
tflag
=
data
this
.
tflag
=
data
;
setTimeout
(()
=>
{
this
.
tflag
=
false
},
3000
)
})
this
.
tflag
=
false
;
},
3000
);
});
// EventBus.$on("cancelWS", () => {
// this.websocket.close();
// });
// EventBus.$on("wsOpen", () => {
// this.websocket.onopen();
// });
},
watch
:
{
userId
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
closeWebsocket
()
this
.
closeWebsocket
()
;
this
.
websocket
=
socket
({
onmessage
:
this
.
receiveMessage
})
onmessage
:
this
.
receiveMessage
,
})
;
}
}
}
}
,
}
,
},
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
#app
{
// & ::v-deep .el-table__body tr:hover>td{
// background-color: #bed5ff !important;
// }
// & ::v-deep .el-table__body tr.current-row>td{
// background-color: #bed5ff !important;
// }
}
.tips
{
.tips
{
width
:
400px
;
height
:
80px
;
background
:
#fff
;
box-shadow
:
0px
2px
14px
#888888
;
border-radius
:
5px
;
padding
:
0
20px
20px
20px
;
position
:
absolute
;
position
:
absolute
;
text-align
:
center
;
top
:
calc
(
50
%
-
40px
)
;
left
:calc
(
50
%
-
200px
)
top
:
calc
(
50%
-
40px
);
left
:
calc
(
50%
-
200px
);
}
</
style
>
src/layout/components/Navbar.vue
View file @
ef4b9e38
...
...
@@ -13,7 +13,7 @@
<el-dropdown-item
divided
@
click
.
native=
"logout"
>
<span
style=
"display:block;"
>
退出登录
</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<span
style=
"color: white; padding-right: 10px"
>
{{
dateTime
}}
</span>
...
...
@@ -27,7 +27,7 @@ import Breadcrumb from '@/components/Breadcrumb'
import
Hamburger
from
'@/components/Hamburger'
import
Sidebar
from
'./Sidebar/index.vue'
import
{
logout
}
from
'@/api/user'
import
EventBus
from
'@/utils/bus'
export
default
{
data
()
{
let
timer
...
...
@@ -57,8 +57,11 @@ export default {
logout
().
then
(()
=>
{
this
.
$store
.
dispatch
(
'user/logout'
)
this
.
$router
.
push
(
`/login`
)
// EventBus.$emit('cancelWS')
})
},
// 获取当前时间函数
timeFormate
(
timeStamp
)
{
let
year
=
new
Date
(
timeStamp
).
getFullYear
()
...
...
src/router/index.js
View file @
ef4b9e38
...
...
@@ -34,12 +34,14 @@ export const constantRoutes = [
{
path
:
'/login'
,
component
:
()
=>
import
(
'@/views/login/index'
),
meta
:{
title
:
"登录"
},
hidden
:
true
},
{
path
:
'/404'
,
component
:
()
=>
import
(
'@/views/404'
),
meta
:{
title
:
"404"
},
hidden
:
true
},
...
...
src/store/modules/user.js
View file @
ef4b9e38
...
...
@@ -45,6 +45,7 @@ const actions = {
getInfo
({
type
:
0
}).
then
(
res
=>
{
if
(
!
res
)
return
commit
(
'SET_BASEINFO'
,
res
)
console
.
log
(
res
);
})
},
...
...
src/utils/request.js
View file @
ef4b9e38
...
...
@@ -2,6 +2,7 @@ import axios from 'axios'
import
{
MessageBox
,
Message
}
from
'element-ui'
import
store
from
'@/store'
import
{
getToken
}
from
'@/utils/auth'
import
socket
from
"@/utils/websocket"
;
import
Vue
from
'vue'
// create an axios instance
...
...
src/utils/websocket.js
View file @
ef4b9e38
...
...
@@ -5,9 +5,10 @@ import EventBus from '@/utils/bus'
export
default
function
socket
(
handlerOptions
)
{
let
{
onmessage
,
onopen
onopen
,
// socketUrl
}
=
handlerOptions
let
socketUrl
=
'ws://8.142.143.40:8885/websocket/1'
let
socketUrl
=
'ws://8.142.143.40:8885/websocket/1
/1
'
let
websocket
if
(
"WebSocket"
in
window
)
{
websocket
=
new
WebSocket
(
socketUrl
)
...
...
@@ -21,13 +22,10 @@ export default function socket(handlerOptions) {
console
.
info
(
"Websocket服务器连接错误"
)
}
window
.
onbeforeunload
=
function
()
{
websocket
.
close
()
}
//连接成功建立的回调方法
websocket
.
onopen
=
function
()
{
console
.
info
(
"Websocket连接成功"
)
console
.
log
(
websocket
.
readyState
);
heart
.
start
()
onopen
&&
onopen
()
}
...
...
@@ -45,7 +43,6 @@ export default function socket(handlerOptions) {
}
return
websocket
}
function
heartCheck
(
websocket
)
{
return
{
timeout
:
15000
,
...
...
@@ -56,8 +53,10 @@ function heartCheck(websocket) {
},
start
:
function
()
{
this
.
timeoutObj
=
setInterval
(
function
()
{
// if(websocket.readyState==1){
websocket
.
send
(
"HeartBeat"
)
console
.
info
(
"Websocket发送心跳:HeartBeat"
)
// }
},
this
.
timeout
)
},
}
...
...
src/views/alarm/cableTime/index.vue
View file @
ef4b9e38
...
...
@@ -171,6 +171,7 @@ import { cableTimeList, cableConfirm, cableCancel } from "../api";
import
{
exportLeakyCable
}
from
"@/api/export"
;
import
search
from
"@/views/monitor/leakageCable/components/search.vue"
;
import
download
from
"@/utils/download"
;
import
socket
from
"@/utils/websocket"
;
export
default
{
data
()
{
return
{
...
...
@@ -200,6 +201,7 @@ export default {
],
isQuery
:
false
,
searchOption
:
{},
wsUrl
:
"ws://8.142.143.40:8885/websocket/1/1"
,
};
},
components
:
{
search
},
...
...
@@ -278,30 +280,31 @@ export default {
},
computed
:
{
getWsMsg
:{
get
(){
return
this
.
$store
.
state
.
websocket
.
webSocketMsg
},
set
(
a
){
this
.
$store
.
state
.
websocket
.
webSocketMsg
=
a
}
},
//
getWsMsg:{
//
get(){
//
return this.$store.state.websocket.webSocketMsg
//
},
//
set(a){
//
this.$store.state.websocket.webSocketMsg=a
//
}
//
},
},
watch
:
{
getWsMsg
:
{
handler
(
newVal
)
{
this
.
getWsMsg
=!!
newVal
console
.
log
(
newVal
);
// alert("接收到webSocket推送" + newVal);
},
},
//
getWsMsg: {
//
handler(newVal) {
//
this.getWsMsg=!!newVal
//
console.log(newVal);
//
// alert("接收到webSocket推送" + newVal);
//
},
//
},
},
mounted
()
{
this
.
getTableData
();
},
created
(){
this
.
$ws
.
createWS
(
"2"
)
// socket({socketUrl:this.wsUrl});
}
};
</
script
>
...
...
src/views/alarm/device/index.vue
View file @
ef4b9e38
...
...
@@ -134,6 +134,7 @@ import { deviceList, deviceConfirm, deviceCancel } from "../api";
import
{
exportConnet
}
from
"@/api/export"
;
import
search
from
"@/views/monitor/equipment/components/search.vue"
;
import
download
from
"@/utils/download"
;
import
socket
from
"@/utils/websocket"
;
export
default
{
data
()
{
return
{
...
...
@@ -163,6 +164,7 @@ export default {
],
isQuery
:
false
,
searchOption
:
{},
wsUrl
:
"ws://8.142.143.40:8885/websocket/1/2"
,
};
},
components
:
{
search
},
...
...
@@ -255,6 +257,7 @@ export default {
},
created
(){
// socket({socketUrl:this.wsUrl});
}
};
...
...
src/views/login/index.vue
View file @
ef4b9e38
...
...
@@ -79,7 +79,7 @@
<
script
>
import
{
login
}
from
"@/api/user"
import
{
setToken
}
from
"@/utils/auth"
import
EventBus
from
'@/utils/bus'
export
default
{
name
:
"Login"
,
data
()
{
...
...
@@ -160,6 +160,8 @@ export default {
this
.
$refs
.
loginForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
toLogin
()
// EventBus.$emit('wsOpen')
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
...
...
src/views/setting/statistics/comp/fsuTable.vue
View file @
ef4b9e38
...
...
@@ -186,7 +186,7 @@ export default {
fsubatchDelete
({
ids
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
successAlert
(
"删除成功"
);
this
.
getTableData
();
}
else
{
warningAlert
(
"删除失败"
);
...
...
@@ -206,14 +206,14 @@ export default {
},
exportData
()
{
fsulist
({
size
:
this
.
total
}).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[];
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
});
exportFsu
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`FSU表.xls`
);
});
//
fsulist({size:this.total}).then((res) => {
//
let list = res.records || [];
//
this.exids = list.map((i) => i.id);
// });
exportFsu
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`FSU表.xls`
);
});
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
...
...
@@ -240,6 +240,7 @@ export default {
let
list
=
res
.
records
||
[];
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
!=
0
)
{
...
...
src/views/setting/statistics/comp/leakyTable.vue
View file @
ef4b9e38
...
...
@@ -131,9 +131,6 @@
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
prop=
"leakyCableDescribe"
label=
"漏缆描述"
...
...
@@ -146,19 +143,18 @@
show-overflow-tooltip
align=
"center"
/>
<el-table-column
<el-table-column
prop=
"leakyCableMode"
label=
"漏缆型号"
show-overflow-tooltip
align=
"center"
/>
<el-table-column
prop=
"railWayName"
label=
"所在铁路线"
align=
"center"
/>
<el-table-column
prop=
"siteName"
label=
"所在站点"
align=
"center"
/>
<el-table-column
prop=
"fsuName"
label=
"所在FSU"
align=
"center"
/>
<el-table-column
prop=
"equipName"
label=
"所在监测设备"
align=
"center"
/>
<el-table-column
prop=
"action"
label=
"详细信息"
...
...
@@ -247,7 +243,7 @@ export default {
leakyCablebatchDelete
({
ids
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
successAlert
(
"删除成功"
);
this
.
getTableData
();
}
else
{
warningAlert
(
"删除失败"
);
...
...
@@ -267,14 +263,9 @@ export default {
},
exportData
()
{
leakyCablelist
({
size
:
this
.
total
}).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[];
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
});
exportLeaky
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`漏缆表.xls`
);
});
exportLeaky
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`漏缆表.xls`
);
});
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
...
...
@@ -301,7 +292,7 @@ export default {
let
list
=
res
.
records
||
[];
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
)
{
successAlert
(
"查询成功"
);
...
...
@@ -352,7 +343,7 @@ function formInit(data = {}) {
monitor
:
""
,
leakyCableCode
:
""
,
leakyCableDescribe
:
""
,
siteName
:
""
,
siteName
:
""
,
leakyCableMode
:
""
,
current
:
1
,
size
:
10
,
...
...
src/views/setting/statistics/comp/monitorTable.vue
View file @
ef4b9e38
...
...
@@ -197,7 +197,7 @@ export default {
monitorEquipbatchDelete
({
ids
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
successAlert
(
"删除成功"
);
this
.
getTableData
();
}
else
{
warningAlert
(
"删除失败"
);
...
...
@@ -217,14 +217,9 @@ export default {
},
exportData
()
{
monitorEquiplist
({
size
:
this
.
total
}).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[];
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
});
exportMonitorEquip
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`监测设备表.xls`
);
});
exportMonitorEquip
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`监测设备表.xls`
);
});
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
...
...
@@ -251,7 +246,7 @@ export default {
let
list
=
res
.
records
||
[];
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
)
{
successAlert
(
"查询成功"
);
...
...
@@ -288,7 +283,6 @@ export default {
};
function
formInit
(
data
=
{})
{
return
{
wayId
:
""
,
parentId
:
""
,
ip
:
""
,
...
...
src/views/setting/statistics/comp/railWayTable.vue
View file @
ef4b9e38
...
...
@@ -170,14 +170,9 @@ export default {
},
exportData
()
{
railWaylist
({
size
:
this
.
total
}).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[];
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
});
exportRailWay
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`铁路线表.xls`
);
});
exportRailWay
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`铁路线表.xls`
);
});
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
...
...
@@ -204,7 +199,7 @@ export default {
let
list
=
res
.
records
||
[];
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
)
{
successAlert
(
"查询成功"
);
...
...
src/views/setting/statistics/comp/stationTable.vue
View file @
ef4b9e38
...
...
@@ -169,10 +169,6 @@ export default {
this
.
siteForm
=
formInit
();
},
exportData
()
{
sitelist
({
size
:
this
.
total
}).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[];
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
});
exportSite
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`站点表.xls`
);
});
...
...
@@ -200,6 +196,7 @@ export default {
let
list
=
res
.
records
||
[];
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
);
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
)
{
successAlert
(
"查询成功"
);
...
...
src/views/user/userLog/index.vue
View file @
ef4b9e38
...
...
@@ -21,15 +21,15 @@
:header-cell-style="{ background: '#EAF1FE', color: '#666666' }"
>
<el-table-column
prop=
"userName"
label=
"用户名"
align=
"center"
/>
<el-table-column
prop=
"operateType
Valu
e"
label=
"操作类别"
align=
"center"
/>
<el-table-column
prop=
"operateObj"
label=
"操作对象"
align=
"center"
/>
<el-table-column
prop=
"operateType
Nam
e"
label=
"操作类别"
align=
"center"
/>
<el-table-column
prop=
"operateObj
Name
"
label=
"操作对象"
align=
"center"
/>
<el-table-column
prop=
"objectName"
label=
"对象名称"
align=
"center"
/>
<el-table-column
prop=
"operateContent"
label=
"操作内容"
align=
"center"
/>
<el-table-column
prop=
"operateResult
Valu
e"
label=
"操作结果"
align=
"center"
/>
<el-table-column
prop=
"operateResult
Nam
e"
label=
"操作结果"
align=
"center"
/>
<el-table-column
prop=
"creationTime"
label=
"操作时间"
align=
"center"
/>
</el-table>
<Pagination
...
...
vue.config.js
View file @
ef4b9e38
...
...
@@ -12,7 +12,7 @@ const port = process.env.port || process.env.npm_config_port || 8886 // dev port
const
rewriteDefaultConfig
=
{
changeOrigin
:
true
,
target
:
'http://8.142.143.40:8886'
,
// target: 'http://192.168.0.1
11
:8886',
// target: 'http://192.168.0.1
23
:8886',
// ws: true,
headers
:
{
referer
:
'laddercloud.cn'
...
...
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