Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
Overview
Overview
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
常超
founder_vue
Commits
8e6c3d96
Commit
8e6c3d96
authored
Jan 06, 2023
by
liuguorong93
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_gabjq_dev2' into dev_gabjq
parents
3ed0824a
0cbfde5b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
15 deletions
+83
-15
src/utils/websocket.js
+46
-0
src/views/dataJq/dataV.vue
+2
-2
src/views/dataJq/mapBox.vue
+0
-0
src/views/dataJq/mapBoxForBingTu.vue
+2
-1
src/views/sjfx/components/messageRemind.vue
+33
-12
No files found.
src/utils/websocket.js
0 → 100644
View file @
8e6c3d96
export
default
{
listen
(
url
,
messageCallback
,
openCallback
,
closeCallback
,
errorCallback
)
{
if
(
typeof
WebSocket
===
"undefined"
)
{
console
.
log
(
"您的浏览器不支持WebSocket"
);
return
;
}
else
{
let
protocol
=
"ws"
;
let
newUrl
=
""
;
if
(
window
.
location
.
protocol
==
"https:"
)
{
protocol
=
"wss"
;
}
let
env
=
process
.
env
.
NODE_ENV
;
switch
(
env
)
{
case
'development'
:
newUrl
=
`
${
protocol
}
://47.92.48.137:4002/
${
url
}
`
;
break
;
case
'production'
:
newUrl
=
`
${
protocol
}
://
${
window
.
location
.
host
}
/
${
url
}
`
;
break
;
}
const
ws
=
new
WebSocket
(
newUrl
);
ws
.
onopen
=
()
=>
{
if
(
openCallback
)
openCallback
();
};
ws
.
onclose
=
()
=>
{
if
(
closeCallback
)
closeCallback
();
};
ws
.
onerror
=
()
=>
{
if
(
errorCallback
)
errorCallback
();
};
ws
.
onmessage
=
(
event
)
=>
{
try
{
if
(
event
?.
data
)
{
const
data
=
JSON
.
parse
(
event
.
data
);
messageCallback
(
data
);
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
};
return
ws
;
}
},
};
src/views/dataJq/dataV.vue
View file @
8e6c3d96
...
...
@@ -64,7 +64,7 @@ import dogMajor from "./dogMajor.vue";
// 中间内容
import
mapCount
from
"./mapCount.vue"
;
// 地图
//
import mapBox from "./mapBox.vue";
import
mapBox
from
"./mapBox.vue"
;
import
mapBoxForBingTu
from
"./mapBoxForBingTu.vue"
;
import
{
postRequest
}
from
"@/api/dogView.js"
;
export
default
{
...
...
@@ -76,7 +76,7 @@ export default {
qgPhTop
,
dogMajor
,
mapCount
,
//
mapBox,
mapBox
,
mapBoxForBingTu
,
},
data
()
{
...
...
src/views/dataJq/mapBox.vue
View file @
8e6c3d96
This diff is collapsed.
Click to expand it.
src/views/dataJq/mapBoxForBingTu.vue
View file @
8e6c3d96
...
...
@@ -208,7 +208,7 @@ export default {
z
:
4
,
animationDuration
:
0
,
radius
:
25
,
center
:
[
itemArr
.
value
[
0
],
itemArr
.
value
[
1
]]
,
center
:
itemArr
.
value
,
data
:
[
{
name
:
"一级工作犬"
,
...
...
@@ -262,6 +262,7 @@ export default {
this
.
$message
.
error
(
"该区域没有数据,不支持地图下钻!"
);
this
.
loading
=
false
;
}
break
;
}
}
});
...
...
src/views/sjfx/components/messageRemind.vue
View file @
8e6c3d96
...
...
@@ -53,26 +53,47 @@
</
template
>
<
script
>
import
websocket
from
"@/utils/websocket.js"
;
export
default
{
data
()
{
return
{};
return
{
ws
:
null
,
};
},
beforeDestroy
()
{
this
.
closeWebSocket
();
},
mounted
()
{
// this.getLists();
// this.wsFn();
},
methods
:
{
getLists
()
{
this
.
$nextTick
(()
=>
{
jQuery
(
".messageClass"
).
slide
({
mainCell
:
".infoListUl"
,
autoPage
:
true
,
effect
:
"top"
,
autoPlay
:
true
,
scroll
:
6
,
vis
:
6
,
});
});
closeWebSocket
()
{
if
(
this
.
ws
&&
this
.
ws
.
readyState
<=
1
)
this
.
ws
.
close
();
},
wsFn
()
{
let
url
=
"ws/asset"
;
this
.
ws
=
websocket
.
listen
(
url
,
this
.
websocketCB
,
this
.
websocketErrCB
);
},
websocketCB
(
data
)
{
// console.log("data", data);
},
websocketErrCB
(
err
)
{
// console.log("err", err);
},
// getLists() {
// this.$nextTick(() => {
// jQuery(".messageClass").slide({
// mainCell: ".infoListUl",
// autoPage: true,
// effect: "top",
// autoPlay: true,
// scroll: 6,
// vis: 6,
// });
// });
// },
},
};
</
script
>
...
...
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