Ver código fonte

风门详情页数据展示

bobo04052021@163.com 3 semanas atrás
pai
commit
7e65f87c80

+ 10 - 6
pages/history/history.vue

@@ -193,13 +193,12 @@
                       "
                     >
                       {{
-                        item[showitem.monitorcode] == null ||
-                        item[showitem.monitorcode] == ""
+                        item.readData[showitem.monitorcode] == null ||
+                        item.readData[showitem.monitorcode] == ""
                           ? "-"
-                          : item[showitem.monitorcode]
+                          : item.readData[showitem.monitorcode]
                       }}
                     </view>
-
                     <view
                       class="demo-layout bg-purple-light"
                       style="
@@ -318,6 +317,7 @@ export default {
       hasMoreData: true, // 是否还有更多数据可以加载
       pageNo: 1, // 当前页码(用于请求数据时分页)
       stationType: "plc1", // 站点类型(用于请求数据时的参数)
+      strType: "", //设备小类
     };
   },
   components: {
@@ -373,6 +373,7 @@ export default {
             if (response.data.code == 200) {
               this.deviceList[type] = response.data.result.msgTxt[0].datalist;
               this.curlist = this.deviceList[type];
+              console.log(this.curlist, "设备列表");
               this.setData(this.curlist);
             } else {
               resolve(response);
@@ -392,6 +393,7 @@ export default {
           strinstallpos: element.strinstallpos,
           type: element.deviceType,
           stationType: element.stationType,
+          strtype: element.strtype,
         };
         this.devices.push(deviceObj);
       });
@@ -400,6 +402,7 @@ export default {
     selectDevice(e) {
       this.deviceID = e.value[0].id;
       this.stationType = e.value[0].stationType;
+      this.strType = e.value[0].strtype;
       // console.log(this.TabCur, "设备类型");
       this.deviceName = e.value[0].strinstallpos;
       this.deviceShow = false;
@@ -433,7 +436,6 @@ export default {
     //查询历史数据 getDeviceHistory
     checkHistory() {
       if (this.stationType !== "redis") {
-        console.log(this.stationType, "stationType");
         this.getHistoryData();
       } else {
         this.getHistoryData2();
@@ -486,13 +488,15 @@ export default {
     },
     getHistoryData2() {
       const params = {
+        column: "createTime",
         startTime: this.StartTime,
         endTIme: this.EndTime,
         deviceId: this.deviceID,
         interval: this.interval,
         isEmployee: true,
+        pageNo: 1,
         pageSize: 10,
-        strtype: this.TabCur,
+        strtype: this.strType,
       };
       new Promise((resolve, reject) => {
         api

+ 61 - 63
pages/home/detail/autodoor/autodoor.vue

@@ -78,7 +78,8 @@
             :cameralist="cameralist"
             :height="height"
             :doorcount="ndoorcount"
-          ></doorAnimate>
+          >
+          </doorAnimate>
         </div>
         <div class="flcard" v-if="this.TabCur == 'windrect'">
           <windrectAnimate
@@ -87,7 +88,8 @@
             :videoURL="viedeoUrl"
             :height="height"
             :type="deviceType"
-          ></windrectAnimate>
+          >
+          </windrectAnimate>
         </div>
         <div class="flcard" v-if="this.TabCur == 'fanlocal'">
           <fanlocalAnimate
@@ -96,7 +98,8 @@
             :title="title"
             :videoURL="viedeoUrl"
             :height="height"
-          ></fanlocalAnimate>
+          >
+          </fanlocalAnimate>
         </div>
         <div class="flcard" v-if="this.TabCur == 'fanmain'">
           <fanmainAnimate
@@ -139,76 +142,55 @@
           >
             <div
               class="itemback"
-              v-for="(item, index) in showColum[TabCur + '_detail']"
+              v-for="(item, index) in deviceShowList"
               :key="index"
-              v-show="item.appShow == 1"
+              v-show="
+                item.appShow == 1 &&
+                item.monitorcode != 'strinstallpos' &&
+                item.monitorcode != 'netStatus' &&
+                item.monitorcode != 'warnFlag' &&
+                item.monitorcode != 'readTime' &&
+                item.monitorcode != ''
+              "
             >
-              <div
-                class="datacardtime"
-                v-if="item.monitorcode == 'readTime' && item.datatype == 1"
-              >
-                <view
-                  class="demo-layout bg-purple-light"
-                  style="padding: 20rpx; color: #3787fe"
-                >
-                  {{ readTime }}
-                </view>
-              </div>
-              <div class="datacard" v-if="item.monitorcode !== 'readTime'">
+              <div class="datacard">
                 <div class="left-content">
                   <view
-                    v-if="item.monitorcode == 'ndoortype' && item.datatype == 1"
+                    v-if="item.datatype == 1 && item.monitorcode == 'doorUse'"
                     class="demo-layout bg-purple-light"
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData[item.monitorcode] == "1"
+                      tableData[item.monitorcode] == "2"
                         ? "行人"
-                        : tableData[item.monitorcode] == "2"
+                        : tableData[item.monitorcode] == "1"
                         ? "行车"
-                        : "--"
+                        : "-"
                     }}
                   </view>
                   <view
-                    v-else-if="
-                      item.monitorcode == 'netStatus' && item.datatype == 1
-                    "
-                    class="demo-layout bg-purple-light"
-                    style="margin-top: 60rpx; color: #3787fe"
-                  >
-                    {{ doorNetStatus == "1" ? "正常" : "异常" }}
-                  </view>
-                  <view
-                    v-else-if="
-                      item.monitorcode == 'warnFlag' && item.datatype == 1
-                    "
-                    class="demo-layout bg-purple-light"
-                    style="margin-top: 60rpx; color: #3787fe"
-                  >
-                    {{ warnFlag == "1" ? "正常" : "异常" }}
-                  </view>
-                  <view
                     v-else-if="item.datatype == 1"
                     class="demo-layout bg-purple-light"
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData[item.monitorcode] == null ||
-                      tableData[item.monitorcode] == ""
-                        ? "--"
-                        : tableData[item.monitorcode]
+                      tableData[item.monitorcode] != undefined &&
+                      tableData[item.monitorcode] != null
+                        ? tableData[item.monitorcode]
+                        : "-"
                     }}
                   </view>
+
                   <view
                     v-else-if="item.datatype == 2"
                     class="demo-layout bg-purple-light"
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData.readData[item.monitorcode] == null ||
-                      tableData.readData[item.monitorcode] == ""
-                        ? "--"
-                        : tableData.readData[item.monitorcode]
+                      tableData[item.monitorcode] != undefined &&
+                      tableData[item.monitorcode] != null
+                        ? tableData[item.monitorcode]
+                        : "-"
                     }}
                   </view>
                   <div class="spacer"></div>
@@ -281,17 +263,17 @@
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan1")
                           : item.monitorcode
                       ] !== undefined &&
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan1")
                           : item.monitorcode
                       ] !== null
-                        ? tableData.readData[
+                        ? tableData[
                             item.monitorcode.startsWith("Fan")
                               ? item.monitorcode.replace(/^Fan/, "Fan1")
                               : item.monitorcode
@@ -367,17 +349,17 @@
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan2")
                           : item.monitorcode
                       ] !== undefined &&
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan2")
                           : item.monitorcode
                       ] !== null
-                        ? tableData.readData[
+                        ? tableData[
                             item.monitorcode.startsWith("Fan")
                               ? item.monitorcode.replace(/^Fan/, "Fan2")
                               : item.monitorcode
@@ -455,17 +437,17 @@
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan1")
                           : item.monitorcode
                       ] !== undefined &&
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan1")
                           : item.monitorcode
                       ] !== null
-                        ? tableData.readData[
+                        ? tableData[
                             item.monitorcode.startsWith("Fan")
                               ? item.monitorcode.replace(/^Fan/, "Fan1")
                               : item.monitorcode
@@ -541,17 +523,17 @@
                     style="margin-top: 60rpx; color: #3787fe"
                   >
                     {{
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan2")
                           : item.monitorcode
                       ] !== undefined &&
-                      tableData.readData[
+                      tableData[
                         item.monitorcode.startsWith("Fan")
                           ? item.monitorcode.replace(/^Fan/, "Fan2")
                           : item.monitorcode
                       ] !== null
-                        ? tableData.readData[
+                        ? tableData[
                             item.monitorcode.startsWith("Fan")
                               ? item.monitorcode.replace(/^Fan/, "Fan2")
                               : item.monitorcode
@@ -671,6 +653,7 @@ export default {
       deviceid: "", //ID
       cameralist: [], //摄像数据
       showColum: {},
+      deviceShowList: [],
     };
   },
   onLoad(query) {
@@ -722,6 +705,14 @@ export default {
               var showlist = response.data.result;
               this.$store.commit("SET_SHOWCOLUM", showlist);
               this.showColum = showlist;
+              const key = this.TabCur + "_monitor";
+              const key1 = this.deviceType + "_monitor";
+              if (this.showColum[key1].length > 0) {
+                this.deviceShowList = this.showColum[key1];
+              } else {
+                this.deviceShowList = this.showColum[key];
+              }
+              // this.deviceShowList = this.showColum[key];
             } else {
               resolve(response);
             }
@@ -767,18 +758,25 @@ export default {
               response.data.result.msgTxt[0].datalist.length > 0
             ) {
               var result = response.data.result.msgTxt[0].datalist[0];
-              this.tableData = result;
-              if (this.tableData.frontGateOpen == "1") {
+              let newData = { ...result, ...result.readData };
+              this.tableData = newData;
+              if (this.tableData["frontGateClose"] == "1") {
+                this.tableData.frontGateOpen = "关闭";
+              } else if (this.tableData["frontGateClose"] == "0") {
                 this.tableData.frontGateOpen = "打开";
               } else {
                 this.tableData.frontGateOpen = "关闭";
               }
-              if (this.tableData.midGateOpen == "1") {
+              if (this.tableData["midGateClose"] == "1") {
+                this.tableData.midGateOpen = "关闭";
+              } else if (this.tableData["midGateClose"] == "0") {
                 this.tableData.midGateOpen = "打开";
               } else {
                 this.tableData.midGateOpen = "关闭";
               }
-              if (this.tableData.rearGateOpen == "1") {
+              if (this.tableData["rearGateClose"] == "1") {
+                this.tableData.rearGateOpen = "关闭";
+              } else if (this.tableData["rearGateClose"] == "0") {
                 this.tableData.rearGateOpen = "打开";
               } else {
                 this.tableData.rearGateOpen = "关闭";

+ 20 - 0
pages/home/detail/doorAnimate/doorAnimate.vue

@@ -15,6 +15,7 @@
             "
             id="leftdoor1"
           ></div>
+          <div class="doortitle">风门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -44,6 +45,7 @@
             "
             id="leftdoor2"
           ></div>
+          <div class="doortitle">前门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -70,6 +72,7 @@
             "
             id="leftdoor3"
           ></div>
+          <div class="doortitle">后门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -98,6 +101,7 @@
             "
             id="leftdoor4"
           ></div>
+          <div class="doortitle">前门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -124,6 +128,7 @@
             "
             id="leftdoor5"
           ></div>
+          <div class="doortitle">中门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -150,6 +155,7 @@
             "
             id="leftdoor6"
           ></div>
+          <div class="doortitle">后门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -190,6 +196,7 @@
             "
             id="leftdoor7"
           ></div>
+          <div class="doortitle">1号门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -216,6 +223,7 @@
             "
             id="leftdoor8"
           ></div>
+          <div class="doortitle">2号门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -242,6 +250,7 @@
             "
             id="leftdoor9"
           ></div>
+          <div class="doortitle">3号门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -268,6 +277,7 @@
             "
             id="leftdoor10"
           ></div>
+          <div class="doortitle">4号门</div>
           <div
             class="right_door"
             v-bind:class="
@@ -429,4 +439,14 @@ div.right_door {
     div.door:hover div.right_door{
         transform:rotateY(-100deg);
     }*/
+.doortitle {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  font-size: 20px;
+  color: #fff;
+  z-index: 999;
+  text-align: center;
+}
 </style>

+ 2 - 2
pages/home/home.vue

@@ -74,8 +74,7 @@
                       showitem.monitorcode != 'strinstallpos' &&
                       showitem.monitorcode != 'netStatus' &&
                       showitem.monitorcode != 'warnFlag' &&
-                      showitem.monitorcode != 'readTime' &&
-                      showitem.monitorcode != ''
+                      showitem.monitorcode != 'readTime'
                     "
                   >
                     <view
@@ -462,6 +461,7 @@ export default {
     this.colums = this.showColum;
     const key = this.TabCur + "_monitor";
     this.deviceShowList = this.colums[key];
+    this.loadData("gate");
   },
   async mounted() {
     await this.loadData(this.TabCur);

+ 14 - 26
pages/warndata/warndata.vue

@@ -241,7 +241,7 @@ export default {
       backPic: "url(../../static/topnavbar.png)",
       titleName: "预警分析",
       isShowDetail: true,
-      detailComponent: "",
+      detailComponent: null,
       windData: {},
       devicekindData: [],
       fireData: [],
@@ -330,31 +330,19 @@ export default {
       this.isShowDetail = true;
     },
     //跳转监测详情
-    getDetail(data) {
-      this.isShowDetail = false;
-      switch (data) {
-        case "vent":
-          this.titleName = "通风监测预警";
-          this.detailComponent = ventDetail;
-          break;
-        case "device":
-          this.titleName = "设备监测预警";
-          this.detailComponent = deviceDetail;
-          break;
-        case "fire":
-          this.titleName = "火灾监测预警";
-          this.detailComponent = fireDetail;
-          break;
-        case "dust":
-          this.titleName = "粉尘监测预警";
-          this.detailComponent = dustDetail;
-          break;
-        case "gas":
-          this.titleName = "瓦斯监测预警";
-          this.detailComponent = gasDetail;
-          break;
-      }
-    },
+    // getDetail(data) {
+    //   const componentMap = {
+    //     vent: { title: "通风监测预警", component: ventDetail },
+    //     device: { title: "设备监测预警", component: deviceDetail },
+    //     fire: { title: "火灾监测预警", component: fireDetail },
+    //     dust: { title: "粉尘监测预警", component: dustDetail },
+    //     gas: { title: "瓦斯监测预警", component: gasDetail },
+    //   };
+    //   const config = componentMap[data] || {};
+    //   this.titleName = config.title;
+    //   this.isShowDetail = false;
+    //   this.detailComponent = config.component;
+    // },
     toggleIsShow1() {
       this.isShow1 = !this.isShow1; // 切换 isShow 的值
     },