|
@@ -93,7 +93,14 @@ export default {
|
|
|
onReady() {},
|
|
|
|
|
|
methods: {
|
|
|
- targetdetail_target() {
|
|
|
+ async targetdetail_target() {
|
|
|
+ let ip;
|
|
|
+ uni.request({
|
|
|
+ url: "http://192.168.1.104:8082/targetdetail/targetdetail_target?pointKey=HB_GD_KBF_JS_P4_L19_220_CI0136",
|
|
|
+ success: (res) => {
|
|
|
+ ip = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
let _this = this;
|
|
|
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
|
|
|
this.socketTask_targetdetail_target = uni.connectSocket({
|
|
@@ -112,7 +119,7 @@ export default {
|
|
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
|
|
this.socketTask_targetdetail_target.onMessage(res => {
|
|
|
//console.log("收到服务器内容:" + res.data);
|
|
|
- _this.targetdetail.targetdetail_target = res.data;
|
|
|
+ _this.targetdetail.targetdetail_target =JSON.parse(res.data)[ip];
|
|
|
console.log(_this.targetdetail.targetdetail_target);
|
|
|
});
|
|
|
});
|
|
@@ -122,6 +129,13 @@ export default {
|
|
|
}) */
|
|
|
},
|
|
|
targetdetail_curve() {
|
|
|
+ let ip;
|
|
|
+ uni.request({
|
|
|
+ url: "http://192.168.1.104:8082/targetdetail/targetdetail_curve?pointKey=HB_GD_KBF_JS_P4_L19_220_CI0136",
|
|
|
+ success: (res) => {
|
|
|
+ ip = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
let _this = this;
|
|
|
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
|
|
|
this.socketTask_targetdetail_curve = uni.connectSocket({
|
|
@@ -140,7 +154,7 @@ export default {
|
|
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
|
|
this.socketTask_targetdetail_curve.onMessage(res => {
|
|
|
//console.log("收到服务器内容:" + res.data);
|
|
|
- _this.targetdetail.targetdetail_curve = eval(res.data);
|
|
|
+ _this.targetdetail.targetdetail_curve = JSON.parse(res.data)[ip];
|
|
|
});
|
|
|
});
|
|
|
// 这里仅是事件监听【如果socket关闭了会执行】
|
|
@@ -168,7 +182,13 @@ export default {
|
|
|
return fmt;
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+ let ip;
|
|
|
+ uni.request({
|
|
|
+ url: "http://192.168.1.104:8082/targetdetail/targetdetail_histogram?pointKey=HB_GD_KBF_JS_P4_L19_220_CI0136",
|
|
|
+ success: (res) => {
|
|
|
+ ip = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
let _this = this;
|
|
|
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
|
|
|
this.socketTask_targetdetail_histogram = uni.connectSocket({
|
|
@@ -187,7 +207,7 @@ export default {
|
|
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
|
|
this.socketTask_targetdetail_histogram.onMessage(res => {
|
|
|
//console.log("收到服务器内容:" + res.data);
|
|
|
- _this.targetdetail.targetdetail_histogram = eval(res.data);
|
|
|
+ _this.targetdetail.targetdetail_histogram = JSON.parse(res.data)[ip];
|
|
|
|
|
|
let Column = {
|
|
|
"categories": ["04/11","04/12", "04/13", "04/14", "04/15", "04/16", "04/17"],
|