diff --git a/index.html b/index.html index 0930f34..92a7792 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + 数据之眼可视化大屏 diff --git a/src/App.vue b/src/App.vue index 2fcb123..81a09cb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,22 +5,22 @@ import { Push } from '@/common/push' -var ws = new WebSocket("ws://192.168.106.167:8080"); +// var ws = new WebSocket("ws://192.168.106.167:8080"); -//当WebSocket创建成功时,触发onopen事件 -ws.onopen = function () { - console.log("open"); -} -//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据 -ws.onmessage = function (e) { +// //当WebSocket创建成功时,触发onopen事件 +// ws.onopen = function () { +// console.log("open"); +// } +// //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据 +// ws.onmessage = function (e) { - let data =JSON.parse(e.data) +// let data =JSON.parse(e.data) - globalEventBus.emit(data.event, data.data ||'') +// globalEventBus.emit(data.event, data.data ||'') -} +// } @@ -29,26 +29,27 @@ ws.onmessage = function (e) { -// var connection = new Push({ -// url: 'ws://192.168.1.22:3131/', // websocket地址 -// app_key: 'aaea61749929eb53a4bd75a1474c1d27', -// }); -// // 假设用户uid为1 -// var uid = 2; -// // 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息 -// var user_channel = connection.subscribe('user-' + uid); +var connection = new Push({ + url: 'ws://192.168.1.22:3131/', // websocket地址 + app_key: 'aaea61749929eb53a4bd75a1474c1d27', +}); +// 假设用户uid为1 +var uid = 2; +// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息 +var user_channel = connection.subscribe('user-' + uid); -// // 当user-2频道有message事件的消息时 -// user_channel.on('message', function (data) { -// if (data.content.event == 'header2') { -// globalEventBus.emit('newTask', "data") +// 当user-2频道有message事件的消息时 +user_channel.on('message', function (data) { + globalEventBus.emit(data.content.event, data.content.data) -// } -// }); -// // 断线事件 -// user_channel.on('close', function () { -// }); + console.log("收到消息",data) + +}); +// 断线事件 +user_channel.on('close', function () { + +}); diff --git a/src/components/areaList.vue b/src/components/areaList.vue index e23cae0..d3d9ea4 100644 --- a/src/components/areaList.vue +++ b/src/components/areaList.vue @@ -2,7 +2,7 @@
-
泸县
+
{{ areaStore.area.name||"泸县" }}
{{ item.name }} @@ -12,14 +12,13 @@ diff --git a/src/components/index/topLeft.vue b/src/components/index/topLeft.vue index 883bba4..5626857 100644 --- a/src/components/index/topLeft.vue +++ b/src/components/index/topLeft.vue @@ -324,7 +324,8 @@ const pageFN = (Num) => { } globalEventBus.on('indextopleft', data => { - pageFN(data.num) + console.log("houdao",data) + pageFN(Number(data.num) ) }) diff --git a/src/components/index/topRight.vue b/src/components/index/topRight.vue index 853ffa9..e71c22f 100644 --- a/src/components/index/topRight.vue +++ b/src/components/index/topRight.vue @@ -260,7 +260,7 @@ const pageFN = (Num) => { globalEventBus.on('indextopright', data => { - pageFN(data.num) + pageFN( Number(data.num) ) }) globalEventBus.on('indextopright-1', data => { diff --git a/src/view/home.vue b/src/view/home.vue index 61a4150..62cd078 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -16,13 +16,8 @@ import { globalEventBus } from '@/common/eventBus' for (let i = 1; i < 6; i++) { globalEventBus.on('header' + i, data => { globalEventBus.emit('compheader' + i, data) - console.log(i) - }) - - } -console.log("wcnm") diff --git a/src/view/index.vue b/src/view/index.vue index e203597..7c7e4b4 100644 --- a/src/view/index.vue +++ b/src/view/index.vue @@ -6,24 +6,24 @@
- +
- +
- +
- +
- +
- +
@@ -48,7 +48,7 @@ const areaStore = areaObj() const areaCodes = reactive({ ...areaStore.area }) - +console.log(areaCodes,'areacodes') setTimeout(() => { showLoading.value = false