|
@@ -5,8 +5,14 @@ import modules from "./store/index";
|
|
|
import VueSocketIO from "vue-socket.io";
|
|
|
import Vuex from 'vuex'
|
|
|
import vuescroll from 'vuescroll';
|
|
|
+import axios from "axios";
|
|
|
+import ElementUI from "element-ui";
|
|
|
+import "element-ui/lib/theme-chalk/index.css";
|
|
|
|
|
|
|
|
|
+Vue.use(ElementUI);
|
|
|
+Vue.prototype.$axios = axios;
|
|
|
+
|
|
|
// 在这里设置全局配置
|
|
|
Vue.use(vuescroll, {
|
|
|
ops: {
|
|
@@ -29,14 +35,12 @@ Vue.use(vuescroll, {
|
|
|
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
|
-var strUrl=window.location.href;
|
|
|
+var strUrl = window.location.href;
|
|
|
var strIp = "";
|
|
|
-if(strUrl.indexOf("172.16.50.4")!=-1)
|
|
|
-{
|
|
|
+if (strUrl.indexOf("172.16.50.4") != -1) {
|
|
|
strIp = "172.16.50.4:19703";
|
|
|
}
|
|
|
-else
|
|
|
-{
|
|
|
+else {
|
|
|
strIp = "47.102.97.214";
|
|
|
}
|
|
|
|
|
@@ -44,7 +48,7 @@ Vue.use(
|
|
|
new VueSocketIO({
|
|
|
debug: true,
|
|
|
connection: "ws://" + strIp,
|
|
|
- //connection: "ws://121.42.8.157:19703",
|
|
|
+ // connection: "ws://121.42.8.157:19703",
|
|
|
options: {
|
|
|
transports: ["websocket", "polling"],
|
|
|
},
|
|
@@ -67,8 +71,6 @@ window.vm = new Vue({
|
|
|
created: function () {
|
|
|
// console.log('created init home page')
|
|
|
// init()
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
mounted: function () {
|
|
|
console.log("mounted init home page");
|
|
@@ -93,8 +95,59 @@ window.vm = new Vue({
|
|
|
console.log("receive [login] msg from server: " + data);
|
|
|
});
|
|
|
this.sockets.subscribe("CALL", (data) => {
|
|
|
- // console.log('receive [CALL] msg from server: ' + data)
|
|
|
+ console.log('receive [CALL] msg from server: ' + data)
|
|
|
});
|
|
|
+ // this.sockets.subscribe('PUSH', (data) => {
|
|
|
+ // if (data.cmd === 'tof_data_oneAntenna') {
|
|
|
+ // if (data.data.length !== 0) {
|
|
|
+ // this.$store.commit('tof_data_oneAntenna', data.data)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // if (cmd === 'event') {
|
|
|
+ // // this.$store.commit('deviceStateData', datas)
|
|
|
+ // // } else if (cmd === 'light_state') {
|
|
|
+ // // // this.$store.commit('lightStateData', datas)
|
|
|
+ // // } else if (cmd === 'pos_map') {
|
|
|
+ // // // console.log('drawCard')
|
|
|
+ // // // this.$store.commit('devicePosData', datas)
|
|
|
+ // // this.$store.commit('drawCard', datas)
|
|
|
+ // // } else if (data.cmd === 'load_history_completed') {
|
|
|
+ // // this.$store.commit('loadHistoryDone', data)
|
|
|
+ // // } else if (data.cmd === 'tof_data') {
|
|
|
+ // // if (data.data.length !== 0) {
|
|
|
+ // // this.$store.commit('sxqMapSelect', data)
|
|
|
+ // // // this.$store.commit('logMsgm', data.data)
|
|
|
+ // // // console.log(data.data.toString())
|
|
|
+ // // }
|
|
|
+ // // } else if (data.cmd === 'sb_raw_data') {
|
|
|
+ // // if (data.data.length !== 0) {
|
|
|
+ // // this.$store.commit('sxqSelect', data)
|
|
|
+ // // // this.$store.commit('logMsgm', data.data)
|
|
|
+ // // // console.log(data.data.toString())
|
|
|
+ // // }
|
|
|
+ // // } else if (data.cmd === 'tdoa_2d_raw_data') {
|
|
|
+ // // if (data.data.length !== 0) {
|
|
|
+ // // this.$store.commit('tdoa_2d_raw_data', data)
|
|
|
+ // // }
|
|
|
+ // // } else if (data.cmd === 'tof_data_oneAntenna') {
|
|
|
+ // // if (data.data.length !== 0) {
|
|
|
+ // // this.$store.commit('tof_data_oneAntenna', data)
|
|
|
+ // // }
|
|
|
+ // // } else if (data.cmd === 'pdoa_3d_raw_data') {
|
|
|
+ // // if (data.data.length !== 0) {
|
|
|
+ // // this.$store.commit('tdoa3dSelect', data)
|
|
|
+ // // }
|
|
|
+ // // }
|
|
|
+ // })
|
|
|
+ this.sockets.subscribe('FILE', (data) => {
|
|
|
+ if (data.cmd === 'upload_more') {
|
|
|
+ this.$store.commit('uploadChunk', data)
|
|
|
+ } else if (data.cmd === 'upload_done') {
|
|
|
+ this.$store.commit('uploadDone', data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -133,12 +186,12 @@ window.vm = new Vue({
|
|
|
console.log(JSON.stringify(data));
|
|
|
}
|
|
|
);
|
|
|
- console.log(this);
|
|
|
+ // console.log(this);
|
|
|
this.init();
|
|
|
},
|
|
|
|
|
|
device_state(data) {
|
|
|
- console.log(data);
|
|
|
+ console.log("device_state", data);
|
|
|
},
|
|
|
},
|
|
|
router,
|
|
@@ -149,8 +202,4 @@ window.vm = new Vue({
|
|
|
|
|
|
// window.vm.initService();
|
|
|
|
|
|
-import ElementUI from "element-ui";
|
|
|
-import "element-ui/lib/theme-chalk/index.css";
|
|
|
-Vue.use(ElementUI);
|
|
|
-import axios from "axios";
|
|
|
-Vue.prototype.$axios = axios;
|
|
|
+
|