From 687ce34f03c76a9e44a3995f6adfa5bd73cc20bc Mon Sep 17 00:00:00 2001 From: Iruka <1017819588@qq.com> Date: Tue, 18 Feb 2025 12:01:35 +0800 Subject: [PATCH] . --- .../custom-index-mp/custom-index-mp.vue | 22 ++++++++++++------- pages/index-map.vue | 11 ++++++++-- pages/index.vue | 12 ++++++++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/components/custom-index-mp/custom-index-mp.vue b/components/custom-index-mp/custom-index-mp.vue index 5b2bf49..c579844 100644 --- a/components/custom-index-mp/custom-index-mp.vue +++ b/components/custom-index-mp/custom-index-mp.vue @@ -46,6 +46,7 @@ } from "@/api/controlMpInterface.js" export default { name: "Mp", + emits: ["topic"], components: {}, props: {}, data() { @@ -72,16 +73,16 @@ this.landId = land.id; this.mpId = mpId; this.open = true; - this.getList(); + this.getList(this.landId, this.mpId); }, close() { this.open = false; }, - getList() { + getList(landId, mpId) { this.list = []; const query = { - landId: this.landId, - id: this.mpId + landId: landId, + id: mpId } getMpDeviceList(query).then((res) => { let list = {}; @@ -108,17 +109,22 @@ }, refreshSoilTilth() { let refresh = []; + let topic = []; this.list.forEach(item => { if (refresh.findIndex(x => x.deviceCode == item.deviceCode) == -1) { let mp = { - deviceCode: item.deviceCode, - lv: item.floors + deviceCode: item.data[0].deviceCode, + lv: item.data[0].floors }; refresh.push(mp); } + let _topic = "jsy/iot/mp/" + item.data[0].deviceCode + if (!topic.includes(_topic)) { + topic.push(_topic); + } }); - mpRefresh(refresh).then((res) => { - }); + this.$emit('topic', topic); + mpRefresh(refresh).then((res) => {}); } } } diff --git a/pages/index-map.vue b/pages/index-map.vue index 6c13990..10c43d2 100644 --- a/pages/index-map.vue +++ b/pages/index-map.vue @@ -458,7 +458,7 @@ - +