Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
SQL_Mou
NewTruckTerminalSyetem
Commits
f0b69608
Commit
f0b69608
authored
Nov 30, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4117a6f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
index.html
public/index.html
+1
-1
index.vue
src/views/MLargeScreen/index.vue
+9
-9
No files found.
public/index.html
View file @
f0b69608
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<script
src=
"https://cdn.bootcss.com/eruda/1.5.8/eruda.min.js"
></script>
<script
src=
"https://cdn.bootcss.com/eruda/1.5.8/eruda.min.js"
></script>
<script>
<script>
eruda
.
init
();
//
eruda.init();
</script>
</script>
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
...
...
src/views/MLargeScreen/index.vue
View file @
f0b69608
...
@@ -173,11 +173,13 @@ export default {
...
@@ -173,11 +173,13 @@ export default {
roadblockNum
:
0
,
roadblockNum
:
0
,
//websocket对象
//websocket对象
websocketIndex
:
null
,
websocketIndex
:
null
,
//判断是否连接天线的信号
antennaConnectorBoolean
:
false
,
}
}
},
},
mounted
(){
mounted
(){
let
that
=
this
;
let
that
=
this
;
//
that.initWebSocketIndex();
that
.
initWebSocketIndex
();
this
.
loadData
();
this
.
loadData
();
this
.
setNowTimes
();
this
.
setNowTimes
();
this
.
zongTimer1
=
setInterval
(()
=>
{
this
.
zongTimer1
=
setInterval
(()
=>
{
...
@@ -233,8 +235,6 @@ export default {
...
@@ -233,8 +235,6 @@ export default {
}
}
}
}
})
})
//WebSocket重连
//that.reconnectIndex();
},
8000
)
},
8000
)
},
},
...
@@ -252,18 +252,18 @@ export default {
...
@@ -252,18 +252,18 @@ export default {
},
},
//初始化weosocket
//初始化weosocket
initWebSocketIndex
(){
initWebSocketIndex
(){
const
wsuri1
=
"
ws://8.143.203.103:9095
"
;
//连接地址,可加参数
//const wsuri1 = "ws://192.168.0.111:9095/ws";//连接地址,可加参数
const
wsuri1
=
"
ws://8.143.203.103:9095/ws
"
;
//连接地址,可加参数
this
.
websocketIndex
=
new
WebSocket
(
wsuri1
);
this
.
websocketIndex
=
new
WebSocket
(
wsuri1
);
this
.
websocketIndex
.
onopen
=
this
.
websocketonopenIndex
;
this
.
websocketIndex
.
onopen
=
this
.
websocketonopenIndex
;
this
.
websocketIndex
.
onerror
=
this
.
websocketonerrorIndex
;
this
.
websocketIndex
.
onerror
=
this
.
websocketonerrorIndex
;
this
.
websocketIndex
.
onmessage
=
this
.
websocketonmessageIndex
;
this
.
websocketIndex
.
onmessage
=
this
.
websocketonmessageIndex
;
this
.
websocketIndex
.
onclose
=
this
.
websocketcloseIndex
;
this
.
websocketIndex
.
onclose
=
this
.
websocketcloseIndex
;
// this.websocketsendIndex('gpsclient');
// this.websocketonmessageIndex();
},
},
//WebSocket连接成功
//WebSocket连接成功
websocketonopenIndex
()
{
websocketonopenIndex
()
{
console
.
log
(
"
9095WebSocket连接成功
"
)
console
.
log
(
"
9095WebSocket连接成功
"
)
this
.
websocketsendIndex
(
'
gpsclient
'
);
},
},
//WebSocket连接错误
//WebSocket连接错误
websocketonerrorIndex
(
e
)
{
websocketonerrorIndex
(
e
)
{
...
@@ -275,13 +275,13 @@ export default {
...
@@ -275,13 +275,13 @@ export default {
if
(
e
==
undefined
){
if
(
e
==
undefined
){
return
return
}
else
{
}
else
{
let
obj1
=
JSON
.
parse
(
e
.
data
);
this
.
antennaConnectorBoolean
=
true
;
console
.
log
(
obj1
);
}
}
},
},
//WebSocket数据发送
//WebSocket数据发送
websocketsendIndex
(
agentData
){
websocketsendIndex
(
agentData
){
this
.
websocketIndex
.
send
(
agentData
);
this
.
websocketIndex
.
send
(
agentData
);
this
.
websocketonmessageIndex
();
},
},
//WebSocket关闭
//WebSocket关闭
websocketcloseIndex
(
e
){
websocketcloseIndex
(
e
){
...
...
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