Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kanban-nanjing-11
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
caolun
kanban-nanjing-11
Commits
788559e0
Commit
788559e0
authored
Jun 21, 2024
by
Allencl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
713bb349
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
index1.html
index1.html
+17
-17
No files found.
index1.html
View file @
788559e0
...
...
@@ -197,7 +197,7 @@
.
catch
(
error
=>
console
.
error
(
'
Error:
'
,
error
));
},
initWebSocket
(){
// console.log('1111+++='+codeDianshi)
//
//
console.log('1111+++='+codeDianshi)
var
iframe1
=
document
.
getElementById
(
'
myiframe1
'
).
contentWindow
;
var
iframe2
=
document
.
getElementById
(
'
myiframe2
'
).
contentWindow
;
var
iframe3
=
document
.
getElementById
(
'
myiframe3
'
).
contentWindow
;
...
...
@@ -217,7 +217,7 @@
//监听是否连接成功
ws
.
onopen
=
function
()
{
wsState
=
ws
.
readyState
console
.
log
(
'
ws连接状态:
'
+
ws
.
readyState
);
//
console.log('ws连接状态:' + ws.readyState);
var
_json1
=
{
type
:
'
conStatusChange
'
,
newStatus
:
false
...
...
@@ -228,13 +228,13 @@
}
// 接听服务器发回的信息并处理展示
ws
.
onmessage
=
function
(
option
=
{})
{
console
.
log
(
'
ws收到消息
'
);
// console.log('ws连接状态:' + ws.readyState);
//
console.log('ws收到消息');
//
//
console.log('ws连接状态:' + ws.readyState);
wsState
=
ws
.
readyState
const
{
data
=
"
{}
"
}
=
option
const
_data
=
JSON
.
parse
(
data
)
// console.log(_data);
//
//
console.log(_data);
iframe1
.
postMessage
(
JSON
.
stringify
(
_data
),
'
*
'
);
iframe2
.
postMessage
(
JSON
.
stringify
(
_data
),
'
*
'
);
iframe3
.
postMessage
(
JSON
.
stringify
(
_data
),
'
*
'
);
...
...
@@ -243,7 +243,7 @@
ws
.
onclose
=
function
()
{
wsState
=
ws
.
readyState
// 监听整个过程中websocket的状态
console
.
log
(
'
ws连接关闭状态:
'
+
ws
.
readyState
);
//
console.log('ws连接关闭状态:' + ws.readyState);
var
_json1
=
{
type
:
'
conStatusChange
'
,
newStatus
:
true
...
...
@@ -254,7 +254,7 @@
}
// 监听并处理error事件
ws
.
onerror
=
function
(
error
)
{
console
.
log
(
'
ws连接报错状态:
'
+
error
);
//
console.log('ws连接报错状态:' +error);
wsState
=
ws
.
readyState
var
_json1
=
{
type
:
'
conStatusChange
'
,
...
...
@@ -263,8 +263,8 @@
iframe1
.
postMessage
(
JSON
.
stringify
(
_json1
),
'
*
'
);
iframe2
.
postMessage
(
JSON
.
stringify
(
_json1
),
'
*
'
);
iframe3
.
postMessage
(
JSON
.
stringify
(
_json1
),
'
*
'
);
// console.log('错误error' + error);
// console.log('错误:ws连接状态:' + ws.readyState);
//
//
console.log('错误error' + error);
//
//
console.log('错误:ws连接状态:' + ws.readyState);
}
}
function
initBroadcastWebsocketFunc
()
{
...
...
@@ -274,7 +274,7 @@
//监听是否连接成功
broadcastWs
.
onopen
=
function
()
{
bwsState
=
broadcastWs
.
readyState
;
// console.log('bws连接状态:' + broadcastWs.readyState);
//
//
console.log('bws连接状态:' + broadcastWs.readyState);
var
_json1
=
{
type
:
'
conStatusChange
'
,
newStatus
:
false
...
...
@@ -285,14 +285,14 @@
}
// 接听服务器发回的信息并处理展示
broadcastWs
.
onmessage
=
function
(
option
=
{})
{
// console.log('bws收到信息');
// console.log('bws连接状态:' + broadcastWs.readyState);
//
//
console.log('bws收到信息');
//
//
console.log('bws连接状态:' + broadcastWs.readyState);
bwsState
=
broadcastWs
.
readyState
const
{
data
=
"
{}
"
}
=
option
const
_data
=
JSON
.
parse
(
data
)
// console.log(_data);
//
//
console.log(_data);
iframe1
.
postMessage
(
JSON
.
stringify
(
_data
),
'
*
'
);
iframe2
.
postMessage
(
JSON
.
stringify
(
_data
),
'
*
'
);
iframe3
.
postMessage
(
JSON
.
stringify
(
_data
),
'
*
'
);
...
...
@@ -301,7 +301,7 @@
broadcastWs
.
onclose
=
function
()
{
bwsState
=
broadcastWs
.
readyState
// 监听整个过程中websocket的状态
// console.log('bws连接关闭状态:' + broadcastWs.readyState);
//
//
console.log('bws连接关闭状态:' + broadcastWs.readyState);
var
_json1
=
{
type
:
'
conStatusChange
'
,
newStatus
:
true
...
...
@@ -320,8 +320,8 @@
iframe1
.
postMessage
(
JSON
.
stringify
(
_json1
),
'
*
'
);
iframe2
.
postMessage
(
JSON
.
stringify
(
_json1
),
'
*
'
);
iframe3
.
postMessage
(
JSON
.
stringify
(
_json1
),
'
*
'
);
// console.log('错误error' + error);
// console.log('错误:bws连接状态:' + broadcastWs.readyState);
//
//
console.log('错误error' + error);
//
//
console.log('错误:bws连接状态:' + broadcastWs.readyState);
}
}
...
...
@@ -338,7 +338,7 @@
initBroadcastWebsocketFunc
()
// 初始化
// $("#selectCodeContainer").css("z-index",-999)
window
.
IntervalItemCenter13
=
setInterval
(()
=>
{
// console.log('111==='+wsState+'222==='+bwsState);
//
//
console.log('111==='+wsState+'222==='+bwsState);
if
(
wsState
!=
1
||
bwsState
!=
1
)
{
initUlocWebsocketFunc
()
// 初始化
initBroadcastWebsocketFunc
()
// 初始化
...
...
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