Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
energyai_vue
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
葛齐林
energyai_vue
Commits
aeae8ce3
Commit
aeae8ce3
authored
Mar 22, 2021
by
co_dengxiongwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
267120a7
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1465 deletions
+23
-1465
App - 副本.vue
src/App - 副本.vue
+0
-249
App copy.vue
src/App copy.vue
+0
-1193
App.vue
src/App.vue
+22
-22
main.js
src/main.js
+1
-1
No files found.
src/App - 副本.vue
deleted
100644 → 0
View file @
267120a7
<
template
>
<div
id=
"app"
>
<router-view
/>
</div>
</
template
>
<
script
>
import
util
from
'@/libs/util.js'
import
util
from
'@/libs/util.js'
export
default
{
name
:
'app'
,
data
()
{
return
{
LogTimeout
:
null
}
},
mounted
()
{
//let token = util.cookies.get('token')
//this.initWebSocket()
// this.setTimeout()
},
destroyed
:
function
()
{
this
.
websocketclose
()
},
methods
:
{
//初始化weosocket
initWebSocket
()
{
if
(
typeof
WebSocket
===
'undefined'
)
{
alert
(
'您的浏览器不支持WebSocket'
)
return
false
}
// websocket地址
const
wsuri
=
this
.
$http
.
adornUrl
(
''
).
slice
(
5
)
const
webpath
=
'ws:'
+
wsuri
.
substring
(
0
,
wsuri
.
indexOf
(
':'
))
+
':8091/websocket/1001'
this
.
websock
=
new
WebSocket
(
webpath
)
this
.
websock
.
onopen
=
this
.
websocketonopen
this
.
websock
.
onmessage
=
this
.
websocketonmessage
this
.
websock
.
onerror
=
this
.
websocketonerror
this
.
websock
.
onclose
=
this
.
websocketclose
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
window
.
onbeforeunload
=
this
.
onbeforeunload
},
//连接成功
websocketonopen
()
{
console
.
log
(
'WebSocket连接成功'
)
},
//接收后端返回的数据
websocketonmessage
(
e
)
{
console
.
log
(
e
+
'*****'
)
let
dataJson
=
e
.
data
console
.
log
(
dataJson
+
'*****'
)
// 在这里使用后端返回的数据,对数据进行处理渲染
},
//连接建立失败重连
websocketonerror
(
e
)
{
console
.
log
(
`连接失败的信息:`
,
e
)
this
.
initWebSocket
()
// 连接失败后尝试重新连接
},
//关闭连接
websocketclose
(
e
)
{
console
.
log
(
'断开连接'
,
e
)
},
//设置定时器
setTimeout
()
{
if
(
this
.
LogTimeout
)
{
this
.
closeTimeout
()
}
this
.
LogTimeout
=
setInterval
(
this
.
getDateList
,
5000
)
},
// 关闭定时器
closeTimeout
()
{
if
(
this
.
LogTimeout
)
{
clearInterval
(
this
.
LogTimeout
)
}
},
getDateList
()
{
console
.
log
(
'开始定时循环'
)
if
(
util
.
cookies
.
get
(
'token'
)
&&
util
.
cookies
.
get
(
'token'
)
!=
undefined
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrlAlarm
(
'/alarmsInfo/queryList'
),
method
:
'post'
,
params
:
this
.
$http
.
adornParams
({
status
:
1
,
stationId
:
localStorage
.
getItem
(
'stationId'
)
})
}).
then
(
data
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
dataList
=
data
.
list
console
.
log
(
'报警弹框'
)
for
(
var
i
=
0
;
i
<
data
.
list
.
length
;
i
++
)
{
if
(
i
===
4
)
{
break
}
this
.
$toast
({
tip
:
'tip'
+
(
i
+
1
),
id
:
data
.
list
[
i
].
id
,
stationName
:
''
,
//站点名
tierName
:
data
.
list
[
i
].
tierName
,
//站层名
resourceName
:
data
.
list
[
i
].
resourceName
,
//资源点名
occurrenceSite
:
data
.
list
[
i
].
occurrenceSite
,
//发生地点
level
:
data
.
list
[
i
].
eventLevel
,
// 等级
times
:
data
.
list
[
i
].
occurrenceTime
,
//时间
type
:
data
.
list
[
i
].
eventName
,
// 类型
// explain: data.list[i].explain, //说明
// url: data.list[i].url, //图片地址
duration
:
'4900'
,
router
:
this
.
$router
})
}
// this.closeTimeout()
}
})
}
}
}
}
</
script
>
<
style
lang=
"scss"
>
@import
"~@/assets/style/public-class.scss"
;
.d2-layout-header-aside-group
.d2-layout-header-aside-content
.d2-theme-container
.d2-theme-container-main
.d2-theme-container-main-body
.container-component
.d2-container-full
.d2-container-full__body
{
margin-bottom
:
50px
;
}
//-- 公共样式--//
// page页背景色
.d2-container-full__body
{
background-color
:
#b9c9e3
!
important
;
}
// 状态-点
// .danger,
// .success,
// .warning {
// width: 5px;
// height: 5px;
// border-radius: 100%;
// background: #ff3723;
// display: inline-block;
// vertical-align: middle;
// }
// .success {
// background: #42cd00;
// }
// .warning {
// background: #ffa101;
// }
// 弹出框
.el-dialog__title
{
line-height
:
24px
;
font-size
:
18px
;
color
:
#303133
;
padding-left
:
10px
;
}
.el-dialog__header
{
border-top
:
3px
solid
#21acfc
;
padding
:
14px
20px
10px
!
important
;
background-color
:
#edeef1
;
border-bottom
:
1px
solid
#e9e9e9
;
}
// 自定义===============
// 标题加粗
.title-bold
{
font-weight
:
bold
;
font-size
:
17px
;
}
// 标题左侧颜色
.title-left-color
{
border-left
:
5px
solid
#21acfc
;
padding-left
:
10px
;
}
.treeCard
.el-card__header
{
height
:
42px
;
line-height
:
42px
;
background
:
#e1edf4
;
padding
:
0
0
0
10px
!
important
;
}
.tableCard
.el-card__header
{
height
:
42px
;
line-height
:
42px
;
background
:
#edeef1
;
padding
:
0
0
0
10px
!
important
;
}
.tableHeader
.el-table__header-wrapper
{
height
:
42px
;
line-height
:
42px
;
background
:
#edeef1
;
padding
:
0
0
0
0
!
important
;
transform
:
translateY
(
0px
);
}
.tableHeader
.has-gutter
{
transform
:
translateY
(
-12px
);
}
// .elTree{
// background:#f4f4f4!important;
// }
// 二级菜单
.monitor_menu
{
.menu_item
{
width
:
120px
;
height
:
46px
;
line-height
:
46px
;
text-align
:
center
;
color
:
#ccc
;
box-shadow
:
0px
0
2px
#000
!
important
;
background-image
:
linear-gradient
(
to
top
,
#335274
,
#4d759a
)
!
important
;
text-shadow
:
0px
2px
1px
rgba
(
0
,
0
,
0
,
0
.3
)
!
important
;
}
.is-active
{
color
:
#fff
!
important
;
background
:
linear-gradient
(
0deg
,
rgba
(
33
,
172
,
252
,
1
)
,
rgba
(
48
,
136
,
193
,
1
)
)
!
important
;
}
ul
{
a
:nth-child
(
1
)
{
li
{
border-radius
:
9px
0
0
9px
!
important
;
}
}
a
:last-child
{
li
{
border-radius
:
0
9px
9px
0
!
important
;
}
}
}
}
//-- 公共样式--//
</
style
>
src/App copy.vue
deleted
100644 → 0
View file @
267120a7
This diff is collapsed.
Click to expand it.
src/App.vue
View file @
aeae8ce3
...
...
@@ -10,21 +10,21 @@
<div
:class=
"'tip' + (index + 1)"
>
<div
class=
"title"
>
<el-row
:span=
"24"
>
<el-col
:sm=
"15"
style=
"color:
red;font-size:20px;
"
<el-col
:sm=
"15"
style=
"color:
red; font-size: 20px
"
>
{{
item
.
eventTypeName
}}
</el-col>
<el-col
:sm=
"9"
style=
"text-align:
right;padding-right:10px;
"
<el-col
:sm=
"9"
style=
"text-align:
right; padding-right: 10px
"
>
等级:
<span
class=
"tip_level"
v-if=
"item.eventLevel == 1"
style=
"color:red"
style=
"color:
red"
>
特别重大
</span
>
<span
class=
"tip_level"
v-if=
"item.eventLevel == 2"
style=
"color:red"
style=
"color:
red"
>
重大
</span
>
<span
class=
"tip_level"
v-if=
"item.eventLevel == 3"
>
一般
</span>
...
...
@@ -36,7 +36,7 @@
<el-row
class=
"tip_content"
type=
"flex"
justify=
"space-around"
>
<el-col
:span=
"15"
>
<el-row
:span=
"24"
>
<el-col
:span=
"24"
style=
"color:red"
<el-col
:span=
"24"
style=
"color:
red"
>
报警地点:
{{
item
.
occurrenceSite
}}
</el-col>
<el-col
:span=
"24"
...
...
@@ -138,7 +138,7 @@ export default {
name
:
'app'
,
provide
()
{
return
{
reload
:
this
.
reload
,
reload
:
this
.
reload
}
},
data
()
{
...
...
@@ -152,7 +152,7 @@ export default {
tipList
:
[],
showList
:
[],
src
:
window
.
CONFIG
.
bimPath
,
takeoverInfo
:
''
,
takeoverInfo
:
''
}
},
watch
:
{
...
...
@@ -164,25 +164,25 @@ export default {
}
else
{
this
.
dialogVisible
=
false
}
}
,
}
},
computed
:
{
takeover
()
{
return
this
.
$store
.
state
.
d2admin
.
takeover
.
takeover
}
,
}
},
mounted
()
{
this
.
initWebSocket
()
this
.
initWebSocket2
()
// this.getDateList()
},
destroyed
:
function
()
{
destroyed
:
function
()
{
this
.
websocketclose
()
},
methods
:
{
reload
()
{
this
.
isRouterAlive
=
false
this
.
$nextTick
(
function
()
{
this
.
$nextTick
(
function
()
{
this
.
isRouterAlive
=
true
})
},
...
...
@@ -482,7 +482,7 @@ export default {
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/sysStationTakeover/agree'
),
method
:
'post'
,
data
:
item
,
data
:
item
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
// this.$message.success('操作成功')
...
...
@@ -500,7 +500,7 @@ export default {
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/sysStationTakeover/agree'
),
method
:
'post'
,
data
:
item
,
data
:
item
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
// this.$message.success('操作成功')
...
...
@@ -536,8 +536,8 @@ export default {
method
:
'post'
,
params
:
this
.
$http
.
adornParams
({
status
:
1
,
stationId
:
localStorage
.
getItem
(
'stationId'
)
,
})
,
stationId
:
localStorage
.
getItem
(
'stationId'
)
})
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
tipList
=
data
.
list
...
...
@@ -571,7 +571,7 @@ export default {
* @param attr 排序的属性 如number属性
* @param rev true表示升序排列,false降序排序
* */
sortBy
:
function
(
attr
,
rev
)
{
sortBy
:
function
(
attr
,
rev
)
{
//第二个参数没有传递 默认升序排列
if
(
rev
==
undefined
)
{
rev
=
1
...
...
@@ -579,7 +579,7 @@ export default {
rev
=
rev
?
1
:
-
1
}
return
function
(
a
,
b
)
{
return
function
(
a
,
b
)
{
a
=
a
[
attr
]
b
=
b
[
attr
]
if
(
a
<
b
)
{
...
...
@@ -601,18 +601,18 @@ export default {
var
ruleForm
=
{
id
:
id
,
status
:
2
,
beSend
:
true
,
beSend
:
true
}
this
.
$http
({
url
:
this
.
$http
.
adornUrlAlarm
(
`/alarmsInfo/update`
),
method
:
'post'
,
data
:
ruleForm
,
data
:
ruleForm
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
,
duration
:
1500
,
duration
:
1500
})
//目前websocket未移到alarms项目,使用下列关闭
// this.tipList.splice(index, 1)
...
...
@@ -622,8 +622,8 @@ export default {
this
.
$message
.
error
(
data
.
msg
)
}
})
}
,
}
,
}
}
}
</
script
>
<
style
lang=
"scss"
>
...
...
src/main.js
View file @
aeae8ce3
...
...
@@ -106,7 +106,7 @@ new Vue({
// this.$store.commit('d2admin/menu/headerSet', menuHeader)
// // 初始化菜单搜索功能
// this.$store.commit('d2admin/search/init', menuHeader)
const
pattern
=
/
[
_
`~^*|{}<>¥……*|&‘”“
/
#【】《》
\\
[
\]
$%+=
]
/
//这些字段不允许输入
const
pattern
=
/
[
`~^*|{}<>¥……*|&‘”“
/
#【】《》
\\
[
\]
$%+=
]
/
//这些字段不允许输入
const
testMark
=
function
(
s
)
{
return
pattern
.
test
(
s
)
}
...
...
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