Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b52edb5d
authored
Mar 24, 2020
by
周志凯
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
close websocket
1 parent
bb6067e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
index.html
index.html
View file @
b52edb5
...
...
@@ -1121,6 +1121,7 @@
{
label
:
'店员对比'
,
value
:
1
},
{
label
:
'顾客对比'
,
value
:
2
}
],
socket
:
{},
results
:
[],
startTiming
:
0
,
endTiming
:
0
,
...
...
@@ -1838,6 +1839,10 @@
},
/////////////////////////////特征重提////////////////////////////////////////////////
onSearchClick
:
function
()
{
this
.
socket
&&
this
.
socket
.
close
()
this
.
results
=
[]
this
.
startTiming
=
0
this
.
endTiming
=
0
const
TAB_API
=
{
revisitFeature
:
()
=>
'/mall/feature'
,
rebuildFeatureLib
:
(
val
)
=>
{
...
...
@@ -1967,26 +1972,26 @@
wsUrl
=
webSockUrl
||
window
.
location
.
host
,
socketUrl
=
"ws://"
+
wsUrl
+
"/recal/schedule/"
+
scheduleType
console
.
log
(
'[socketUrl]:'
,
socketUrl
)
var
socket
=
new
ws
(
socketUrl
)
socket
.
onconnecting
=
function
(
ev
)
{
self
.
socket
=
new
ws
(
socketUrl
)
s
elf
.
s
ocket
.
onconnecting
=
function
(
ev
)
{
console
.
log
(
'socket:onconnecting'
,
ev
)
}
socket
.
onopen
=
function
(
ev
)
{
s
elf
.
s
ocket
.
onopen
=
function
(
ev
)
{
console
.
log
(
'socket:onopen'
,
ev
)
callback
&&
callback
(
callbackUrlPath
,
callbackParam
)
}
socket
.
onclose
=
function
(
ev
)
{
s
elf
.
s
ocket
.
onclose
=
function
(
ev
)
{
console
.
log
(
'socket:onclose'
,
ev
)
// log('WebSocket Closed!!')
}
socket
.
onmessage
=
function
(
ev
)
{
s
elf
.
s
ocket
.
onmessage
=
function
(
ev
)
{
console
.
log
(
'socket:onmessage'
,
ev
)
var
msg
=
JSON
.
parse
(
ev
.
data
)
console
.
log
(
'[onmessage]:'
,
msg
)
self
.
dealMessage
(
msg
)
if
(
msg
.
stepCount
===
1
)
{
this
.
endTiming
=
new
Date
()
socket
.
close
()
s
elf
.
s
ocket
.
close
()
}
}
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment