From 390216761c70dabb4342b463b308d879ddb0926e Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Wed, 22 Feb 2023 14:51:33 +0800 Subject: [PATCH] 20230222 --- src/components/chart/lineChart.vue | 4 +- src/views/bounced/analysisConfiguration.vue | 8 +-- src/views/bounced/dataBoard.vue | 65 +++++++++++++-------- src/views/bounced/form.vue | 5 +- src/views/index.vue | 3 +- 5 files changed, 53 insertions(+), 32 deletions(-) diff --git a/src/components/chart/lineChart.vue b/src/components/chart/lineChart.vue index 76e983d5..9f2f0328 100644 --- a/src/components/chart/lineChart.vue +++ b/src/components/chart/lineChart.vue @@ -147,13 +147,13 @@ export default { } }, mounted() { - this.drawLine(); + // this.drawLine(); }, watch: { list: { handler(newVal) { if (newVal ) { - + // x轴的数据 this.xData = newVal.map(val => { return val.time; diff --git a/src/views/bounced/analysisConfiguration.vue b/src/views/bounced/analysisConfiguration.vue index f37d5c1b..29d3f768 100644 --- a/src/views/bounced/analysisConfiguration.vue +++ b/src/views/bounced/analysisConfiguration.vue @@ -737,9 +737,9 @@ export default { OnSceneload(newV) { var ip = window.location.host; this.ipData = 'http://' + ip.split(':')[0] + ':5000'; - // document.getElementById('mapModule').contentWindow.getIpData(this.ipData); + document.getElementById('mapModule').contentWindow.getIpData(this.ipData); this.$refs.analysisWeb.contentWindow.getIpData('http://172.16.1.168:5000'); - this.$refs.analysisWeb.contentWindow.getDianwei(this.$route.query.id); + // this.$refs.analysisWeb.contentWindow.getDianwei(this.$route.query.id); this.unityDone = true; }, handleDeleteDian(row, idx) { @@ -1046,8 +1046,8 @@ export default { // const host = 'ws://49.234.27.18:10087/'; // 一个测试用url,改成给的,ws://broker.emqx.io:8083/mqtt var ip = window.location.host.split(":")[0]; console.log("ip",ip) - // const host = `ws://${ip}:10087`; - const host = 'ws://172.16.1.168:10087/'; + const host = `ws://${ip}:10087`; + // const host = 'ws://172.16.1.168:10087/'; const options = { // 配置 // 测试:订阅本机IP diff --git a/src/views/bounced/dataBoard.vue b/src/views/bounced/dataBoard.vue index 02199d8b..f064a993 100644 --- a/src/views/bounced/dataBoard.vue +++ b/src/views/bounced/dataBoard.vue @@ -350,12 +350,23 @@ export default { typeValue: {}, // 周期时刻的数值看板展示 typeCycleTimeData: {}, - typeCycleStatistics: {} + typeCycleStatistics: {}, + nw:'1' }; }, created() { this.idVal = this.$route.query.id; - getComponentSection({ VideoId: this.idVal }).then((res) => { + this.sectionData=[] + this.sectionArr=[] + // if(this.nw=='second'){ + + // } + // this.getNEW() + + }, + methods: { + getNEW(){ + getComponentSection({ VideoId: this.$route.query.id }).then((res) => { if (res.data.code == 200) { this.componentList = res.data.data this.siftData() @@ -377,13 +388,10 @@ export default { } else if (res.data.code == 404) { } }); - - }, - methods: { - + }, siftData() { - // this.sectionData=[] - // this.sectionArr=[] + this.sectionArr=[] + this.sectionData=[] this.componentList.forEach((val) => { this.sectionArr.push(val.combinationName); this.sectionArr = Array.from(new Set(this.sectionArr)); @@ -427,7 +435,13 @@ export default { } }, - + channge(oldVal,newVal){ + if (newVal == "second") { + this.getNEW() + }else if(oldVal == "second"){ + this.getNEW() + } + } // 触发数据的类型数值 @@ -435,22 +449,25 @@ export default { mounted() { }, watch: { - activeName: { - handler(newVal) { - console.log("newVal",newVal) - if (newVal == "second") { - getComponentSection({ VideoId: this.$route.query.id }).then(res => { - // if (res.data.code == 200) { - this.componentList = res.data.data; - this.siftData(); - // } else if (res.data.code == 404) { - // } - }); - } + // activeName: { + // handler(newVal) { + // console.log("newVal",newVal) + // if (newVal == "second") { + // // getComponentSection({ VideoId: this.$route.query.id }).then(res => { + // // if (res.data.code == 200) { + // // this.componentList = res.data.data; + // // this.siftData(); + // // } else if (res.data.code == 404) { + // // } + // // }); + // // this.nw=newVal + // this.getNEW() + // } - }, - immediate: true - }, + // }, + // immediate: true + // }, + activeName:'channge', // 触发的原始数据 triggerData: { handler(newVal, oldVal) { diff --git a/src/views/bounced/form.vue b/src/views/bounced/form.vue index 3173a9f1..a3f9f4b4 100644 --- a/src/views/bounced/form.vue +++ b/src/views/bounced/form.vue @@ -409,7 +409,10 @@ export default { getDataByMqtt(url, topic, cIdNum) { const clientId = "test_id_" + String(new Date().getTime()); // 用户名 // const host = 'ws://49.234.27.18:10087/'; // 一个测试用url,改成给的,ws://broker.emqx.io:8083/mqtt - const host = 'ws://172.16.1.168:10087/'; + var ip = window.location.host.split(":")[0]; + console.log("ip",ip) + const host = `ws://${ip}:10087`; + // const host = 'ws://172.16.1.168:10087/'; const options = { // 配置 diff --git a/src/views/index.vue b/src/views/index.vue index c378fdaf..78d743ce 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -172,7 +172,7 @@ - +