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
aacebaea
Commit
aacebaea
authored
Apr 06, 2022
by
yanzhongrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
650387f1
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1011 additions
and
1006 deletions
+1011
-1006
App.vue
src/App.vue
+72
-86
user.js
src/api/user.js
+1
-1
index.vue
src/components/Breadcrumb/index.vue
+1
-1
index.js
src/const/index.js
+3
-3
AppMain.vue
src/layout/components/AppMain.vue
+1
-2
Navbar.vue
src/layout/components/Navbar.vue
+1
-1
index.vue
src/layout/index.vue
+3
-7
main.js
src/main.js
+1
-3
permission.js
src/permission.js
+1
-6
alarm.js
src/store/modules/alarm.js
+67
-0
depart.js
src/store/modules/depart.js
+3
-3
user.js
src/store/modules/user.js
+13
-10
common.scss
src/styles/common.scss
+3
-1
element-ui.scss
src/styles/element-ui.scss
+14
-7
auth.js
src/utils/auth.js
+19
-4
global_main_loader.js
src/utils/global_main_loader.js
+0
-2
request.js
src/utils/request.js
+5
-11
websocket.js
src/utils/websocket.js
+3
-10
index.vue
src/views/alarm/cableTime/index.vue
+101
-105
index.vue
src/views/alarm/device/index.vue
+14
-15
type1.vue
src/views/dashboard/components/type1.vue
+59
-70
type3.vue
src/views/dashboard/components/type3.vue
+49
-49
type4.vue
src/views/dashboard/components/type4.vue
+3
-3
type5.vue
src/views/dashboard/components/type5.vue
+78
-83
index.vue
src/views/history/deviceLinkRepair/index.vue
+87
-83
index.vue
src/views/history/deviceLinkStatus/index.vue
+87
-79
index.vue
src/views/history/leakyCableRepair/index.vue
+59
-62
index.vue
src/views/login/index.vue
+47
-55
index.vue
src/views/monitor/equipment/index.vue
+62
-62
index.vue
src/views/monitor/leakageCable/index.vue
+57
-57
FSU.vue
src/views/setting/add/comp/FSU.vue
+49
-59
leakyCable.vue
src/views/setting/add/comp/leakyCable.vue
+2
-5
monitorEquip.vue
src/views/setting/add/comp/monitorEquip.vue
+1
-4
railWay.vue
src/views/setting/add/comp/railWay.vue
+2
-4
station.vue
src/views/setting/add/comp/station.vue
+1
-4
index.vue
src/views/setting/add/index.vue
+24
-26
fsuTable.vue
src/views/setting/statistics/comp/fsuTable.vue
+2
-3
index.vue
src/views/setting/statistics/index.vue
+16
-20
No files found.
src/App.vue
View file @
aacebaea
<
template
>
<div
id=
"app"
>
<router-view
/>
<audio
ref=
"audio"
id=
"my_
audio"
src=
"./assets/audio/urgent.wav"
muted
autoplay
/>
<audio
id=
"my_audio"
ref=
"
audio"
src=
"./assets/audio/urgent.wav"
muted
autoplay
/>
<transition
name=
"tipalerm"
>
<div
class=
"tips"
v-if=
"tflag
"
>
<div
v-if=
"tflag"
class=
"tips
"
>
<p>
提示
</p>
<span
>
系统新增
{{
msg
.
count
}}
条
<span
v-text=
"msg.type == 1 ? '设备连接' : '漏缆监测'"
></span
><span
id=
"alevel"
:style=
"alevel"
>
{{
msg
.
level
}}
</span
>
告警消息,请及时查看!
</span
>
<span>
系统新增
{{
msg
.
count
}}
条
<span
v-text=
"msg.type == 1 ? '设备连接' : '漏缆监测'"
/>
<span
id=
"alevel"
:style=
"alevel"
>
{{
msg
.
level
}}
</span>
告警消息,请及时查看!
</span>
</div>
</transition>
</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
{
websocket
:
null
,
tflag
:
false
,
msg
:
""
,
msg
:
''
,
alevel
:
{
color
:
""
,
color
:
''
},
audioUrl
:
''
,
audioObj
:
{
'一般'
:
'commonly.wav'
,
'重要'
:
'importang.wav'
,
'紧急'
:
'urgent.wav'
,
'连接异常'
:
'urgent.wav'
}
}
};
},
computed
:
{
...
mapState
(
"user"
,
[
"userBaseInfo"
,
"token"
]),
...
mapState
(
'user'
,
[
'userBaseInfo'
,
'token'
]),
userId
()
{
return
this
.
userBaseInfo
.
userId
;
return
this
.
userBaseInfo
.
userId
},
usertoken
()
{
return
this
.
token
;
},
},
methods
:
{
receiveMessage
,
closeWebsocket
()
{
if
(
this
.
websocket
)
{
this
.
websocket
.
close
();
}
},
levelcolor
()
{
if
(
this
.
msg
.
level
==
"正常"
||
this
.
msg
.
level
==
"连接正常"
)
{
this
.
alevel
.
color
=
"green"
;
}
else
if
(
this
.
msg
.
level
==
"紧急"
||
this
.
msg
.
level
==
"连接异常"
)
{
this
.
alevel
.
color
=
"#f00"
;
}
else
if
(
this
.
msg
.
level
==
"重要"
)
{
this
.
alevel
.
color
=
"#f89850"
;
}
else
if
(
this
.
msg
.
level
==
"一般"
)
{
this
.
alevel
.
color
=
"#ead906"
;
return
this
.
token
}
},
},
mounted
()
{
let
audioPlay
=
document
.
getElementById
(
"my_audio"
);
EventBus
.
$on
(
"dialogAlarm"
,
(
data
)
=>
{
// 接收消息之后 声音弹窗显示
this
.
msg
=
data
;
this
.
audioUrl
=
'./assets/audio/'
+
this
.
audioObj
[
data
.
level
]
setTimeout
(()
=>
{
audioPlay
.
play
();
},
500
)
this
.
levelcolor
();
this
.
tflag
=
true
;
setTimeout
(()
=>
{
this
.
tflag
=
false
;
},
3000
);
});
EventBus
.
$on
(
"cancelWS"
,
()
=>
{
this
.
websocket
.
close
();
console
.
log
(
'关闭ws'
);
});
},
watch
:
{
$route
(
to
,
from
)
{
if
(
to
.
path
==
"/login"
)
{
setTimeout
(
this
.
closeWebsocket
(),
300
)
if
(
to
.
path
==
=
'/login'
)
{
setTimeout
(
this
.
closeWebsocket
(),
300
)
// this.websocket.close()
console
.
log
(
"在登录页"
);
console
.
log
(
'在登录页'
)
}
},
usertoken
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
if
(
newV
!=
''
)
{
this
.
websocket
=
socket
({
onmessage
:
this
.
receiveMessage
,
});
}
else
{
if
(
newV
!==
''
)
{
this
.
websocket
=
socket
({
onmessage
:
this
.
receiveMessage
})
}
else
{
this
.
closeWebsocket
();
}
}
}
}
},
mounted
()
{
let
audioPlay
=
document
.
getElementById
(
'my_audio'
)
EventBus
.
$on
(
'dialogAlarm'
,
(
data
)
=>
{
// 接收消息之后 声音弹窗显示
this
.
msg
=
data
this
.
levelcolor
()
this
.
tflag
=
true
setTimeout
(()
=>
{
this
.
tflag
=
false
},
3000
)
})
EventBus
.
$on
(
'autioPlay'
,
(
data
)
=>
{
this
.
audioUrl
=
'./assets/audio/'
+
this
.
audioObj
[
data
.
level
]
setTimeout
(()
=>
{
audioPlay
.
play
()
},
500
)
})
EventBus
.
$on
(
'cancelWS'
,
()
=>
{
this
.
websocket
.
close
()
console
.
log
(
'关闭ws'
)
})
},
methods
:
{
receiveMessage
,
closeWebsocket
()
{
if
(
this
.
websocket
)
{
this
.
websocket
.
close
()
}
},
};
levelcolor
()
{
if
(
this
.
msg
.
level
===
'正常'
||
this
.
msg
.
level
===
'连接正常'
)
{
this
.
alevel
.
color
=
'green'
}
else
if
(
this
.
msg
.
level
===
'紧急'
||
this
.
msg
.
level
===
'连接异常'
)
{
this
.
alevel
.
color
=
'#f00'
}
else
if
(
this
.
msg
.
level
===
'重要'
)
{
this
.
alevel
.
color
=
'#f89850'
}
else
if
(
this
.
msg
.
level
===
'一般'
)
{
this
.
alevel
.
color
=
'#ead906'
}
}
}
}
</
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;
// }
}
#app
{}
.tipalerm-enter-active
{
transition
:
0
.5s
;
}
...
...
src/api/user.js
View file @
aacebaea
...
...
@@ -9,7 +9,7 @@ export function login(data) {
}
export
function
getInfo
()
{
return
request
.
post
(
'/user/
selectUserBaseInfo
'
,
...
arguments
)
return
request
.
post
(
'/user/
getUser
'
,
...
arguments
)
}
export
function
logout
()
{
...
...
src/components/Breadcrumb/index.vue
View file @
aacebaea
...
...
@@ -29,7 +29,7 @@ export default {
methods
:
{
getBreadcrumb
()
{
// only show routes with meta.title
le
t
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
)
cons
t
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
)
const
first
=
matched
[
0
]
// if (!this.isDashboard(first)) {
...
...
src/const/index.js
View file @
aacebaea
export
const
alarmLeval
=
{
1
:
'紧急'
,
2
:
'重要'
,
3
:
'一般'
,
3
:
'一般'
}
export
const
ConnectStatusEnum
=
{
...
...
@@ -13,5 +13,5 @@ export const levelStyle = {
'-1'
:
'level_G'
,
'0'
:
'level_Y'
,
'1'
:
'level_O'
,
'2'
:
'level_R'
,
'2'
:
'level_R'
}
src/layout/components/AppMain.vue
View file @
aacebaea
...
...
@@ -4,7 +4,6 @@
<!--
<keep-alive
include=
"Dashboard"
>
-->
<router-view
:key=
"key"
/>
<!--
</keep-alive>
-->
</transition>
</section>
</
template
>
...
...
src/layout/components/Navbar.vue
View file @
aacebaea
...
...
@@ -96,7 +96,7 @@ export default {
<
style
lang=
"scss"
scoped
>
.navbar
{
overflow
:
hidden
;
position
:
fixed
;
//
position: fixed;
top
:
0
;
left
:
0
;
z-index
:
5
;
...
...
src/layout/index.vue
View file @
aacebaea
...
...
@@ -13,20 +13,16 @@
</
template
>
<
script
>
import
Breadcrumb
from
'@/components/Breadcrumb'
import
{
Navbar
,
Sidebar
,
AppMain
,
Topbar
}
from
'./components'
import
Breadcrumb
from
'@/components/Breadcrumb
/index.vue
'
import
{
Navbar
,
AppMain
}
from
'./components'
import
ResizeMixin
from
'./mixin/ResizeHandler'
import
orgTree
from
'@/components/orgTree.vue'
export
default
{
name
:
'Layout'
,
components
:
{
Breadcrumb
,
Navbar
,
Sidebar
,
AppMain
,
Topbar
,
orgTree
AppMain
},
mixins
:
[
ResizeMixin
],
computed
:
{
...
...
src/main.js
View file @
aacebaea
...
...
@@ -10,8 +10,6 @@ import router from './router'
import
'@/icons'
// icon
import
'@/permission'
// permission control
import
performLoader
from
'@/utils/global_main_loader.js'
import
WS
from
'@/utils/websocket'
Vue
.
prototype
.
$ws
=
WS
Vue
.
use
(
ElementUI
,
{
locale
})
...
...
src/permission.js
View file @
aacebaea
...
...
@@ -22,11 +22,10 @@ router.beforeEach(async(to, from, next) => {
if
(
hasToken
)
{
if
(
to
.
path
===
'/login'
)
{
// if is logged in, redirect to the home page
next
({
path
:
'/'
})
NProgress
.
done
()
}
else
{
const
hasGetUserInfo
=
store
.
getters
.
n
ame
const
hasGetUserInfo
=
store
.
getters
.
userN
ame
if
(
hasGetUserInfo
)
{
next
()
}
else
{
...
...
@@ -46,12 +45,9 @@ router.beforeEach(async(to, from, next) => {
}
}
else
{
/* has no token*/
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
// in the free login whitelist, go directly
next
()
}
else
{
// other pages that do not have permission to access are redirected to the login page.
next
(
`/login?redirect=
${
to
.
path
}
`
)
NProgress
.
done
()
}
...
...
@@ -59,6 +55,5 @@ router.beforeEach(async(to, from, next) => {
})
router
.
afterEach
(()
=>
{
// finish progress bar
NProgress
.
done
()
})
src/store/modules/alarm.js
0 → 100644
View file @
aacebaea
import
{
deptList
}
from
'@/api/baseData'
const
getDefaultState
=
()
=>
{
return
{
cableList
:
null
,
deviceList
:
null
}
}
const
state
=
getDefaultState
()
const
mutations
=
{
RESET_STATE
:
state
=>
{
Object
.
assign
(
state
,
getDefaultState
())
},
SET_DEPART
:
(
state
,
payload
)
=>
{
state
.
departList
=
handleDepart
(
payload
)
state
.
departMap
=
listToMap
(
payload
)
}
}
const
actions
=
{
getDepart
({
commit
})
{
deptList
({}).
then
(
res
=>
{
if
(
!
res
)
return
commit
(
'SET_DEPART'
,
res
)
})
}
}
const
getters
=
{
departMap
(
state
)
{
return
state
.
departMap
},
departList
(
state
)
{
return
state
.
departList
}
}
function
handleDepart
(
list
)
{
if
(
!
list
)
return
return
list
.
map
(
item
=>
{
const
data
=
{}
data
.
label
=
item
.
dictValue
data
.
name
=
item
.
dictValue
data
.
id
=
item
.
id
data
.
value
=
item
.
id
data
.
data
=
item
return
data
})
}
function
listToMap
(
arr
,
mapKey
=
'id'
)
{
const
map
=
{}
arr
.
forEach
(
item
=>
{
map
[
item
[
mapKey
]]
=
item
})
return
map
}
export
default
{
namespaced
:
true
,
state
,
mutations
,
actions
,
getters
}
src/store/modules/depart.js
View file @
aacebaea
...
...
@@ -16,7 +16,7 @@ const mutations = {
SET_DEPART
:
(
state
,
payload
)
=>
{
state
.
departList
=
handleDepart
(
payload
)
state
.
departMap
=
listToMap
(
payload
)
}
,
}
}
const
actions
=
{
...
...
@@ -25,7 +25,7 @@ const actions = {
if
(
!
res
)
return
commit
(
'SET_DEPART'
,
res
)
})
}
,
}
}
const
getters
=
{
...
...
@@ -34,7 +34,7 @@ const getters = {
},
departList
(
state
)
{
return
state
.
departList
}
,
}
}
function
handleDepart
(
list
)
{
...
...
src/store/modules/user.js
View file @
aacebaea
import
{
login
,
getInfo
}
from
'@/api/user'
import
{
getToken
,
setToken
,
removeToken
,
getUserName
,
getUserId
,
removeUserName
,
removeUserId
}
from
'@/utils/auth'
import
{
getToken
,
setToken
,
removeToken
,
removeUserName
,
removeUserId
}
from
'@/utils/auth'
import
{
resetRouter
}
from
'@/router'
const
getDefaultState
=
()
=>
{
return
{
token
:
getToken
(),
userBaseInfo
:
{}
userBaseInfo
:
{},
userId
:
''
}
}
...
...
@@ -17,11 +18,13 @@ const mutations = {
},
SET_TOKEN
:
(
state
,
token
)
=>
{
state
.
token
=
token
console
.
log
(
token
);
},
SET_BASEINFO
:
(
state
,
data
)
=>
{
state
.
userBaseInfo
=
data
},
SET_USERID
:
(
state
,
data
)
=>
{
state
.
userId
=
data
}
}
const
actions
=
{
...
...
@@ -43,7 +46,7 @@ const actions = {
// get user info
getInfo
({
commit
})
{
getInfo
({
type
:
0
}).
then
(
res
=>
{
getInfo
({
type
:
0
}).
then
(
res
=>
{
if
(
!
res
)
return
commit
(
'SET_BASEINFO'
,
res
)
})
...
...
@@ -54,10 +57,10 @@ const actions = {
return
new
Promise
((
resolve
,
reject
)
=>
{
removeToken
()
// must remove token first
removeUserName
()
// must remove token first
//
removeUserId() // must remove token first
removeUserId
()
// must remove token first
resetRouter
()
commit
(
"SET_TOKEN"
,
""
)
commit
(
"SET_BASEINFO"
,
{})
commit
(
'SET_TOKEN'
,
''
)
commit
(
'SET_BASEINFO'
,
{})
commit
(
'RESET_STATE'
)
resolve
()
})
...
...
@@ -67,8 +70,8 @@ const actions = {
resetToken
({
commit
})
{
return
new
Promise
(
resolve
=>
{
removeToken
()
// must remove token first
removeUserName
()
// must remove token first
// removeUserId() // must remove token first
removeUserName
()
removeUserId
()
commit
(
'RESET_STATE'
)
resolve
()
})
...
...
@@ -81,7 +84,7 @@ const getters = {
},
userBaseInfo
(
state
)
{
return
state
.
userBaseInfo
}
,
}
}
export
default
{
...
...
src/styles/common.scss
View file @
aacebaea
...
...
@@ -42,9 +42,11 @@
}
.el-table
{
height
:
613px
;
height
:
calc
(
88vh
-
150px
)
;
overflow-y
:
auto
;
}
.el-dialog__header
{
text-align
:
center
;
}
...
...
src/styles/element-ui.scss
View file @
aacebaea
...
...
@@ -90,13 +90,6 @@
top
:
53%
;
}
.el-table__body
tr
:active
>
td
{
background-color
:
#bed5ff
!
important
;
}
.el-table__body
tr
.hover-row
>
td
{
background-color
:
#bed5ff
!
important
;
}
.el-scrollbar
{
height
:
100%
;
...
...
@@ -107,3 +100,17 @@
width
:
110%
;
height
:
98%
;
}
.
el-table__body-wrapper
:
:-
webkit-scrollbar
{
width
:
2px
;
}
.
el-table__body-wrapper
:
:-
webkit-scrollbar-thumb
{
border-radius
:
2px
;
height
:
50px
;
background
:
#eee
;
}
.
el-table__body-wrapper
:
:-
webkit-scrollbar-track
{
box-shadow
:
inset
0
0
5px
rgba
(
0
,
0
,
0
,
0
.2
);
border-radius
:
2px
;
background
:
rgba
(
0
,
0
,
0
,
0
.4
);
}
\ No newline at end of file
src/utils/auth.js
View file @
aacebaea
...
...
@@ -13,12 +13,27 @@ export function setToken(token) {
export
function
removeToken
()
{
return
Cookies
.
remove
(
TokenKey
)
}
export
function
setUserName
(
username
){
return
Cookies
.
set
(
'userName'
,
username
)
export
function
setUserName
(
username
)
{
return
Cookies
.
set
(
'userName'
,
username
)
}
export
function
getUserName
(){
export
function
getUserName
()
{
return
Cookies
.
get
(
'userName'
)
}
export
function
removeUserName
(){
export
function
removeUserName
()
{
return
Cookies
.
remove
(
'userName'
)
}
export
function
setUserId
(
username
)
{
return
Cookies
.
set
(
'userId'
,
username
)
}
export
function
getUserId
()
{
return
Cookies
.
get
(
'userId'
)
}
export
function
removeUserId
()
{
return
Cookies
.
remove
(
'userId'
)
}
src/utils/global_main_loader.js
View file @
aacebaea
import
Pagination
from
'@/components/Pagination/index.vue'
import
delids
from
'@/components/Del/index.vue'
// import VueSocketIO from 'vue-socket.io'
export
default
function
performLoader
(
Vue
)
{
// self component
...
...
@@ -9,5 +8,4 @@ export default function performLoader(Vue) {
Vue
.
component
(
'delids'
,
delids
)
}
Vue
.
use
(
plugins
)
}
src/utils/request.js
View file @
aacebaea
import
axios
from
'axios'
import
{
Message
Box
,
Message
}
from
'element-ui'
import
{
Message
}
from
'element-ui'
import
store
from
'@/store'
import
{
getToken
}
from
'@/utils/auth'
import
socket
from
"@/utils/websocket"
;
import
Vue
from
'vue'
import
EventBus
from
'@/utils/bus'
...
...
@@ -62,13 +61,13 @@ service.interceptors.response.use(
let
resFinal
=
res
.
rsp
||
res
||
{}
let
code
=
resFinal
.
errorCode
||
resFinal
.
code
let
message
=
resFinal
.
message
||
resFinal
.
errorMsg
||
resFinal
.
error
||
'接口错误'
if
(
code
)
{
if
(
code
==
201
)
{
if
(
code
)
{
if
(
code
==
=
201
)
{
location
.
href
=
location
.
href
.
replace
(
/#.+/
,
''
)
+
'#/login'
EventBus
.
$emit
(
'cancelWS'
)
return
}
if
(
code
==
501
)
{
if
(
code
==
=
501
)
{
// !config.silence && !errorShowing && Message.error(message)
errorShowing
=
true
setTimeout
(()
=>
{
errorShowing
=
false
},
3000
)
...
...
@@ -92,11 +91,6 @@ service.interceptors.response.use(
Message
.
error
(
error
.
message
)
}
}
// Message({
// message: error.message,
// type: 'error',
// duration: 5 * 1000
// })
return
Promise
.
reject
(
error
)
}
)
...
...
src/utils/websocket.js
View file @
aacebaea
...
...
@@ -65,16 +65,9 @@ function heartCheck(websocket) {
//消息处理
export
function
receiveMessage
(
message
)
{
// 消息接收后处理逻辑 接口访问
// console.log(message, '接收到的信息');
if
(
message
!=
'连接成功'
)
{
let
obj
=
JSON
.
parse
(
JSON
.
parse
(
message
))
let
obj
=
JSON
.
parse
(
JSON
.
parse
(
message
))
EventBus
.
$emit
(
'dialogAlarm'
,
obj
)
EventBus
.
$emit
(
'autioPlay'
,
obj
)
}
// return obj
}
\ No newline at end of file
src/views/alarm/cableTime/index.vue
View file @
aacebaea
...
...
@@ -7,11 +7,10 @@
:key=
"item.key"
:type=
"confirmStatus === item.key ? 'primary' : ''"
@
click=
"changeType(item)"
>
{{
item
.
label
}}
</el-button
>
>
{{
item
.
label
}}
</el-button>
</el-button-group>
<div
class=
"leakage-top"
>
<div
style=
"color: #666666"
></div
>
<div
style=
"color: #666666"
/
>
<div
class=
"operate-btn"
>
<el-button
type=
"primary"
@
click=
"refresh"
>
刷新
</el-button>
<el-button
type=
"primary"
@
click=
"isQuery = !isQuery"
>
查询
</el-button>
...
...
@@ -19,7 +18,7 @@
</div>
</div>
<div
v-show=
"isQuery"
>
<search
@
search=
"search"
ref=
"reset
"
/>
<search
ref=
"reset"
@
search=
"search
"
/>
</div>
<el-table
:data=
"tableData"
...
...
@@ -45,8 +44,7 @@
label=
"告警级别"
width=
"150"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"alarmInfo"
label=
"告警信息"
...
...
@@ -77,20 +75,17 @@
<el-table-column
label=
"操作"
align=
"center"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
v-if=
"
scope.row.confirmStatus === 1 &&
scope.row.alarmLevelName == '正常'
scope.row.confirmStatus === 1 && scope.row.alarmLevelName == '正常'
"
type=
"text"
@
click=
"cancel2(scope.row)"
>
取消
</el-button
>
>
取消
</el-button>
<el-button
type=
"text"
v-else-if=
"scope.row.confirmStatus === 0"
type=
"text"
@
click=
"confirm2(scope.row)"
>
确认
</el-button
>
>
确认
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -106,7 +101,7 @@
<label
class=
"particulars"
>
基站名称:
</label>
</td>
<td
style=
"width: 180px; text-align: left"
>
<label
v-text=
"dialogInfo.siteName"
></label
>
<label
v-text=
"dialogInfo.siteName"
/
>
</td>
</tr>
<tr
style=
"line-height: 50px"
>
...
...
@@ -114,7 +109,7 @@
<label
class=
"particulars"
>
告警对象:
</label>
</td>
<td
style=
"width: 180px; text-align: left"
>
<label
v-text=
"dialogInfo.alarmTarget"
></label
>
<label
v-text=
"dialogInfo.alarmTarget"
/
>
</td>
</tr>
<tr
style=
"line-height: 50px"
>
...
...
@@ -122,7 +117,7 @@
<label
class=
"particulars"
>
告警级别:
</label>
</td>
<td
style=
"width: 180px; text-align: left"
>
<label
v-text=
"dialogInfo.alarmLevelName"
></label
>
<label
v-text=
"dialogInfo.alarmLevelName"
/
>
</td>
</tr>
<tr
style=
"line-height: 50px"
>
...
...
@@ -130,7 +125,11 @@
<label
class=
"particulars"
>
告警信息:
</label>
</td>
<td
style=
"width: 180px; text-align: left"
>
<label
v-text=
"dialogInfo.alarmInfo"
></label>
<div
v-for=
"(item, index) in dialogInfo.alarmInfo"
style=
"font-weight:700"
:key=
"index"
>
<span>
距离:{{ item.distance }}
</span>
<span>
驻波比:{{ item.value }}
</span>
</div>
<div
style=
"font-weight:700"
>
漏缆百米损耗: {{ dialogInfo.lossValue }}
</div>
</td>
</tr>
<tr
style=
"line-height: 50px"
>
...
...
@@ -138,7 +137,7 @@
<label
class=
"particulars"
>
最新上传时间:
</label>
</td>
<td
style=
"width: 180px; text-align: left"
>
<label
v-text=
"dialogInfo.lateUploadTime"
></label
>
<label
v-text=
"dialogInfo.lateUploadTime"
/
>
</td>
</tr>
<tr
style=
"line-height: 50px"
>
...
...
@@ -146,26 +145,23 @@
<label
class=
"particulars"
>
状态变化时间:
</label>
</td>
<td
style=
"width: 180px; text-align: left"
>
<label
v-text=
"dialogInfo.statusTimeChange"
></label
>
<label
v-text=
"dialogInfo.statusTimeChange"
/
>
</td>
</tr>
</table>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
v-if=
"
dialogInfo.confirmStatus === 1 &&
dialogInfo.alarmLevelName === '正常'
dialogInfo.confirmStatus === 1 && dialogInfo.alarmLevelName === '正常'
"
type=
"primary"
@
click=
"cancel(dialogInfo)"
>
取消告警
</el-button
>
>
取消告警
</el-button>
<el-button
v-else-if=
"dialogInfo.confirmStatus !== 1"
type=
"primary"
@
click=
"confirm(dialogInfo)"
>
确认告警
</el-button
>
>
确认告警
</el-button>
</span>
</el-dialog>
<Pagination
...
...
@@ -179,149 +175,149 @@
</template>
<
script
>
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
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
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
{
successAlert
,
warningAlert
}
from
'@/utils/alert'
import
{
levelStyle
}
from
'@/const/index'
export
default
{
components
:
{
search
},
data
()
{
return
{
confirmStatus
:
1
,
confirmStatus
:
0
,
dialogInfo
:
[],
centerDialogVisible
:
false
,
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
total
:
10
,
tableData
:
[],
tabs
:
[
{
label
:
"已确认"
,
key
:
1
,
label
:
'未确认'
,
key
:
0
},
{
label
:
"未确认"
,
key
:
0
,
}
,
label
:
'已确认'
,
key
:
1
}
],
isQuery
:
false
,
istrue
:
0
,
searchOption
:
{},
exids
:
[],
levelStyle
};
}
},
mounted
()
{
this
.
getTableData
()
},
created
()
{
console
.
log
(
this
.
$route
.
query
)
this
.
searchOption
=
this
.
$route
.
query
},
components
:
{
search
},
methods
:
{
// 表格背景图颜色
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
alarmLevelName
==
"紧急"
&&
column
.
label
==
"告警级别"
)
{
return
"emergency"
;
}
else
if
(
row
.
alarmLevelName
==
"重要"
&&
column
.
label
==
"告警级别"
)
{
return
"important"
;
}
else
if
(
row
.
alarmLevelName
==
"一般"
&&
column
.
label
==
"告警级别"
)
{
return
"common"
;
}
else
if
(
row
.
alarmLevelName
==
"正常"
&&
column
.
label
==
"告警级别"
)
{
return
"normal"
;
if
(
row
.
alarmLevelName
==
=
'紧急'
&&
column
.
property
===
'alarmLevelName'
)
{
return
'emergency'
}
else
if
(
row
.
alarmLevelName
==
=
'重要'
&&
column
.
property
===
'alarmLevelName'
)
{
return
'important'
}
else
if
(
row
.
alarmLevelName
==
=
'一般'
&&
column
.
property
===
'alarmLevelName'
)
{
return
'common'
}
else
if
(
row
.
alarmLevelName
==
=
'正常'
&&
column
.
property
===
'alarmLevelName'
)
{
return
'normal'
}
if
(
rowIndex
%
2
==
1
)
{
return
"stripe"
;
if
(
rowIndex
%
2
==
=
1
)
{
return
'stripe'
}
},
refresh
()
{
this
.
$refs
.
reset
!=
undefined
this
.
$refs
.
reset
!=
=
undefined
?
this
.
$refs
.
reset
.
reset
()
:
this
.
getTableData
()
;
:
this
.
getTableData
()
},
handlePageChange
(
pageData
)
{
this
.
params
.
size
=
pageData
.
size
;
this
.
params
.
current
=
pageData
.
page
;
this
.
getTableData
()
;
this
.
params
.
size
=
pageData
.
size
this
.
params
.
current
=
pageData
.
page
this
.
getTableData
()
},
search
(
option
)
{
this
.
istrue
=
1
;
this
.
searchOption
=
option
;
this
.
getTableData
()
;
this
.
istrue
=
1
this
.
searchOption
=
option
this
.
getTableData
()
},
getTableData
()
{
let
param
=
{
confirmStatus
:
this
.
confirmStatus
,
...
this
.
params
,
...
this
.
searchOption
,
}
;
...
this
.
searchOption
}
cableTimeList
(
param
).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[]
;
let
list
=
res
.
records
||
[]
list
.
forEach
(
item
=>
{
if
(
item
.
alarmInfo
!
=
''
&&
item
.
alarmInfo
!=
null
)
{
if
(
item
.
alarmInfo
!=
=
''
&&
item
.
alarmInfo
!=
null
)
{
item
.
alarmInfo
=
JSON
.
parse
(
item
.
alarmInfo
)
item
.
lossValue
=
eval
(
item
.
alarmInfo
.
map
(
k
=>
k
.
lossValue
).
join
(
'+'
))
}
})
;
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
(
i
=>
i
.
id
)
;
})
this
.
tableData
=
list
this
.
total
=
res
.
total
this
.
exids
=
list
.
map
(
i
=>
i
.
id
)
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
!=
0
)
{
successAlert
(
"操作成功"
);
successAlert
(
'操作成功'
)
}
else
{
warningAlert
(
"查询结果为空"
);
warningAlert
(
'查询结果为空'
)
}
this
.
istrue
=
0
;
this
.
istrue
=
0
}
})
;
})
},
confirm
(
dialogInfo
)
{
let
id
=
dialogInfo
.
id
;
let
id
=
dialogInfo
.
id
cableConfirm
({
id
:
id
}).
then
((
res
)
=>
{
this
.
getTableData
()
;
})
;
this
.
centerDialogVisible
=
false
;
this
.
getTableData
()
})
this
.
centerDialogVisible
=
false
},
confirm2
(
row
)
{
this
.
centerDialogVisible
=
true
;
this
.
dialogInfo
=
row
;
this
.
centerDialogVisible
=
true
this
.
dialogInfo
=
row
},
cancel
(
dialogInfo
)
{
let
query
=
{
alarmLevelName
:
dialogInfo
.
alarmLevelName
,
id
:
dialogInfo
.
id
,
}
;
id
:
dialogInfo
.
id
}
cableCancel
(
query
).
then
((
res
)
=>
{
this
.
getTableData
()
;
})
;
this
.
centerDialogVisible
=
false
;
this
.
getTableData
()
})
this
.
centerDialogVisible
=
false
},
cancel2
(
row
)
{
this
.
centerDialogVisible
=
true
;
this
.
dialogInfo
=
row
;
this
.
centerDialogVisible
=
true
this
.
dialogInfo
=
row
},
changeType
(
item
)
{
this
.
confirmStatus
=
item
.
key
;
this
.
getTableData
()
;
this
.
confirmStatus
=
item
.
key
this
.
getTableData
()
},
exportList
()
{
if
(
this
.
exids
.
length
==
0
)
{
this
.
$message
.
warning
(
"暂无数据"
);
return
false
;
if
(
this
.
exids
.
length
==
=
0
)
{
this
.
$message
.
warning
(
'暂无数据'
)
return
false
}
else
{
exportLeakyCable
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`漏缆监测告警.xls`
);
})
;
download
(
res
,
'vnd.ms-excel'
,
`漏缆监测告警.xls`
)
})
}
},
},
mounted
()
{
this
.
getTableData
();
},
created
()
{
console
.
log
(
this
.
$route
.
query
);
this
.
searchOption
=
this
.
$route
.
query
},
};
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -351,16 +347,16 @@ export default {
background-color
:
#eaf1fe
;
}
&
:
:
v-deep
.
emergency
{
background-color
:
#f00
;
background-color
:
#f00
!
important
;
}
&
:
:
v-deep
.
important
{
background-color
:
#f89850
;
background-color
:
#f89850
!
important
;
}
&
:
:
v-deep
.
common
{
background-color
:
#ead906
;
background-color
:
#ead906
!
important
;
}
&
:
:
v-deep
.
normal
{
background-color
:
green
;
background-color
:
green
!
important
;
}
.page
{
display
:
flex
;
...
...
src/views/alarm/device/index.vue
View file @
aacebaea
...
...
@@ -141,52 +141,51 @@ import download from "@/utils/download";
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
export
default
{
name
:
'device'
,
components
:
{
search
},
data
()
{
return
{
alarmInfo
:
""
,
dialogInfo
:
[],
centerDialogVisible
:
false
,
confirmStatus
:
1
,
confirmStatus
:
0
,
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
total
:
10
,
tableData
:
[],
tabs
:
[
{
label
:
"已确认"
,
key
:
1
,
},
{
label
:
"未确认"
,
key
:
0
,
key
:
0
},
{
label
:
"已确认"
,
key
:
1
}
],
isQuery
:
false
,
istrue
:
0
,
searchOption
:
{},
exids
:
[]
,
}
;
exids
:
[]
}
},
components
:
{
search
},
methods
:
{
// 表格背景图颜色
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
connectStatusName
==
"连接正常"
&&
column
.
property
==
"connectStatusName"
row
.
connectStatusName
==
=
"连接正常"
&&
column
.
property
==
=
"connectStatusName"
)
{
return
"green"
;
}
if
(
row
.
connectStatusName
==
"连接异常"
&&
row
.
connectStatusName
==
=
"连接异常"
&&
column
.
property
==
"connectStatusName"
)
{
return
"red"
;
}
if
(
rowIndex
%
2
==
1
)
{
if
(
rowIndex
%
2
==
=
1
)
{
return
"stripe"
;
}
},
...
...
src/views/dashboard/components/type1.vue
View file @
aacebaea
...
...
@@ -53,19 +53,17 @@
<el-col
:span=
"10"
class=
"value_handle"
:style=
"acolor3"
>
{{
form
.
status
.
connectAlarm
}}
</el-col>
<el-col
:span=
"10"
><el-button
<el-col
:span=
"10"
>
<el-button
v-if=
"
form.status.connectAlarm == '告警' || form.status.connectAlarm == '连接异常'
"
class=
"alarmbtn"
type=
"primary"
size=
"mini"
v-if=
"
form.status.connectAlarm == '告警' ||
form.status.connectAlarm == '连接异常'
"
@
click=
"toalarm(form.status.connectAlarm)"
>
处理告警
</el-button
></el-col
>
>
处理告警
</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
...
...
@@ -78,20 +76,15 @@
<el-col
:span=
"10"
class=
"value_handle"
:style=
"acolor"
>
{{
form
.
status
.
monitorAlarm
}}
</el-col>
<el-col
:span=
"10"
><el-button
<el-col
:span=
"10"
>
<el-button
v-if=
"form.status.monitorAlarm != '正常' && form.status.monitorAlarm != '' && form.status.monitorAlarm != undefined"
class=
"alarmbtn"
type=
"primary"
size=
"mini"
v-if=
"
form.status.monitorAlarm != '正常' &&
form.status.monitorAlarm != '' &&
form.status.monitorAlarm != undefined
"
@
click=
"toalarm(form.status.monitorAlarm)"
>
处理告警
</el-button
></el-col
>
>
处理告警
</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
...
...
@@ -153,21 +146,19 @@
<span>
基础信息
</span>
<el-button
v-if=
"flag == true"
style=
"float: right; padding: 3px 0; margin-right: 20px"
type=
"text"
class=
"savebtn"
v-if=
"flag == true"
@
click=
"editbtn()"
><svg-icon
icon-class=
"edit"
/>
编辑
</el-button
>
><svg-icon
icon-class=
"edit"
/>
编辑
</el-button>
<el-button
v-else
style=
"float: right; padding: 3px 0; margin-right: 20px"
type=
"text"
class=
"savebtn"
v-else
@
click=
"savebtn()"
><svg-icon
icon-class=
"save"
/>
保存
</el-button
>
><svg-icon
icon-class=
"save"
/>
保存
</el-button>
</div>
<div>
<el-row
class=
"text"
:gutter=
"24"
>
...
...
@@ -181,7 +172,7 @@
clearable
placeholder=
"请输入内容"
:disabled=
"flag"
></el-input
>
/
>
</div>
</el-col>
</el-row>
...
...
@@ -196,7 +187,7 @@
clearable
placeholder=
"请输入内容"
:disabled=
"flag"
></el-input
>
/
>
</div>
</el-col>
</el-row>
...
...
@@ -246,7 +237,7 @@
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
></el-option
>
/
>
</el-select>
</div>
</el-col>
...
...
@@ -259,29 +250,44 @@
</
template
>
<
script
>
import
{
DetailMixins
}
from
"./mixins"
;
import
{
getUserName
}
from
"@/utils/auth"
;
import
{
railWayOpen
}
from
"../api"
;
import
{
DetailMixins
}
from
'./mixins'
import
{
getUserName
}
from
'@/utils/auth'
import
{
railWayOpen
}
from
'../api'
export
default
{
name
:
"Dashboard"
,
name
:
'Type1'
,
mixins
:
[
DetailMixins
],
data
()
{
return
{
colspan
:
14
,
acolor
:
{
color
:
""
color
:
''
},
acolor3
:
{
color
:
""
color
:
''
}
}
},
computed
:
{
userName
()
{
return
getUserName
()
}
},
watch
:
{
form
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
waylevelcolor
()
this
.
waylevelcolor2
()
}
}
},
};
deep
:
true
},
methods
:
{
savebtn
()
{
this
.
flag
=
true
;
let
params
=
{
this
.
flag
=
true
const
params
=
{
id
:
this
.
form
.
baseInfo
.
id
,
name
:
this
.
form
.
baseInfo
.
name
,
isOpen
:
this
.
form
.
baseInfo
.
isOpen
,
...
...
@@ -290,34 +296,34 @@ export default {
totalLong
:
this
.
form
.
baseInfo
.
totalLong
}
railWayOpen
(
params
).
then
((
res
)
=>
{
this
.
$message
.
success
(
"修改成功"
);
})
;
this
.
$message
.
success
(
'修改成功'
)
})
},
waylevelcolor
()
{
if
(
this
.
form
.
status
.
monitorAlarm
==
'正常'
)
{
if
(
this
.
form
.
status
.
monitorAlarm
==
=
'正常'
)
{
this
.
acolor
.
color
=
'green'
}
else
if
(
this
.
form
.
status
.
monitorAlarm
==
'紧急'
)
{
}
else
if
(
this
.
form
.
status
.
monitorAlarm
==
=
'紧急'
)
{
this
.
acolor
.
color
=
'#f00'
this
.
form
.
status
.
monitorAlarm
=
'紧急告警'
}
else
if
(
this
.
form
.
status
.
monitorAlarm
==
'重要'
)
{
}
else
if
(
this
.
form
.
status
.
monitorAlarm
==
=
'重要'
)
{
this
.
acolor
.
color
=
'#f89850'
this
.
form
.
status
.
monitorAlarm
=
'重要告警'
}
else
if
(
this
.
form
.
status
.
monitorAlarm
==
'一般'
)
{
}
else
if
(
this
.
form
.
status
.
monitorAlarm
==
=
'一般'
)
{
this
.
acolor
.
color
=
'#ead906'
this
.
form
.
status
.
monitorAlarm
=
'一般告警'
}
},
waylevelcolor2
()
{
if
(
this
.
form
.
status
.
connectAlarm
==
'连接正常'
)
{
if
(
this
.
form
.
status
.
connectAlarm
==
=
'连接正常'
)
{
this
.
acolor3
.
color
=
'green'
}
else
if
(
this
.
form
.
status
.
connectAlarm
==
'连接异常'
)
{
}
else
if
(
this
.
form
.
status
.
connectAlarm
==
=
'连接异常'
)
{
this
.
acolor3
.
color
=
'#f00'
this
.
form
.
status
.
connectAlarm
=
'告警'
}
},
toalarm
(
data
)
{
let
topath
=
''
if
(
data
==
'告警'
)
{
if
(
data
==
=
'告警'
)
{
topath
=
'/alarm/device'
}
else
{
topath
=
'/alarm/cableTime'
...
...
@@ -327,28 +333,11 @@ export default {
query
:
{
wayId
:
this
.
form
.
baseInfo
.
id
},
});
},
},
computed
:
{
userName
()
{
return
getUserName
();
},
},
watch
:
{
form
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
waylevelcolor
()
this
.
waylevelcolor2
()
}
},
},
deep
:
true
,
},
};
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/dashboard/components/type3.vue
View file @
aacebaea
...
...
@@ -3,7 +3,7 @@
<!-- 首页 -->
<header
class=
"header_title"
>
FSU(
{{
form
.
baseInfo
.
equipName
}}
)
</header>
<el-row
:gutter=
"24"
>
<el-col
:span=
"1
1
"
class=
"mb20"
>
<el-col
:span=
"1
2
"
class=
"mb20"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
管理范围
</span>
...
...
@@ -36,7 +36,7 @@
</div>
</el-card>
</el-col>
<el-col
:span=
"1
1
"
class=
"mb20"
>
<el-col
:span=
"1
2
"
class=
"mb20"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
基础信息
</span>
...
...
@@ -209,30 +209,34 @@
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
></el-option
>
/
>
</el-select>
</el-col>
</el-row>
</div>
</el-card>
</el-col>
<el-col
:span=
"1
1
"
class=
"mb20 specialCard"
>
<el-col
:span=
"1
2
"
class=
"mb20 specialCard"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
当前状态
</span>
</div>
<div>
<el-row
v-for=
"(item, i) in statusList"
class=
"text"
:gutter=
"24"
>
<el-row
v-for=
"(item, i) in statusList"
:key=
"i"
class=
"text"
:gutter=
"24"
>
<el-col
:span=
"10"
>
<div
class=
"item_name"
>
{{
item
.
name
}}
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"item_data levelData"
>
{{
item
.
value
}}
</div>
</el-col>
<el-col
:span=
"6"
>
<el-button
class=
"alarmbtn"
type=
"primary"
size=
"mini"
<el-col
:span=
"6"
>
<el-button
v-if=
"item.value == '连接异常' || item.value == '紧急' || item.value == '重要' || item.value == '一般'"
@
click=
"toalarm(item)"
>
处理告警
</el-button>
class=
"alarmbtn"
type=
"primary"
size=
"mini"
@
click=
"toalarm(item)"
>
处理告警
</el-button>
</el-col>
</el-row>
</div>
...
...
@@ -243,56 +247,52 @@
</
template
>
<
script
>
import
{
DetailMixins
}
from
"./mixins"
;
import
{
fsuOpen
}
from
"../api"
;
import
{
DetailMixins
}
from
'./mixins'
import
{
fsuOpen
}
from
'../api'
export
default
{
name
:
"Dashboard"
,
name
:
'Type5'
,
mixins
:
[
DetailMixins
],
data
()
{
return
{
colspan
:
14
,
};
colspan
:
14
}
},
watch
:
{
statusList
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
$nextTick
(
function
()
{
this
.
levelcolor
()
})
}
}
}
},
mixins
:
[
DetailMixins
],
methods
:
{
savebtn
()
{
this
.
flag
=
true
;
this
.
flag
=
true
fsuOpen
(
this
.
info
()).
then
((
res
)
=>
{
this
.
$message
.
success
(
"修改成功"
);
})
;
this
.
$message
.
success
(
'修改成功'
)
})
},
toalarm
(
item
){
toalarm
(
item
)
{
let
topath
=
''
let
toquery
=
{}
if
(
item
.
name
==
'设备状态'
)
{
if
(
item
.
name
=
==
'设备状态'
)
{
topath
=
'/alarm/device'
toquery
=
{
fsuId
:
this
.
form
.
baseInfo
.
id
}
}
else
{
toquery
=
{
fsuId
:
this
.
form
.
baseInfo
.
id
}
}
else
{
topath
=
'/alarm/cableTime'
toquery
=
{
alarmTargetName
:
item
.
name
}
toquery
=
{
alarmTargetName
:
item
.
name
}
}
this
.
$router
.
push
({
path
:
topath
,
query
:
toquery
,
});
},
},
watch
:
{
statusList
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
$nextTick
(
function
()
{
this
.
levelcolor
();
});
query
:
toquery
})
}
},
},
},
mounted
()
{},
};
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/dashboard/components/type4.vue
View file @
aacebaea
...
...
@@ -5,7 +5,7 @@
监测设备(
{{
form
.
baseInfo
.
equipName
}}
)
</header>
<el-row
:gutter=
"24"
>
<el-col
:span=
"1
1
"
class=
"mb20"
>
<el-col
:span=
"1
2
"
class=
"mb20"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
管理范围
</span>
...
...
@@ -30,7 +30,7 @@
</div>
</el-card>
</el-col>
<el-col
:span=
"1
1
"
class=
"mb20"
>
<el-col
:span=
"1
2
"
class=
"mb20"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
基础信息
</span>
...
...
@@ -184,7 +184,7 @@
</div>
</el-card>
</el-col>
<el-col
:span=
"1
1
"
class=
"mb20 specialCard"
>
<el-col
:span=
"1
2
"
class=
"mb20 specialCard"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
当前状态
</span>
...
...
src/views/dashboard/components/type5.vue
View file @
aacebaea
...
...
@@ -5,7 +5,7 @@
漏缆(
{{
form
.
baseInfo
.
leakyCableDescribe
}}
)
</header>
<el-row
:gutter=
"24"
>
<el-col
:span=
"1
1
"
class=
"mb20"
>
<el-col
:span=
"1
2
"
class=
"mb20"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
记录信息
</span>
...
...
@@ -19,9 +19,11 @@
<div
class=
"item_data"
>
{{
form
.
log
.
all
}}
条
</div>
</el-col>
<el-col
:span=
"6"
>
<el-button
class=
"picbtn"
type=
"success"
size=
"mini"
>
趋势分析图形
</el-button
>
<el-button
class=
"picbtn"
type=
"success"
size=
"mini"
>
趋势分析图形
</el-button>
</el-col>
</el-row>
<el-row
class=
"text"
:gutter=
"24"
>
...
...
@@ -31,32 +33,30 @@
<el-col
:span=
"7"
>
<div
class=
"item_data"
>
{{
form
.
log
.
monitor
}}
条
</div>
</el-col>
<el-col
:span=
"7"
>
</el-col
>
<el-col
:span=
"7"
/
>
</el-row>
</div>
</el-card>
</el-col>
<el-col
:span=
"1
1
"
class=
"mb20"
>
<el-col
:span=
"1
2
"
class=
"mb20"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
基础信息
</span>
<el-button
v-if=
"flag == true"
style=
"float: right; padding: 3px 0; margin-right: 20px"
type=
"text"
class=
"savebtn"
v-if=
"flag == true"
@
click=
"editbtn()"
><svg-icon
icon-class=
"edit"
/>
编辑
</el-button
>
><svg-icon
icon-class=
"edit"
/>
编辑
</el-button>
<el-button
v-else
style=
"float: right; padding: 3px 0; margin-right: 20px"
type=
"text"
class=
"savebtn"
v-else
@
click=
"savebtn()"
><svg-icon
icon-class=
"save"
/>
保存
</el-button
>
><svg-icon
icon-class=
"save"
/>
保存
</el-button>
</div>
<div>
<el-row
class=
"text"
:gutter=
"24"
>
...
...
@@ -138,7 +138,7 @@
clearable
placeholder=
"请输入内容"
:disabled=
"flag"
></el-input
>
/
>
</div>
</el-col>
</el-row>
...
...
@@ -197,7 +197,7 @@
<el-col
:span=
"10"
>
<div
class=
"item_name"
>
开通状态
</div>
</el-col>
<el-col
:span=
"
10
"
>
<el-col
:span=
"
colspan
"
>
<el-select
v-model=
"form.baseInfo.isOpen"
:disabled=
"flag"
...
...
@@ -208,14 +208,14 @@
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
></el-option
>
/
>
</el-select>
</el-col>
</el-row>
</div>
</el-card>
</el-col>
<el-col
:span=
"1
1
"
class=
"mb20 specialCard"
>
<el-col
:span=
"1
2
"
class=
"mb20 specialCard"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix posa"
>
<span>
当前状态
</span>
...
...
@@ -228,26 +228,21 @@
</el-col>
<el-col
:span=
"8"
>
<div
v-if=
"statusl.length != 0"
class=
"item_data levelData"
:style=
"acolor"
v-if=
"statusl.length != 0"
>
{{
this
.
statusl
[
0
].
value
}}
</div>
/>
</el-col>
<el-col
:span=
"6"
>
<el-button
v-if=
"
timeStatus.level == '紧急告警' || timeStatus.level == '重要告警' || timeStatus.level == '一般告警'
"
class=
"alarmbtn"
type=
"primary"
size=
"mini"
v-if=
"
this.timeStatus.level == '紧急告警' ||
this.timeStatus.level == '重要告警' ||
this.timeStatus.level == '一般告警'
"
@
click=
"toalarm()"
>
处理告警
</el-button
>
>
处理告警
</el-button>
</el-col>
</el-row>
<el-row
class=
"text"
:gutter=
"24"
>
...
...
@@ -255,12 +250,17 @@
<div
class=
"item_name"
>
最后更新时间
</div>
</el-col>
<el-col
:span=
"colspan"
>
<div
class=
"item_data"
v-if=
"statusl.length != 0
"
>
{{
this
.
statusl
[
1
].
value
}}
<div
v-if=
"statusl.length != 0"
class=
"item_data
"
>
{{
statusl
[
1
].
value
}}
</div>
</el-col>
</el-row>
<el-row
v-for=
"(item, i) in long"
class=
"text"
:gutter=
"24"
>
<el-row
v-for=
"(item, i) in long"
:key=
"i"
class=
"text"
:gutter=
"24"
>
<el-col
:span=
"10"
>
<div
class=
"item_name"
>
距(
{{
form
.
baseInfo
.
leakyCableDescribe
}}
方向)
{{
...
...
@@ -285,9 +285,11 @@
</div>
</el-col>
<el-col
:span=
"6"
>
<el-button
class=
"picbtn"
type=
"success"
size=
"mini"
>
生成图形
</el-button
>
<el-button
class=
"picbtn"
type=
"success"
size=
"mini"
>
生成图形
</el-button>
</el-col>
</el-row>
</div>
...
...
@@ -298,110 +300,103 @@
</
template
>
<
script
>
import
{
DetailMixins
}
from
"./mixins"
;
import
{
leakyCableOpen
}
from
"../api"
;
import
{
DetailMixins
}
from
'./mixins'
import
{
leakyCableOpen
}
from
'../api'
export
default
{
mixins
:
[
DetailMixins
],
data
()
{
return
{
colspan
:
14
,
acolor
:
{
color
:
""
color
:
''
},
leakyList
:
[],
timeStatus
:
{},
zhubobi
:
[],
long
:
[],
statusl
:
[]
};
}
},
computed
:
{
statusAlarmfun
()
{
return
this
.
form
.
status
||
[]
}
},
watch
:
{
statusAlarmfun
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
trans
()
this
.
$nextTick
(
function
()
{
this
.
leakylevelcolor
()
})
}
}
},
deep
:
true
},
mixins
:
[
DetailMixins
],
methods
:
{
savebtn
()
{
this
.
flag
=
true
;
le
t
params
=
{
this
.
flag
=
true
cons
t
params
=
{
id
:
this
.
form
.
baseInfo
.
id
,
isOpen
:
this
.
form
.
baseInfo
.
isOpen
,
hundredMetersLoss
:
this
.
form
.
baseInfo
.
hundredMetersLoss
}
leakyCableOpen
(
params
).
then
((
res
)
=>
{
this
.
$message
.
success
(
"修改成功"
);
})
;
this
.
$message
.
success
(
'修改成功'
)
})
},
leakylevelcolor
()
{
if
(
this
.
timeStatus
.
level
==
'正常'
)
{
if
(
this
.
timeStatus
.
level
==
=
'正常'
)
{
this
.
acolor
.
color
=
'green'
}
else
if
(
this
.
timeStatus
.
level
==
'紧急'
)
{
}
else
if
(
this
.
timeStatus
.
level
==
=
'紧急'
)
{
this
.
acolor
.
color
=
'#f00'
this
.
timeStatus
.
level
=
'紧急告警'
}
else
if
(
this
.
timeStatus
.
level
==
'重要'
)
{
}
else
if
(
this
.
timeStatus
.
level
==
=
'重要'
)
{
this
.
acolor
.
color
=
'#f89850'
this
.
timeStatus
.
level
=
'重要告警'
}
else
if
(
this
.
timeStatus
.
level
==
'一般'
)
{
}
else
if
(
this
.
timeStatus
.
level
==
=
'一般'
)
{
this
.
acolor
.
color
=
'#ead906'
this
.
timeStatus
.
level
=
'一般告警'
}
},
toalarm
()
{
this
.
$router
.
push
({
path
:
"/alarm/cableTime"
,
path
:
'/alarm/cableTime'
,
query
:
{
alarmTargetName
:
this
.
form
.
baseInfo
.
leakyCableDescribe
}
,
})
;
}
})
},
trans
()
{
let
arr1
=
[],
arr2
=
[],
arr3
=
[]
if
(
this
.
statusAlarmfun
.
length
!=
0
)
{
const
arr1
=
[];
const
arr2
=
[];
const
arr3
=
[]
if
(
this
.
statusAlarmfun
.
length
!==
0
)
{
for
(
let
i
=
0
;
i
<
this
.
statusAlarmfun
.
length
;
i
++
)
{
if
(
i
%
2
!=
0
)
{
if
(
this
.
statusAlarmfun
[
i
].
name
==
'最后更新时间'
)
{
if
(
i
%
2
!=
=
0
)
{
if
(
this
.
statusAlarmfun
[
i
].
name
==
=
'最后更新时间'
)
{
arr1
.
push
(
this
.
statusAlarmfun
[
i
])
}
else
{
arr2
.
push
(
this
.
statusAlarmfun
[
i
])
}
}
else
{
if
(
this
.
statusAlarmfun
[
i
].
name
==
'漏缆状态'
)
{
if
(
this
.
statusAlarmfun
[
i
].
name
==
=
'漏缆状态'
)
{
arr1
.
push
(
this
.
statusAlarmfun
[
i
])
}
else
{
arr3
.
push
(
this
.
statusAlarmfun
[
i
])
}
}
}
this
.
statusl
=
arr1
this
.
zhubobi
=
arr2
this
.
long
=
arr3
}
},
},
computed
:
{
statusAlarmfun
()
{
if
(
this
.
form
.
status
)
{
return
this
.
form
.
status
;
}
},
},
watch
:
{
statusAlarmfun
:
{
immediate
:
true
,
handler
(
newV
)
{
if
(
newV
)
{
this
.
trans
();
this
.
$nextTick
(
function
()
{
this
.
leakylevelcolor
();
});
}
},
},
deep
:
true
,
},
mounted
()
{
},
};
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/history/deviceLinkRepair/index.vue
View file @
aacebaea
...
...
@@ -2,19 +2,17 @@
<div
class=
"leakage-cable"
>
<!-- 设备连接维修历史 -->
<div
class=
"leakage-top"
>
<div
style=
"color: #666666"
></div
>
<div
style=
"color: #666666"
key=
""
/
>
<div
class=
"operate-btn"
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"toDelete"
>
删除
</delids
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"toDelete"
>
删除
</delids>
<el-button
type=
"primary"
@
click=
"refresh"
>
刷新
</el-button>
<el-button
type=
"primary"
@
click=
"isQuery = !isQuery"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"toExport"
>
导出
</el-button>
<el-button
type=
"primary
"
@
click=
"delAll"
>
清空数据
</el-button>
<el-button
:type=
"isPermit==false ? 'primary' : 'info'"
:disabled=
"isPermit
"
@
click=
"delAll"
>
清空数据
</el-button>
</div>
</div>
<div
v-if=
"isQuery"
>
<search
@
search=
"search"
ref=
"reset
"
/>
<search
ref=
"reset"
@
search=
"search
"
/>
</div>
<el-table
:data=
"tableData"
...
...
@@ -34,16 +32,13 @@
label=
"连接状态"
width=
"150"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"endPointDeviceName"
label=
"网元设备"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"userName"
label=
"维修人员信息"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"userName"
label=
"维修人员信息"
align=
"center"
/>
<el-table-column
prop=
"connectAlarmMaintainTime"
label=
"连接告警维修时间"
...
...
@@ -63,82 +58,96 @@
import
{
ConnectMaintainList
,
ConnectMaintainDelete
,
ConnectMaintainDeleteAll
,
}
from
"../api"
;
import
{
ConnectStatusEnum
}
from
"@/const/index"
;
import
search
from
"./components/search.vue"
;
import
download
from
"@/utils/download"
;
import
{
exportConnectMaintainHistory
}
from
"@/api/export"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
ConnectMaintainDeleteAll
}
from
'../api'
import
{
ConnectStatusEnum
}
from
'@/const/index'
import
search
from
'./components/search.vue'
import
download
from
'@/utils/download'
import
{
exportConnectMaintainHistory
}
from
'@/api/export'
import
{
successAlert
,
warningAlert
}
from
'@/utils/alert'
import
{
mapState
}
from
'vuex'
export
default
{
components
:
{
search
},
data
()
{
return
{
multipleSelection
:
[],
ConnectStatusEnum
,
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
total
:
14
,
tableData
:
[],
isQuery
:
false
,
istrue
:
0
,
searchOption
:
{},
exids
:
[]
,
}
;
exids
:
[]
}
},
components
:
{
search
,
computed
:
{
...
mapState
(
'user'
,
[
'userBaseInfo'
]),
isPermit
()
{
if
(
this
.
userBaseInfo
.
userId
===
1
)
{
return
false
}
else
{
return
true
}
}
},
mounted
()
{
this
.
getTableData
()
},
methods
:
{
handleSelectionChange
(
val
)
{
let
deleteIds
=
val
.
map
((
item
)
=>
item
.
id
)
;
this
.
multipleSelection
=
deleteIds
;
let
deleteIds
=
val
.
map
((
item
)
=>
item
.
id
)
this
.
multipleSelection
=
deleteIds
},
handlePageChange
(
pageData
)
{
this
.
params
.
size
=
pageData
.
size
;
this
.
params
.
current
=
pageData
.
page
;
this
.
getTableData
()
;
this
.
params
.
size
=
pageData
.
size
this
.
params
.
current
=
pageData
.
page
this
.
getTableData
()
},
refresh
()
{
this
.
$refs
.
reset
!=
undefined
this
.
$refs
.
reset
!=
=
undefined
?
this
.
$refs
.
reset
.
reset
()
:
this
.
getTableData
()
;
:
this
.
getTableData
()
},
search
(
option
)
{
this
.
istrue
=
1
;
this
.
searchOption
=
option
;
this
.
getTableData
()
;
this
.
istrue
=
1
this
.
searchOption
=
option
this
.
getTableData
()
},
getTableData
()
{
let
params
=
{
...
this
.
params
,
...
this
.
searchOption
,
}
;
...
this
.
searchOption
}
ConnectMaintainList
(
params
).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[]
;
let
list
=
res
.
records
||
[]
list
.
forEach
((
item
)
=>
{
item
.
pointConnectStatus_text
=
this
.
ConnectStatusEnum
[
item
.
pointConnectStatus
]
;
})
;
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
)
;
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
!=
0
)
{
successAlert
(
"操作成功"
);
this
.
ConnectStatusEnum
[
item
.
pointConnectStatus
]
})
this
.
tableData
=
list
this
.
total
=
res
.
total
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
)
if
(
this
.
istrue
==
=
1
)
{
if
(
this
.
tableData
.
length
!=
=
0
)
{
successAlert
(
'操作成功'
)
}
else
{
warningAlert
(
"查询结果为空"
);
warningAlert
(
'查询结果为空'
)
}
this
.
istrue
=
0
;
this
.
istrue
=
0
}
})
;
})
},
toDelete
()
{
ConnectMaintainDelete
({
ids
:
this
.
multipleSelection
}).
then
((
res
)
=>
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
getTableData
()
;
})
;
this
.
$message
.
success
(
'删除成功!'
)
this
.
getTableData
()
})
},
delAll
()
{
this
.
$confirm
(
'继续操作将永久删除, 是否继续?'
,
'提示'
,
{
...
...
@@ -147,46 +156,41 @@ export default {
type
:
'warning'
}).
then
(()
=>
{
ConnectMaintainDeleteAll
().
then
((
res
)
=>
{
this
.
$message
.
success
(
"清空成功!"
);
this
.
getTableData
();
});
this
.
$message
.
success
(
'清空成功!'
)
this
.
getTableData
()
})
}).
catch
(()
=>
{
warningAlert
(
"取消删除"
)
});
warningAlert
(
'取消删除'
)
})
},
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
pointConnectStatus_text
==
"连接异常"
&&
column
.
label
==
"连接状态"
row
.
pointConnectStatus_text
==
=
'连接异常'
&&
column
.
label
==
=
'连接状态'
)
{
return
"emergency"
;
return
'emergency'
}
else
if
(
row
.
pointConnectStatus_text
==
"连接正常"
&&
column
.
label
==
"连接状态"
row
.
pointConnectStatus_text
==
=
'连接正常'
&&
column
.
label
==
=
'连接状态'
)
{
return
"normal"
;
return
'normal'
}
if
(
rowIndex
%
2
==
1
)
{
return
"stripe"
;
if
(
rowIndex
%
2
==
=
1
)
{
return
'stripe'
}
},
toExport
()
{
if
(
this
.
exids
.
length
==
0
)
{
this
.
$message
.
warning
(
"暂无数据"
);
return
false
;
if
(
this
.
exids
.
length
==
=
0
)
{
this
.
$message
.
warning
(
'暂无数据'
)
return
false
}
else
{
exportConnectMaintainHistory
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`设备连接维修历史.xls`
);
})
;
download
(
res
,
'vnd.ms-excel'
,
`设备连接维修历史.xls`
)
})
}
},
},
mounted
()
{
this
.
getTableData
();
},
};
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.leakage-cable
{
...
...
@@ -204,13 +208,13 @@ export default {
background-color
:
#eaf1fe
;
}
&
:
:
v-deep
.
emergency
{
background-color
:
#f00
;
background-color
:
#f00
!
important
;
}
&
:
:
v-deep
.
important
{
background-color
:
#f89850
;
background-color
:
#f89850
!
important
;
}
&
:
:
v-deep
.
normal
{
background-color
:
green
;
background-color
:
green
!
important
;
}
.page
{
...
...
src/views/history/deviceLinkStatus/index.vue
View file @
aacebaea
...
...
@@ -2,23 +2,22 @@
<div
class=
"leakage-cable"
>
<!-- 设备连接状态 -->
<div
class=
"leakage-top"
>
<div
style=
"color: #666666"
></div
>
<div
style=
"color: #666666"
/
>
<div
class=
"operate-btn"
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"toDelete"
>
删除
</delids
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"toDelete"
>
删除
</delids>
<el-button
type=
"primary"
@
click=
"refresh"
>
刷新
</el-button>
<el-button
type=
"primary"
@
click=
"isQuery = !isQuery"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"toExport"
>
导出
</el-button>
<el-button
type=
"primary
"
@
click=
"delAll"
>
清空数据
</el-button>
<el-button
:type=
"isPermit==false ? 'primary' : 'info'"
:disabled=
"isPermit
"
@
click=
"delAll"
>
清空数据
</el-button>
</div>
</div>
<div
v-if=
"isQuery"
>
<search
@
search=
"search"
ref=
"reset
"
/>
<search
ref=
"reset"
@
search=
"search
"
/>
</div>
<el-table
:data=
"tableData"
style=
"width: 100%"
height=
"calc(88vh - 150px)"
:cell-class-name=
"cellClassFn"
:header-cell-style=
"
{ background: '#EAF1FE', color: '#666666' }"
@selection-change="handleSelectionChange"
...
...
@@ -34,14 +33,12 @@
label=
"连接状态"
width=
"150"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"endPointDeviceName"
label=
"网元设备"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"uploadTime"
label=
"上传时间"
align=
"center"
/>
<el-table-column
prop=
"cancelTime"
label=
"取消时间"
align=
"center"
/>
<el-table-column
...
...
@@ -63,14 +60,19 @@
import
{
ConnectStatusList
,
ConnectStatusDelete
,
ConnectStatusDeleteAll
,
}
from
"../api"
;
import
{
ConnectStatusEnum
}
from
"@/const/index"
;
import
search
from
"./components/search.vue"
;
import
{
exportConnectStatusHistory
}
from
"@/api/export"
;
import
download
from
"@/utils/download"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
ConnectStatusDeleteAll
}
from
'../api'
import
{
ConnectStatusEnum
}
from
'@/const/index'
import
search
from
'./components/search.vue'
import
{
exportConnectStatusHistory
}
from
'@/api/export'
import
download
from
'@/utils/download'
import
{
successAlert
,
warningAlert
}
from
'@/utils/alert'
import
{
mapState
}
from
'vuex'
export
default
{
components
:
{
search
},
props
:
[],
data
()
{
return
{
...
...
@@ -78,68 +80,78 @@ export default {
ConnectStatusEnum
,
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
total
:
10
,
tableData
:
[],
isQuery
:
false
,
istrue
:
0
,
searchOption
:
{},
exids
:
[]
,
}
;
exids
:
[]
}
},
components
:
{
search
,
computed
:
{
...
mapState
(
'user'
,
[
'userBaseInfo'
]),
isPermit
()
{
if
(
this
.
userBaseInfo
.
userId
===
1
)
{
return
false
}
else
{
return
true
}
}
},
mounted
()
{
this
.
getTableData
()
},
methods
:
{
handleSelectionChange
(
val
)
{
let
deleteIds
=
val
.
map
((
item
)
=>
item
.
id
)
;
this
.
multipleSelection
=
deleteIds
;
let
deleteIds
=
val
.
map
((
item
)
=>
item
.
id
)
this
.
multipleSelection
=
deleteIds
},
handlePageChange
(
pageData
)
{
this
.
params
.
size
=
pageData
.
size
;
this
.
params
.
current
=
pageData
.
page
;
this
.
getTableData
()
;
this
.
params
.
size
=
pageData
.
size
this
.
params
.
current
=
pageData
.
page
this
.
getTableData
()
},
refresh
()
{
this
.
$refs
.
reset
!=
undefined
this
.
$refs
.
reset
!=
=
undefined
?
this
.
$refs
.
reset
.
reset
()
:
this
.
getTableData
()
;
:
this
.
getTableData
()
},
search
(
option
)
{
this
.
istrue
=
1
;
this
.
searchOption
=
option
;
this
.
getTableData
()
;
this
.
istrue
=
1
this
.
searchOption
=
option
this
.
getTableData
()
},
getTableData
()
{
let
params
=
{
...
this
.
params
,
...
this
.
searchOption
,
}
;
...
this
.
searchOption
}
ConnectStatusList
(
params
).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[]
;
let
list
=
res
.
records
||
[]
list
.
forEach
((
item
)
=>
{
item
.
pointConnectStatus_text
=
this
.
ConnectStatusEnum
[
item
.
pointConnectStatus
]
;
})
;
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
)
;
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
!=
0
)
{
successAlert
(
"操作成功"
);
this
.
ConnectStatusEnum
[
item
.
pointConnectStatus
]
})
this
.
tableData
=
list
this
.
total
=
res
.
total
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
)
if
(
this
.
istrue
==
=
1
)
{
if
(
this
.
tableData
.
length
!=
=
0
)
{
successAlert
(
'操作成功'
)
}
else
{
warningAlert
(
"查询结果为空"
);
warningAlert
(
'查询结果为空'
)
}
this
.
istrue
=
0
;
this
.
istrue
=
0
}
})
;
})
},
toDelete
()
{
ConnectStatusDelete
({
ids
:
this
.
multipleSelection
}).
then
((
res
)
=>
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
getTableData
()
;
})
;
this
.
$message
.
success
(
'删除成功!'
)
this
.
getTableData
()
})
},
delAll
()
{
this
.
$confirm
(
'继续操作将永久删除, 是否继续?'
,
'提示'
,
{
...
...
@@ -147,46 +159,42 @@ export default {
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
ConnectStatusDeleteAll
().
then
((
res
)
=>
{
this
.
$message
.
success
(
"清空成功!"
);
this
.
getTableData
();
});
ConnectStatusDeleteAll
().
then
((
res
)
=>
{
this
.
$message
.
success
(
'清空成功!'
)
this
.
getTableData
()
})
}).
catch
(()
=>
{
warningAlert
(
"取消删除"
)
});
warningAlert
(
'取消删除'
)
})
},
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
pointConnectStatus_text
==
"连接异常"
&&
column
.
label
==
"连接状态"
row
.
pointConnectStatus_text
==
=
'连接异常'
&&
column
.
label
==
=
'连接状态'
)
{
return
"emergency"
;
return
'emergency'
}
else
if
(
row
.
pointConnectStatus_text
==
"连接正常"
&&
column
.
label
==
"连接状态"
row
.
pointConnectStatus_text
==
=
'连接正常'
&&
column
.
label
==
=
'连接状态'
)
{
return
"normal"
;
return
'normal'
}
if
(
rowIndex
%
2
==
1
)
{
return
"stripe"
;
if
(
rowIndex
%
2
==
=
1
)
{
return
'stripe'
}
},
toExport
()
{
if
(
this
.
exids
.
length
==
0
)
{
this
.
$message
.
warning
(
"暂无数据"
);
return
false
;
if
(
this
.
exids
.
length
==
=
0
)
{
this
.
$message
.
warning
(
'暂无数据'
)
return
false
}
else
{
exportConnectStatusHistory
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`设备连接历史状态.xls`
);
})
;
download
(
res
,
'vnd.ms-excel'
,
`设备连接历史状态.xls`
)
})
}
},
},
mounted
()
{
this
.
getTableData
();
},
};
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.leakage-cable
{
...
...
@@ -204,13 +212,13 @@ export default {
background-color
:
#eaf1fe
;
}
&
:
:
v-deep
.
emergency
{
background-color
:
#f00
;
background-color
:
#f00
!
important
;
}
&
:
:
v-deep
.
important
{
background-color
:
#f89850
;
background-color
:
#f89850
!
important
;
}
&
:
:
v-deep
.
normal
{
background-color
:
green
;
background-color
:
green
!
important
;
}
.page
{
...
...
src/views/history/leakyCableRepair/index.vue
View file @
aacebaea
...
...
@@ -4,19 +4,18 @@
<div
class=
"leakage-top"
>
<div
style=
"color: #666666"
></div>
<div
class=
"operate-btn"
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"deleteCable"
>
删除
</delids
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"deleteCable"
>
删除
</delids>
<el-button
type=
"primary"
@
click=
"refresh"
>
刷新
</el-button>
<el-button
type=
"primary"
@
click=
"isQuery = !isQuery"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"toExport"
>
导出
</el-button>
</div>
</div>
<div
v-if=
"isQuery"
>
<search
@
search=
"search"
ref=
"reset
"
/>
<search
ref=
"reset"
@
search=
"search
"
/>
</div>
<el-table
:data=
"tableData"
height=
"calc(88vh - 150px)"
style=
"width: 100%"
:cell-class-name=
"cellClassFn"
:header-cell-style=
"
{ background: '#EAF1FE', color: '#666666' }"
...
...
@@ -41,10 +40,8 @@
label=
"告警级别"
width=
"150"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"alarmInfo"
label=
"告警信息"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"alarmInfo"
label=
"告警信息"
align=
"center"
/>
<el-table-column
prop=
"alarmMaintainTime"
label=
"告警维修时间"
...
...
@@ -61,104 +58,104 @@
</div>
</
template
>
<
script
>
import
{
MonitorMaintainList
,
MonitorMaintainDelete
}
from
"../api"
;
import
search
from
"./components/search.vue"
;
import
download
from
"@/utils/download"
;
import
{
exportLeakyMaintainHistory
}
from
"@/api/export"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
import
{
MonitorMaintainList
,
MonitorMaintainDelete
}
from
'../api'
import
search
from
'./components/search.vue'
import
download
from
'@/utils/download'
import
{
exportLeakyMaintainHistory
}
from
'@/api/export'
import
{
successAlert
,
warningAlert
}
from
'@/utils/alert'
export
default
{
components
:
{
search
},
props
:
[],
data
()
{
return
{
multipleSelection
:
[],
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
total
:
10
,
tableData
:
[],
isQuery
:
false
,
istrue
:
0
,
istrue
:
0
,
searchOption
:
{},
exids
:
[]
,
}
;
exids
:
[]
}
},
components
:
{
search
,
mounted
()
{
this
.
getTableData
()
},
methods
:
{
handleSelectionChange
(
val
)
{
let
deleteIds
=
val
.
map
((
item
)
=>
item
.
id
)
;
this
.
multipleSelection
=
deleteIds
;
let
deleteIds
=
val
.
map
((
item
)
=>
item
.
id
)
this
.
multipleSelection
=
deleteIds
},
handlePageChange
(
pageData
)
{
this
.
params
.
size
=
pageData
.
size
;
this
.
params
.
current
=
pageData
.
page
;
this
.
getTableData
()
;
this
.
params
.
size
=
pageData
.
size
this
.
params
.
current
=
pageData
.
page
this
.
getTableData
()
},
refresh
()
{
this
.
$refs
.
reset
!=
undefined
this
.
$refs
.
reset
!=
=
undefined
?
this
.
$refs
.
reset
.
reset
()
:
this
.
getTableData
()
;
:
this
.
getTableData
()
},
search
(
option
){
this
.
istrue
=
1
search
(
option
)
{
this
.
istrue
=
1
this
.
searchOption
=
option
this
.
getTableData
()
},
getTableData
()
{
let
params
=
{
...
this
.
params
,
...
this
.
searchOption
,
}
;
...
this
.
searchOption
}
MonitorMaintainList
(
params
).
then
((
res
)
=>
{
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
)
{
successAlert
(
"操作成功"
);
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
)
{
successAlert
(
'操作成功'
)
}
else
{
warningAlert
(
"查询结果为空"
);
warningAlert
(
'查询结果为空'
)
}
this
.
istrue
=
0
this
.
istrue
=
0
}
})
;
})
},
deleteCable
()
{
MonitorMaintainDelete
({
ids
:
this
.
multipleSelection
}).
then
((
res
)
=>
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
getTableData
()
;
})
;
this
.
$message
.
success
(
'删除成功!'
)
this
.
getTableData
()
})
},
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
alarmLevelName
==
"紧急"
&&
column
.
label
==
"告警级别"
)
{
return
"emergency"
;
}
else
if
(
row
.
alarmLevelName
==
"重要"
&&
column
.
label
==
"告警级别"
)
{
return
"important"
;
}
else
if
(
row
.
alarmLevelName
==
"一般"
&&
column
.
label
==
"告警级别"
)
{
return
"common"
;
if
(
row
.
alarmLevelName
==
=
'紧急'
&&
column
.
label
===
'告警级别'
)
{
return
'emergency'
}
else
if
(
row
.
alarmLevelName
==
=
'重要'
&&
column
.
label
===
'告警级别'
)
{
return
'important'
}
else
if
(
row
.
alarmLevelName
==
=
'一般'
&&
column
.
label
===
'告警级别'
)
{
return
'common'
}
if
(
rowIndex
%
2
==
1
)
{
return
"stripe"
;
if
(
rowIndex
%
2
==
=
1
)
{
return
'stripe'
}
},
toExport
()
{
if
(
this
.
exids
.
length
==
0
)
{
this
.
$message
.
warning
(
"暂无数据"
);
return
false
;
if
(
this
.
exids
.
length
==
=
0
)
{
this
.
$message
.
warning
(
'暂无数据'
)
return
false
}
else
{
exportLeakyMaintainHistory
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`漏缆监测维修历史.xls`
);
})
;
download
(
res
,
'vnd.ms-excel'
,
`漏缆监测维修历史.xls`
)
})
}
},
},
mounted
()
{
this
.
getTableData
();
},
};
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.leakage-cable
{
...
...
src/views/login/index.vue
View file @
aacebaea
...
...
@@ -69,109 +69,101 @@
class=
"loginbtn"
style=
"width: 100%; margin-top: 30px; margin-bottom: 30px"
@
click
.
native
.
prevent=
"handleLogin"
>
登录
</el-button
>
>
登录
</el-button>
</el-form>
</div>
</div>
</
template
>
<
script
>
import
{
login
}
from
"@/api/user"
;
import
{
setToken
,
setUserName
}
from
"@/utils/auth"
;
import
EventBus
from
"@/utils/bus"
;
import
{
login
}
from
'@/api/user'
import
{
setToken
,
setUserName
}
from
'@/utils/auth'
export
default
{
name
:
"Login"
,
name
:
'Login'
,
data
()
{
const
validatePassword
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
length
<
6
)
{
callback
(
new
Error
(
"密码不能少于6位"
));
callback
(
new
Error
(
'密码不能少于6位'
))
}
else
{
callback
();
callback
()
}
}
};
return
{
loginForm
:
{
username
:
""
,
password
:
""
,
username
:
''
,
password
:
''
},
loginRules
:
{
username
:
[
{
required
:
true
,
trigger
:
"blur"
,
message
:
"请输入用户名"
},
{
required
:
true
,
trigger
:
'blur'
,
message
:
'请输入用户名'
}
],
password
:
[
{
required
:
true
,
trigger
:
"blur"
,
validator
:
validatePassword
},
]
,
{
required
:
true
,
trigger
:
'blur'
,
validator
:
validatePassword
}
]
},
loading
:
false
,
passwordType
:
"password"
,
redirect
:
undefined
,
}
;
passwordType
:
'password'
,
redirect
:
undefined
}
},
watch
:
{
$route
:
{
handler
:
function
(
route
)
{
this
.
redirect
=
route
.
query
&&
route
.
query
.
redirect
;
},
immediate
:
true
,
handler
:
function
(
route
)
{
this
.
redirect
=
route
.
query
&&
route
.
query
.
redirect
},
immediate
:
true
}
},
created
()
{
var
that
=
this
;
document
.
onkeydown
=
function
(
e
)
{
var
key
=
window
.
event
.
keyCode
;
if
(
key
==
13
)
{
that
.
handleLogin
();
var
that
=
this
document
.
onkeydown
=
function
(
e
)
{
var
key
=
window
.
event
.
keyCode
if
(
key
===
13
)
{
that
.
handleLogin
()
}
}
};
},
methods
:
{
showPwd
()
{
if
(
this
.
passwordType
===
"password"
)
{
this
.
passwordType
=
""
;
if
(
this
.
passwordType
===
'password'
)
{
this
.
passwordType
=
''
}
else
{
this
.
passwordType
=
"password"
;
this
.
passwordType
=
'password'
}
this
.
$nextTick
(()
=>
{
this
.
$refs
.
password
.
focus
()
;
})
;
this
.
$refs
.
password
.
focus
()
})
},
async
toLogin
()
{
const
{
username
,
password
}
=
this
.
loginForm
;
let
{
token
}
=
await
login
(
const
{
username
,
password
}
=
this
.
loginForm
const
{
token
,
userId
}
=
await
login
(
{
userName
:
username
,
password
:
password
,
password
:
password
},
{
el
:
".el-button"
,
el
:
'.el-button'
}
);
if
(
!
token
)
return
;
this
.
$store
.
commit
(
"user/SET_TOKEN"
,
token
);
setToken
(
token
);
this
.
$router
.
push
({
path
:
"/"
});
// setTimeout(() => {
// location.reload()
// }, 10)
)
if
(
!
token
)
return
this
.
$store
.
commit
(
'user/SET_TOKEN'
,
token
)
this
.
$store
.
commit
(
'user/SET_USERID'
,
userId
)
setToken
(
token
)
this
.
$router
.
push
({
path
:
'/'
})
},
handleLogin
()
{
this
.
$refs
.
loginForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
setUserName
(
this
.
loginForm
.
username
);
this
.
toLogin
();
// EventBus.$emit('wsOpen')
setUserName
(
this
.
loginForm
.
username
)
this
.
toLogin
()
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
return
false
}
})
;
}
,
}
,
}
;
})
}
}
}
</
script
>
<
style
lang=
"scss"
>
...
...
src/views/monitor/equipment/index.vue
View file @
aacebaea
...
...
@@ -10,7 +10,7 @@
</div>
</div>
<div
v-if=
"isQuery"
>
<search
@
search=
"search"
ref=
"reset
"
/>
<search
ref=
"reset"
@
search=
"search
"
/>
</div>
<el-table
:data=
"tableData"
...
...
@@ -56,116 +56,116 @@
</
template
>
<
script
>
import
{
DeviceStatusList
}
from
"../api"
;
import
{
ConnectStatusEnum
}
from
"@/const/index"
;
import
search
from
"./components/search.vue"
;
import
download
from
"@/utils/download"
;
import
{
exportConnetTime
}
from
"@/api/export"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
import
{
DeviceStatusList
}
from
'../api'
import
{
ConnectStatusEnum
}
from
'@/const/index'
import
search
from
'./components/search.vue'
import
download
from
'@/utils/download'
import
{
exportConnetTime
}
from
'@/api/export'
import
{
successAlert
,
warningAlert
}
from
'@/utils/alert'
export
default
{
components
:
{
search
},
data
()
{
return
{
ConnectStatusEnum
,
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
total
:
10
,
tableData
:
[],
isQuery
:
false
,
istrue
:
0
,
istrue
:
0
,
searchOption
:
{},
exids
:
[],
};
exids
:
[]
}
},
mounted
()
{
this
.
getTableData
()
},
components
:
{
search
},
methods
:
{
// 表格背景图颜色
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
startPointConnectStatus_text
==
"连接正常"
&&
column
.
property
==
"startPointConnectStatus_text"
row
.
startPointConnectStatus_text
==
=
'连接正常'
&&
column
.
property
==
=
'startPointConnectStatus_text'
)
{
return
"green"
;
return
'green'
}
if
(
row
.
startPointConnectStatus_text
==
"连接异常"
&&
column
.
property
==
"startPointConnectStatus_text"
row
.
startPointConnectStatus_text
==
=
'连接异常'
&&
column
.
property
==
=
'startPointConnectStatus_text'
)
{
return
"red"
;
return
'red'
}
if
(
row
.
endPointConnectStatus_text
==
"连接正常"
&&
column
.
property
==
"endPointConnectStatus_text"
row
.
endPointConnectStatus_text
==
=
'连接正常'
&&
column
.
property
==
=
'endPointConnectStatus_text'
)
{
return
"green"
;
return
'green'
}
else
if
(
row
.
endPointConnectStatus_text
==
"连接异常"
&&
column
.
property
==
"endPointConnectStatus_text"
row
.
endPointConnectStatus_text
==
=
'连接异常'
&&
column
.
property
==
=
'endPointConnectStatus_text'
)
{
return
"red"
;
return
'red'
}
if
(
rowIndex
%
2
==
1
)
{
return
"stripe"
;
if
(
rowIndex
%
2
==
=
1
)
{
return
'stripe'
}
},
refresh
()
{
this
.
$refs
.
reset
!=
undefined
this
.
$refs
.
reset
!=
=
undefined
?
this
.
$refs
.
reset
.
reset
()
:
this
.
getTableData
()
;
:
this
.
getTableData
()
},
handlePageChange
(
pageData
)
{
this
.
params
.
size
=
pageData
.
size
;
this
.
params
.
current
=
pageData
.
page
;
this
.
getTableData
()
;
this
.
params
.
size
=
pageData
.
size
this
.
params
.
current
=
pageData
.
page
this
.
getTableData
()
},
search
(
option
)
{
this
.
istrue
=
1
this
.
searchOption
=
option
;
this
.
getTableData
()
;
this
.
istrue
=
1
this
.
searchOption
=
option
this
.
getTableData
()
},
getTableData
()
{
let
params
=
{
...
this
.
params
,
...
this
.
searchOption
,
}
;
...
this
.
searchOption
}
DeviceStatusList
(
params
).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[]
;
let
list
=
res
.
records
||
[]
list
.
forEach
((
item
)
=>
{
item
.
startPointConnectStatus_text
=
this
.
ConnectStatusEnum
[
item
.
startPointConnectStatus
]
;
this
.
ConnectStatusEnum
[
item
.
startPointConnectStatus
]
item
.
endPointConnectStatus_text
=
this
.
ConnectStatusEnum
[
item
.
endPointConnectStatus
]
;
})
;
this
.
tableData
=
list
;
this
.
total
=
res
.
total
;
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
)
;
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
!
=
0
)
{
successAlert
(
"操作成功"
);
this
.
ConnectStatusEnum
[
item
.
endPointConnectStatus
]
})
this
.
tableData
=
list
this
.
total
=
res
.
total
this
.
exids
=
list
.
map
((
i
)
=>
i
.
id
)
if
(
this
.
istrue
===
1
)
{
if
(
this
.
tableData
.
length
!=
=
0
)
{
successAlert
(
'操作成功'
)
}
else
{
warningAlert
(
"查询结果为空"
);
warningAlert
(
'查询结果为空'
)
}
this
.
istrue
=
0
this
.
istrue
=
0
}
})
;
})
},
toExport
()
{
if
(
this
.
exids
.
length
==
0
)
{
this
.
$message
.
warning
(
"暂无数据"
);
return
false
;
if
(
this
.
exids
.
length
==
=
0
)
{
this
.
$message
.
warning
(
'暂无数据'
)
return
false
}
else
{
exportConnetTime
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`设备实时.xls`
);
})
;
download
(
res
,
'vnd.ms-excel'
,
`设备实时.xls`
)
})
}
},
},
mounted
()
{
this
.
getTableData
();
},
};
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -183,10 +183,10 @@ export default {
background-color
:
#eaf1fe
;
}
&
:
:
v-deep
.
red
{
background-color
:
#f00
;
background-color
:
#f00
!
important
;
}
&
:
:
v-deep
.
green
{
background-color
:
green
;
background-color
:
green
!
important
;
}
.page
{
display
:
flex
;
...
...
src/views/monitor/leakageCable/index.vue
View file @
aacebaea
...
...
@@ -15,6 +15,7 @@
<el-table
:data=
"tableData"
style=
"width: 100%"
height=
"calc(88vh - 150px)"
:cell-class-name=
"cellClassFn"
:header-cell-style=
"
{ background: '#EAF1FE', color: '#666666' }"
>
...
...
@@ -36,8 +37,7 @@
label=
"告警级别"
width=
"150"
align=
"center"
>
</el-table-column>
/>
<el-table-column
prop=
"alarmInfo"
label=
"告警信息"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div
v-for=
"(item, index) in scope.row.alarmInfo"
:key=
"index"
:class=
"levelStyle[item.level]"
>
...
...
@@ -64,103 +64,103 @@
</template>
<
script
>
import
{
CableStatusList
}
from
"../api"
;
import
{
ConnectStatusEnum
,
levelStyle
}
from
"@/const/index"
;
import
search
from
"./components/search.vue"
;
import
{
exportLeakyCableTime
}
from
"@/api/export"
;
import
download
from
"@/utils/download"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
import
{
CableStatusList
}
from
'../api'
import
{
ConnectStatusEnum
,
levelStyle
}
from
'@/const/index'
import
search
from
'./components/search.vue'
import
{
exportLeakyCableTime
}
from
'@/api/export'
import
download
from
'@/utils/download'
import
{
successAlert
,
warningAlert
}
from
'@/utils/alert'
export
default
{
components
:
{
search
},
data
()
{
return
{
ConnectStatusEnum
,
levelStyle
,
params
:
{
curent
:
1
,
size
:
10
,
size
:
10
},
total
:
10
,
tableData
:
[],
isQuery
:
false
,
istrue
:
0
,
istrue
:
0
,
searchOption
:
{},
exids
:
[],
};
exids
:
[]
}
},
mounted
()
{
this
.
getTableData
();
},
components
:
{
search
},
methods
:
{
// 表格背景图颜色
cellClassFn
({
row
,
column
,
rowIndex
,
columnIndex
})
{
if
(
row
.
alarmLevelName
==
"紧急"
&&
column
.
label
==
"告警级别"
)
{
return
"emergency"
;
}
else
if
(
row
.
alarmLevelName
==
"重要"
&&
column
.
label
==
"告警级别"
)
{
return
"important"
;
}
else
if
(
row
.
alarmLevelName
==
"一般"
&&
column
.
label
==
"告警级别"
)
{
return
"common"
;
}
else
if
(
row
.
alarmLevelName
==
"正常"
&&
column
.
label
==
"告警级别"
)
{
return
"normal"
}
if
(
rowIndex
%
2
==
1
)
{
return
"stripe"
;
if
(
row
.
alarmLevelName
==
=
'紧急'
&&
column
.
label
===
'告警级别'
)
{
return
'emergency'
}
else
if
(
row
.
alarmLevelName
==
=
'重要'
&&
column
.
label
===
'告警级别'
)
{
return
'important'
}
else
if
(
row
.
alarmLevelName
==
=
'一般'
&&
column
.
label
===
'告警级别'
)
{
return
'common'
}
else
if
(
row
.
alarmLevelName
==
=
'正常'
&&
column
.
label
===
'告警级别'
)
{
return
'normal'
}
if
(
rowIndex
%
2
==
=
1
)
{
return
'stripe'
}
},
refresh
()
{
this
.
searchOption
=
{}
;
this
.
$refs
.
reset
!=
undefined
this
.
searchOption
=
{}
this
.
$refs
.
reset
!=
=
undefined
?
this
.
$refs
.
reset
.
reset
()
:
this
.
getTableData
()
;
:
this
.
getTableData
()
},
handlePageChange
(
pageData
)
{
this
.
params
.
size
=
pageData
.
size
this
.
params
.
curent
=
pageData
.
page
this
.
getTableData
()
;
this
.
getTableData
()
},
search
(
option
)
{
this
.
istrue
=
1
this
.
istrue
=
1
this
.
searchOption
=
option
this
.
getTableData
()
;
this
.
getTableData
()
},
getTableData
()
{
let
params
=
{
...
this
.
params
,
...
this
.
searchOption
,
}
;
}
CableStatusList
(
params
).
then
((
res
)
=>
{
let
list
=
res
.
records
||
[]
;
this
.
tableData
=
list
;
let
list
=
res
.
records
||
[]
this
.
tableData
=
list
list
.
forEach
(
item
=>
{
if
(
item
.
alarmInfo
!
=
''
&&
item
.
alarmInfo
!=
null
)
{
if
(
item
.
alarmInfo
!=
=
''
&&
item
.
alarmInfo
!=
null
)
{
item
.
alarmInfo
=
JSON
.
parse
(
item
.
alarmInfo
)
item
.
lossValue
=
eval
(
item
.
alarmInfo
.
map
(
k
=>
k
.
lossValue
).
join
(
'+'
))
}
})
;
this
.
total
=
res
.
records
.
length
;
this
.
exids
=
list
.
map
(
i
=>
i
.
id
)
;
if
(
this
.
istrue
==
1
)
{
if
(
this
.
tableData
.
length
!
=
0
)
{
successAlert
(
"操作成功"
);
})
this
.
total
=
res
.
records
.
length
this
.
exids
=
list
.
map
(
i
=>
i
.
id
)
if
(
this
.
istrue
===
1
)
{
if
(
this
.
tableData
.
length
!=
=
0
)
{
successAlert
(
'操作成功'
)
}
else
{
warningAlert
(
"查询结果为空"
);
warningAlert
(
'查询结果为空'
)
}
this
.
istrue
=
0
this
.
istrue
=
0
}
})
;
})
},
toExport
()
{
if
(
this
.
exids
.
length
==
0
)
{
this
.
$message
.
warning
(
"暂无数据"
);
return
false
;
if
(
this
.
exids
.
length
==
=
0
)
{
this
.
$message
.
warning
(
'暂无数据'
)
return
false
}
else
{
exportLeakyCableTime
({
ids
:
this
.
exids
}).
then
((
res
)
=>
{
download
(
res
,
"vnd.ms-excel"
,
`漏缆实时.xls`
);
})
;
download
(
res
,
'vnd.ms-excel'
,
`漏缆实时.xls`
)
})
}
},
},
mounted
()
{
this
.
getTableData
();
},
};
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -190,16 +190,16 @@ export default {
background-color
:
#eaf1fe
;
}
&
:
:
v-deep
.
emergency
{
background-color
:
#f00
;
background-color
:
#f00
!
important
;
}
&
:
:
v-deep
.
important
{
background-color
:
#f89850
;
background-color
:
#f89850
!
important
;
}
&
:
:
v-deep
.
common
{
background-color
:
#ead906
;
background-color
:
#ead906
!
important
;
}
&
:
:
v-deep
.
normal
{
background-color
:
green
;
background-color
:
green
!
important
;
}
.page
{
display
:
flex
;
...
...
src/views/setting/add/comp/FSU.vue
View file @
aacebaea
...
...
@@ -122,8 +122,6 @@
import
{
fsusave
,
selectFsuItem
,
selectForSite
,
railWaylist
}
from
"../../api"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
export
default
{
props
:
[],
components
:
{},
data
()
{
return
{
type
:
1
,
...
...
@@ -137,53 +135,63 @@ export default {
FSUForm
:
formInit
(),
params
:
{
current
:
1
,
size
:
10
,
size
:
10
},
rules
:
{
wayId
:
[{
required
:
true
,
message
:
"请选择铁路线"
,
trigger
:
"blur"
}],
siteId
:
[{
required
:
true
,
message
:
"请选择站点"
,
trigger
:
"blur"
}],
fsuCode
:
[
{
required
:
true
,
message
:
"请输入FSU身份编号"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入FSU身份编号"
,
trigger
:
"blur"
}
],
fsuPort
:
[
{
required
:
true
,
pattern
:
/^
(([^
0
][
0-9
]
+|0
)
$
)
|^
(([
1-9
]
+
)
$
)
/
,
message
:
"请输入FSU端口数"
,
trigger
:
"blur"
},
{
required
:
true
,
pattern
:
/^
(([^
0
][
0-9
]
+|0
)
$
)
|^
(([
1-9
]
+
)
$
)
/
,
message
:
"请输入FSU端口数"
,
trigger
:
"blur"
}
],
equipName
:
[
{
required
:
true
,
message
:
"请输入设备名称"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入设备名称"
,
trigger
:
"blur"
}
],
ip
:
[{
required
:
true
,
pattern
:
/^
(
1
\d{2}
|2
[
0-4
]\d
|25
[
0-5
]
|
[
1-9
]\d
|
[
1-9
])\.((
1
\d{2}
|2
[
0-4
]\d
|25
[
0-5
]
|
[
1-9
]\d
|
\d)\.){2}(
1
\d{2}
|2
[
0-4
]\d
|25
[
0-5
]
|
[
1-9
]\d
|
\d)
$/
,
message
:
"请输入正确的IP地址"
,
trigger
:
"blur"
}],
ip
:
[{
required
:
true
,
pattern
:
/^
(
1
\d{2}
|2
[
0-4
]\d
|25
[
0-5
]
|
[
1-9
]\d
|
[
1-9
])\.((
1
\d{2}
|2
[
0-4
]\d
|25
[
0-5
]
|
[
1-9
]\d
|
\d)\.){2}(
1
\d{2}
|2
[
0-4
]\d
|25
[
0-5
]
|
[
1-9
]\d
|
\d)
$/
,
message
:
"请输入正确的IP地址"
,
trigger
:
"blur"
}],
equipFactory
:
[
{
required
:
true
,
message
:
"请输入设备厂商"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入设备厂商"
,
trigger
:
"blur"
}
],
backupMode
:
[
{
required
:
true
,
message
:
"请选择设备备用方式"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请选择设备备用方式"
,
trigger
:
"blur"
}
],
connectMode
:
[
{
required
:
true
,
message
:
"请选择通信方式"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请选择通信方式"
,
trigger
:
"blur"
}
],
equipType
:
[
{
required
:
true
,
message
:
"请选择设备类型"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请选择设备类型"
,
trigger
:
"blur"
}
],
equipSubType
:
[
{
required
:
true
,
message
:
"请选择设备子类型"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请选择设备子类型"
,
trigger
:
"blur"
}
],
softVersion
:
[
{
required
:
true
,
message
:
"请输入软件版本号"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入软件版本号"
,
trigger
:
"blur"
}
],
equipSerialNumber
:
[
{
required
:
true
,
message
:
"请输入设备生产序列号"
,
trigger
:
"blur"
}
,
{
required
:
true
,
message
:
"请输入设备生产序列号"
,
trigger
:
"blur"
}
],
kmSign
:
[
{
required
:
true
,
message
:
"请输入设备所在铁路公里标"
,
trigger
:
"blur"
,
trigger
:
"blur"
}
]
}
}
},
],
created
()
{
selectFsuItem
().
then
((
res
)
=>
{
this
.
backupModeSelect
=
res
[
"01"
]
this
.
connectModeSelect
=
res
[
"02"
]
this
.
equipTypeSelect
=
res
[
"03"
]
this
.
equipSubTypeSelect
=
res
[
"04"
]
})
},
};
mounted
()
{
this
.
getAllWay
()
},
computed
:
{},
methods
:
{
changerailWay
()
{
selectForSite
({
wayId
:
this
.
FSUForm
.
wayId
}).
then
((
res
)
=>
{
...
...
@@ -192,55 +200,40 @@ export default {
},
readNodes
(
aaa
=
[],
arrarea
=
[])
{
for
(
let
item
of
aaa
)
{
arrarea
.
push
({
id
:
item
.
id
,
siteName
:
item
.
name
})
;
arrarea
.
push
({
id
:
item
.
id
,
siteName
:
item
.
name
})
if
(
item
.
children
)
{
this
.
readNodes
(
item
.
children
,
arrarea
)
;
this
.
readNodes
(
item
.
children
,
arrarea
)
}
}
return
arrarea
;
return
arrarea
},
reset
()
{
this
.
$refs
.
FSUForm
.
resetFields
()
;
this
.
$refs
.
FSUForm
.
resetFields
()
},
submit
()
{
this
.
$refs
.
FSUForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
FSUForm
.
parentId
=
this
.
FSUForm
.
siteId
;
this
.
FSUForm
.
fsuPort
=
Number
(
this
.
FSUForm
.
fsuPort
);
this
.
FSUForm
.
parentId
=
this
.
FSUForm
.
siteId
this
.
FSUForm
.
fsuPort
=
Number
(
this
.
FSUForm
.
fsuPort
)
fsusave
(
this
.
FSUForm
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
successAlert
(
"添加成功"
);
}
else
{
warningAlert
(
"添加失败"
);
}
});
successAlert
(
'操作成功'
)
})
}
this
.
FSUForm
=
formInit
()
;
})
;
this
.
FSUForm
=
formInit
()
})
},
getAllWay
()
{
railWaylist
(
this
.
params
).
then
((
res
)
=>
{
this
.
railWaySelect
=
res
.
records
;
this
.
railWaySelect
=
res
.
records
||
[]
if
(
res
.
total
>
this
.
params
.
size
)
{
this
.
params
.
size
=
res
.
total
;
this
.
getAllWay
()
;
this
.
params
.
size
=
res
.
total
this
.
getAllWay
()
}
});
},
},
created
()
{
selectFsuItem
().
then
((
res
)
=>
{
this
.
backupModeSelect
=
res
[
"01"
];
this
.
connectModeSelect
=
res
[
"02"
];
this
.
equipTypeSelect
=
res
[
"03"
];
this
.
equipSubTypeSelect
=
res
[
"04"
];
});
},
mounted
()
{
this
.
getAllWay
();
},
};
})
}
}
}
function
formInit
(
data
=
{})
{
return
{
parentId
:
""
,
...
...
@@ -258,7 +251,7 @@ function formInit(data = {}) {
equipSerialNumber
:
""
,
kmSign
:
""
,
...
data
,
}
;
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -268,10 +261,7 @@ function formInit(data = {}) {
margin
:
0
auto
;
}
.btn
{
padding
-top
:
50px
;
padding
:
20px
0
50px
0
;
text-align
:
center
;
button
{
width
:
120px
;
}
}
</
style
>
src/views/setting/add/comp/leakyCable.vue
View file @
aacebaea
...
...
@@ -285,10 +285,7 @@ function formInit(data = {}) {
margin
:
0
auto
;
}
.btn
{
padding
-top
:
50px
;
padding
:
20px
0
50px
0
;
text-align
:
center
;
button
{
width
:
120px
;
}
}
</
style
>
src/views/setting/add/comp/monitorEquip.vue
View file @
aacebaea
...
...
@@ -274,10 +274,7 @@ function formInit(data = {}) {
margin
:
0
auto
;
}
.btn
{
padding
-top
:
50px
;
padding
:
20px
0
50px
0
;
text-align
:
center
;
button
{
width
:
120px
;
}
}
</
style
>
\ No newline at end of file
src/views/setting/add/comp/railWay.vue
View file @
aacebaea
...
...
@@ -99,10 +99,8 @@ function formInit(data = {}) {
margin
:
0
auto
;
}
.btn
{
padding-top
:
50px
;
text-align
:
center
;
button
{
width
:
120px
;
}
padding
:
20px
0
50px
0
;
}
</
style
>
\ No newline at end of file
src/views/setting/add/comp/station.vue
View file @
aacebaea
...
...
@@ -187,10 +187,7 @@ function formInit(data = {}) {
margin
:
0
auto
;
}
.btn
{
padding-top
:
50px
;
text-align
:
center
;
button
{
width
:
120px
;
}
padding
:
20px
0
50px
0
;
}
</
style
>
\ No newline at end of file
src/views/setting/add/index.vue
View file @
aacebaea
<
template
>
<div
class=
"add"
>
<div
class=
"add-tab"
>
<el-tabs
v-model=
"activeName"
:stretc=
"true"
@
tab-click=
"handleClick"
>
<el-tabs
v-model=
"activeName"
:stretc=
"true"
>
<el-tab-pane
label=
"铁路线"
name=
"0"
>
<div
class=
"content"
v-if=
"activeName === '0'
"
>
<div
v-if=
"activeName === '0'"
class=
"content
"
>
<div
class=
"content-title"
>
添加铁路线
</div>
<railWay
></railWay
>
<railWay
/
>
</div>
</el-tab-pane>
<el-tab-pane
label=
"站点"
name=
"1"
>
<div
class=
"content"
v-if=
"activeName === '1'
"
>
<div
v-if=
"activeName === '1'"
class=
"content
"
>
<div
class=
"content-title"
>
添加站点
</div>
<station
></station
>
<station
/
>
</div>
</el-tab-pane>
<el-tab-pane
label=
"FSU"
name=
"2"
>
<div
class=
"content"
v-if=
"activeName === '2'
"
>
<div
v-if=
"activeName === '2'"
class=
"content
"
>
<div
class=
"content-title"
>
添加FSU
</div>
<FSU
></FSU
>
<FSU
/
>
</div>
</el-tab-pane>
<el-tab-pane
label=
"监测设备"
name=
"3"
>
<div
class=
"content"
v-if=
"activeName === '3'
"
>
<div
v-if=
"activeName === '3'"
class=
"content
"
>
<div
class=
"content-title"
>
添加监测设备
</div>
<monitorEquip
></monitorEquip
>
<monitorEquip
/
>
</div>
</el-tab-pane>
<el-tab-pane
label=
"漏缆"
name=
"4"
>
<div
class=
"content"
v-if=
"activeName === '4'
"
>
<div
v-if=
"activeName === '4'"
class=
"content
"
>
<div
class=
"content-title"
>
添加漏缆
</div>
<leakyCable
></leakyCable
>
<leakyCable
/
>
</div>
</el-tab-pane>
<el-tab-pane
label=
"天馈线"
name=
"5"
>
<div
class=
"content"
v-if=
"activeName === '5'
"
>
<div
v-if=
"activeName === '5'"
class=
"content
"
>
<div
class=
"content-title"
>
添加天馈线
</div>
</div>
</el-tab-pane>
...
...
@@ -44,7 +44,6 @@
</
template
>
<
script
>
import
{
railWaysave
,
sitesave
}
from
"../api"
;
import
railWay
from
"./comp/railWay.vue"
;
import
monitorEquip
from
"./comp/monitorEquip.vue"
;
import
station
from
"./comp/station.vue"
;
...
...
@@ -56,7 +55,7 @@ export default {
station
,
railWay
,
FSU
,
leakyCable
,
leakyCable
},
data
()
{
return
{
...
...
@@ -64,35 +63,34 @@ export default {
tabs
:
[
{
label
:
"铁路线"
,
key
:
"0"
,
key
:
"0"
},
{
label
:
"站点"
,
key
:
"1"
,
key
:
"1"
},
{
label
:
"FSU"
,
key
:
"2"
,
key
:
"2"
},
{
label
:
"监测设备"
,
key
:
"3"
,
key
:
"3"
},
{
label
:
"漏缆"
,
key
:
"4"
,
key
:
"4"
},
{
label
:
"天馈线"
,
key
:
"5"
,
}
,
]
,
}
;
key
:
"5"
}
]
}
},
methods
:
{
handleClick
(
tab
,
event
)
{},
},
};
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/setting/statistics/comp/fsuTable.vue
View file @
aacebaea
...
...
@@ -4,9 +4,7 @@
<div
style=
"color: #666666"
></div>
<div
class=
"operate-btn"
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"del()"
>
删除
</delids
>
<delids
:multipleSelection2=
"multipleSelection"
@
del=
"del()"
>
删除
</delids>
<el-button
type=
"primary"
@
click=
"refresh"
>
刷新
</el-button>
<el-button
type=
"primary"
@
click=
"block = !block"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"exportData"
>
导出
</el-button>
...
...
@@ -79,6 +77,7 @@
:data=
"tableData"
tooltip-effect=
"dark"
style=
"width: 100%"
height=
"100%"
:row-class-name=
"tableRowClassName"
:row-style=
"
{ height: '50px' }"
:header-cell-style="{
...
...
src/views/setting/statistics/index.vue
View file @
aacebaea
...
...
@@ -6,18 +6,17 @@
v-for=
"item in tabs"
:key=
"item.key"
:type=
"activeName === item.key ? 'primary' : ''"
style=
"width: 100px"
@
click=
"changeType(item)"
>
{{
item
.
label
}}
</el-button
>
>
{{
item
.
label
}}
</el-button>
</el-button-group>
<railWayTable
v-if=
"activeName == '0'"
></railWayTable
>
<stationTable
v-if=
"activeName == '1'"
></stationTable
>
<fsuTable
v-if=
"activeName == '2'"
></fsuTable
>
<monitorTable
v-if=
"activeName == '3'"
></monitorTable
>
<leakyTable
v-if=
"activeName == '4'"
></leakyTable
>
<railWayTable
v-if=
"activeName == '0'"
/
>
<stationTable
v-if=
"activeName == '1'"
/
>
<fsuTable
v-if=
"activeName == '2'"
/
>
<monitorTable
v-if=
"activeName == '3'"
/
>
<leakyTable
v-if=
"activeName == '4'"
/
>
</div>
</
template
>
<
script
>
...
...
@@ -26,22 +25,20 @@ import stationTable from "./comp/stationTable.vue";
import
fsuTable
from
"./comp/fsuTable.vue"
;
import
monitorTable
from
"./comp/monitorTable.vue"
;
import
leakyTable
from
"./comp/leakyTable.vue"
;
import
Pagination
from
"@/components/Pagination"
;
export
default
{
components
:
{
Pagination
,
railWayTable
,
stationTable
,
fsuTable
,
monitorTable
,
leakyTable
,
leakyTable
},
data
()
{
return
{
params
:
{
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
},
total
:
10
,
activeName
:
"0"
,
...
...
@@ -69,28 +66,27 @@ export default {
{
label
:
"天馈线"
,
key
:
"5"
,
}
,
}
],
tableData2
:
[],
tableData
:
[],
multipleSelection
:
[],
ids
:
[]
,
}
;
ids
:
[]
}
},
methods
:
{
tableRowClassName
({
row
,
rowIndex
})
{
return
rowIndex
%
2
===
0
?
""
:
"single-row"
;
},
changeType
(
item
)
{
this
.
activeName
=
item
.
key
;
this
.
activeName
=
item
.
key
},
refresh
()
{},
query
()
{},
exportData
()
{},
},
mounted
()
{},
};
exportData
()
{}
}
}
</
script
>
<
style
lang=
"scss"
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