xiaohaizhao 1 rok pred
rodič
commit
03cda9cf12

+ 8 - 1
pages/facility/detail.vue

@@ -87,6 +87,7 @@ export default {
             }).then(res => {
                 console.log("设备详情", res)
                 if (this.cutoff(res.msg)) return;
+                this.setTabs(res.data.prodnum)
                 switch (res.data.status) {
                     case '在线':
                         res.data.bgColor = "#007aff";
@@ -100,11 +101,17 @@ export default {
                 }
                 this.detail = res.data;
                 if (init) {
-                    this.$refs.hd.getList(this.w_deviceid).then(num => this.tabsTop = num)
+                    this.$refs.hd.getList(this.w_deviceid, res.data.prodnum).then(num => this.tabsTop = num)
                     setTimeout(() => { this.changeTab({ name: this.showTab }, true) }, 100)
                 }
             })
         },
+        setTabs(prodnum) {
+            if (['FW01'].includes(prodnum)) {
+                this.showTab = '设备日志';
+                this.tabs.shift()
+            }
+        },
         changeTab({ name }, init = false) {
             this.showTab = name;
             page.show = false;

+ 18 - 4
pages/facility/modules/horizontalDirection.vue

@@ -25,18 +25,32 @@ export default {
         }
     },
     methods: {
-        getList(w_deviceid) {
+        getList(w_deviceid, prodnum) {
             return new Promise((resolve, reject) => {
+                let special = ["FW01"].includes(prodnum)
+                console.log("special", special)
                 this.$Http.basic({
-                    "id": 20230711165702,
+                    "id": special ? 20230628084901 : 20230711165702,
                     "content": {
                         w_deviceid
                     }
                 }).then(res => {
                     console.log("设备实时数据查询", res)
                     if (this.cutoff(res.msg)) return resolve(0)
-                    this.list = res.data;
-                    resolve(res.data.length ? 49 : 0)
+                    if (special) {
+                        if (["FW01"].includes(prodnum)) {
+                            const params = res.data.params,
+                                list = [];
+                            params.OpenDeg && list.push(params.OpenDeg)
+                            params.Voltage && list.push(params.Voltage)
+                            params.Longitude && list.push(params.Longitude)
+                            params.Latitude && list.push(params.Latitude)
+                            this.list = list;
+                        }
+                    } else {
+                        this.list = res.data;
+                    }
+                    resolve(this.list.length ? 49 : 0)
                 })
             })
         }