Browse Source

设备中心列表页详情页bug修改

bobo04052021@163.com 3 days ago
parent
commit
99ff4c82c0

+ 56 - 62
api/api.js

@@ -24,36 +24,36 @@ const apiService = {
     const url = buildURL("/safety/gasDayReport/taskDetailsList", params);
     return http.get(url);
   },
-  
+
   /**
    * 单点登录
    */
   // validateCasLogin(params) {
-	 //  var index = 0;
-	 //  var url = "/sys/cas/client/validateLogin";
-	 //  for(var w in params){
-		//   if(index == 0)
-		//   url = url+"?"+w+"="+params[w];
-		//   else
-		//   url = url+"&"+w+"="+params[w];
-		//   index++;
-	 //  }
+  //  var index = 0;
+  //  var url = "/sys/cas/client/validateLogin";
+  //  for(var w in params){
+  //   if(index == 0)
+  //   url = url+"?"+w+"="+params[w];
+  //   else
+  //   url = url+"&"+w+"="+params[w];
+  //   index++;
+  //  }
   //   return http.get(url);
   // },
 
-  validateCasLogin(to,params) {
-	  var url = to+"/sys/cas/client/validateLogin"+params;
-	  // var index = 0;
-	  // var url = "/sys/cas/client/validateLogin";
-	  // for(var w in params){
-		 //  if(index == 0)
-		 //  url = url+"?"+w+"="+params[w];
-		 //  else
-		 //  url = url+"&"+w+"="+params[w];
-		 //  index++;
-	  // }
-	  console.log("validateCasLogin url============"+url)
-    return http.get(url,{});
+  validateCasLogin(to, params) {
+    var url = to + "/sys/cas/client/validateLogin" + params;
+    // var index = 0;
+    // var url = "/sys/cas/client/validateLogin";
+    // for(var w in params){
+    //  if(index == 0)
+    //  url = url+"?"+w+"="+params[w];
+    //  else
+    //  url = url+"&"+w+"="+params[w];
+    //  index++;
+    // }
+    console.log("validateCasLogin url============" + url);
+    return http.get(url, {});
   },
   /**
    * 手机号码登录
@@ -81,10 +81,7 @@ const apiService = {
   },
   // 获取工作面煤层下拉选项
   getDictItems(params) {
-    const url = buildURL(
-      "/sys/api/getDictItems",
-      params
-    );
+    const url = buildURL("/sys/api/getDictItems", params);
     return http.get(url);
   },
   // 按系统查询设备监测信息
@@ -123,18 +120,12 @@ const apiService = {
 
   //瓦斯日报列表数据
   getGas(params) {
-    const url = buildURL(
-      "/safety/gasDayReport/list",
-      params
-    );
+    const url = buildURL("/safety/gasDayReport/list", params);
     return http.get(url);
   },
   //瓦斯日报-下拉选项
   getSelect(params) {
-    const url = buildURL(
-      "/safety/gasDayReport/getGasAddressList",
-      params
-    );
+    const url = buildURL("/safety/gasDayReport/getGasAddressList", params);
     return http.get(url);
   },
   //瓦斯日报-新增保存
@@ -152,10 +143,7 @@ const apiService = {
   },
   //获取设备历史数据
   getDeviceHistory(params) {
-    const url = buildURL(
-      "/ventanaly-device/safety/ventanalyMonitorData/listdays",
-      params
-    );
+    const url = buildURL("/safety/ventanalyMonitorData/listdays", params);
     return http.get(url);
   },
   //获取操作历史
@@ -176,29 +164,35 @@ const apiService = {
   },
   //获取通风预警监测详情tab信息
   sysTypeWarn(params) {
-    return http.post("/ventanaly-device/safety/ventanalyAlarmLog/sysTypeWarn", params);
-  },
-   //获取通风预警监测详情信息
-   sysWarn(params) {
-    return http.post("/ventanaly-device/safety/ventanalyAlarmLog/sysWarn", params);
-  },
-    //获取通风预警监测详情信息
-    getDeviceVent(params) {
-      return http.post("/ventanaly-device/monitor/device", params);
-    },
-  
-    //获取设备预警实时监测数据
-    warningList(params) {
-      const url = buildURL("/safety/ventanalyAlarmLog/now_alarmlist", params);
-      return http.get(url);
-    },
-   
-    //获取设备预警历史监测数据
-    historyList(params) {
-      const url = buildURL("/safety/ventanalyAlarmLog/list", params);
-      return http.get(url);
-    },
-  
+    return http.post(
+      "/ventanaly-device/safety/ventanalyAlarmLog/sysTypeWarn",
+      params
+    );
+  },
+  //获取通风预警监测详情信息
+  sysWarn(params) {
+    return http.post(
+      "/ventanaly-device/safety/ventanalyAlarmLog/sysWarn",
+      params
+    );
+  },
+  //获取通风预警监测详情信息
+  getDeviceVent(params) {
+    return http.post("/ventanaly-device/monitor/device", params);
+  },
+
+  //获取设备预警实时监测数据
+  warningList(params) {
+    const url = buildURL("/safety/ventanalyAlarmLog/now_alarmlist", params);
+    return http.get(url);
+  },
+
+  //获取设备预警历史监测数据
+  historyList(params) {
+    const url = buildURL("/safety/ventanalyAlarmLog/list", params);
+    return http.get(url);
+  },
+
   getFilePreview(params) {
     return http.post("/ventanaly-sharefile/fileServer/preview", params);
   },

+ 3 - 2
common/service/config.service.js

@@ -11,16 +11,17 @@ if (process.env.NODE_ENV == "development") {
   BASE_URL = "http://10.246.183.35:9999"; // 乌兰木伦
   // BASE_URL = "http://10.120.120.164:9999"; // 察哈素
   // BASE_URL = "http://182.92.126.35:9999"; // 生产环境
-  // BASE_URL = "http://172.16.53.16:9999"; // 
+  // BASE_URL = "http://172.16.53.16:9999"; //
   // BASE_URL = "http://10.246.167.205:9999"; //上湾
   // BASE_URL = "http://172.30.157.9:9999"; //元子沟
   // BASE_URL = "http://10.246.167.205:9999"; //上湾
+  // BASE_URL = "http://10.248.135.121:9999"; //活鸡兔井
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";
 
 const configService = {
   apiUrl: BASE_URL,
-  apiUrlP: 'http://10.246.167.205:6006',
+  apiUrlP: "http://10.246.167.205:6006",
   staticDomainURL: staticDomainURL,
 };
 

+ 94 - 27
pages/history/history.vue

@@ -41,6 +41,12 @@
               :text="deviceName ? deviceName : '选择设备'"
               @click="deviceShow = true"
             ></u-button>
+            <!-- <u-button
+              v-show="TabCur == 'fanmain' || TabCur == 'fanlocal'"
+              type="primary"
+              :text="labelName ? labelName : '子设备'"
+              @click="deviceShow1 = true"
+            ></u-button> -->
             <u-button
               type="primary"
               :text="lable ? lable : '间隔时间'"
@@ -61,6 +67,13 @@
           >
           </u-picker>
           <u-picker
+            :show="deviceShow1"
+            :columns="devices1"
+            @cancel="deviceShow1 = false"
+            @confirm="selectDevice1"
+            keyName="label"
+          ></u-picker>
+          <u-picker
             :show="show"
             :columns="timeColumns"
             @cancel="show = false"
@@ -108,44 +121,82 @@
                   <u--text class="timetext" :text="item.ttime"></u--text>
                 </u-col>
               </u-row>
-              <div
+              <view
                 class="datacard"
-                v-for="(showitem, index) in currentHistory"
-                v-show="showitem.appshow == 1"
-                :key="showitem.id + index"
+                v-for="(showitem, index) in deviceShowList"
+                :key="index"
+                v-show="showitem.appShow == 1"
               >
-                <div class="content">
+                <view
+                  :class="TabCur"
+                  style="
+                    padding-top: 10rpx;
+                    padding-bottom: 10rpx;
+                    display: flex;
+                    flex-direction: column;
+                    align-items: center;
+                    height: 100%;
+                  "
+                >
+                  <view
+                    v-if="
+                      showitem.datatype == 1 &&
+                      showitem.monitorcode == 'doorUse'
+                    "
+                    class="demo-layout bg-purple-light"
+                    style="
+                      margin-top: 10rpx;
+                      color: #3787fe;
+                      font-size: 30rpx;
+                      margin-top: 20rpx;
+                    "
+                  >
+                    {{
+                      item[showitem.monitorcode] == "2"
+                        ? "行人"
+                        : item[showitem.monitorcode] == "1"
+                        ? "行车"
+                        : "-"
+                    }}
+                  </view>
                   <view
-                    v-if="showitem.datatype == 1"
+                    v-else-if="showitem.datatype == 1"
                     class="demo-layout bg-purple-light"
-                    style="margin-top: 60rpx; color: #3787fe"
+                    style="
+                      margin-top: 10rpx;
+                      color: #3787fe;
+                      font-size: 30rpx;
+                      margin-top: 20rpx;
+                    "
                   >
                     {{
                       item[showitem.monitorcode] == null ||
                       item[showitem.monitorcode] == ""
-                        ? "--"
+                        ? "-"
                         : item[showitem.monitorcode]
                     }}
                   </view>
                   <view
                     v-else-if="showitem.datatype == 2"
                     class="demo-layout bg-purple-light"
-                    style="margin-top: 60rpx; color: #3787fe"
+                    style="color: #3787fe; font-size: 30rpx; margin-top: 20rpx"
                   >
                     {{
-                      item.readData[showitem.monitorcode] == null ||
-                      item.readData[showitem.monitorcode] == ""
-                        ? "--"
-                        : item.readData[showitem.monitorcode]
+                      item[showitem.monitorcode] == null ||
+                      item[showitem.monitorcode] == ""
+                        ? "-"
+                        : item[showitem.monitorcode]
                     }}
                   </view>
+
                   <view
                     class="demo-layout bg-purple-light"
-                    style="color: #3787fe"
-                    >{{ showitem.des }}</view
+                    style="margin-top: 20rpx; color: #677799; margin-top: 20rpx"
                   >
-                </div>
-              </div>
+                    {{ showitem.des }}
+                  </view>
+                </view>
+              </view>
             </u-list-item>
           </template>
           <template v-else>
@@ -174,12 +225,26 @@ export default {
       endDate: null,
       show: false,
       deviceShow: false,
+      deviceShow1: false,
       dataShow: false,
       dataShow1: false,
       StartTime: "", //起始时间
       EndTime: "", //结束时间
       devices: [], //设备类型数组
+      devices1: [
+        [
+          {
+            label: "1#风机",
+            value: "fan1",
+          },
+          {
+            label: "2#风机",
+            value: "fan2",
+          },
+        ],
+      ], //子设备类型数组
       deviceName: "", //设备名称
+      labelName: "", //子设备名称
       timeS: "", //间隔时间
       lable: "", //间隔时间
       timeColumns: [
@@ -223,6 +288,7 @@ export default {
       skip: 8, //时间间隔
       dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
       historyData: [], //历史数据
+      deviceShowList: [],
       loading: false, // 是否正在加载数据
       hasMoreData: true, // 是否还有更多数据可以加载
       pageNo: 1, // 当前页码(用于请求数据时分页)
@@ -255,6 +321,8 @@ export default {
   },
   created() {
     this.colums = this.showColum;
+    const key = this.TabCur + "_history";
+    this.deviceShowList = this.colums[key];
     const startTime = new Date().getTime() - 3600 * 1000 * 24 * 30;
     const endTime = new Date();
     this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
@@ -265,11 +333,7 @@ export default {
     this.loadData(this.TabCur);
   },
 
-  computed: {
-    currentHistory() {
-      return this.colums[this.TabCur + "_history"] || [];
-    },
-  },
+  computed: {},
   methods: {
     loadData(type) {
       new Promise((resolve, reject) => {
@@ -308,10 +372,16 @@ export default {
     //选择设备  点击确定按钮  保存id
     selectDevice(e) {
       this.deviceID = e.value[0].id;
-      this.TabCur = e.value[0].type;
+      // this.TabCur = e.value[0].type;
+      // console.log(this.TabCur, "设备类型");
       this.deviceName = e.value[0].strinstallpos;
       this.deviceShow = false;
     },
+    selectDevice1(e) {
+      this.deviceNum = e.value[0].value;
+      this.labelName = e.value[0].label;
+      this.deviceShow1 = false;
+    },
     //选择起始时间
     selectStartTime(e) {
       const startTime = e.value;
@@ -334,7 +404,6 @@ export default {
     },
     //查询历史数据 getDeviceHistory
     checkHistory() {
-      // debugger;
       const params = {
         ttime_begin: this.StartTime,
         ttime_end: this.EndTime,
@@ -351,7 +420,7 @@ export default {
             debugger;
             if (response.data.code == 200) {
               const infolist = response.data.result;
-              this.historyData = infolist.datalist.records;
+              this.historyData = infolist.records;
               this.historyData.forEach((item) => {
                 if (item.readData.frontGateOpen == 1) {
                   item.readData.frontGateOpen = "打开";
@@ -422,7 +491,6 @@ export default {
     },
     devicemenuShow(e) {
       this.menushow = !this.menushow;
-      console.log(this.menushow, "dainjichengg成都多大事");
     },
     menuClick(id) {
       this.TabCur = id;
@@ -464,7 +532,6 @@ export default {
 .content {
   width: 100%;
   display: flex;
-  height: 290rpx;
   flex-direction: column;
 }
 .main {

+ 177 - 14
pages/home/detail/autodoor/autodoor.vue

@@ -133,10 +133,13 @@
           ></windowAnimate>
         </div>
         <div class="flcard">
-          <div class="flex-container">
+          <div
+            class="flex-container"
+            v-if="TabCur != 'fanlocal' && TabCur != 'fanmain'"
+          >
             <div
               class="itemback"
-              v-for="(item, index) in typeList"
+              v-for="(item, index) in showColum[TabCur + '_detail']"
               :key="index"
               v-show="item.appShow == 1"
             >
@@ -252,6 +255,134 @@
               </div>
             </div>
           </div>
+          <div class="flex-container" v-else-if="TabCur == 'fanmain'">
+            <!-- <div>主机</div> -->
+            <div
+              class="itemback"
+              v-for="(item, index) in showColum[TabCur + '_monitor_left']"
+              :key="index"
+              v-show="item.appShow == 1"
+            >
+              <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="left-content">
+                  <view
+                    v-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.datatype == 1"
+                    class="demo-layout bg-purple-light"
+                    style="margin-top: 60rpx; color: #3787fe"
+                  >
+                    {{
+                      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] !== undefined &&
+                      tableData.readData[item.monitorcode] !== null
+                        ? tableData.readData[item.monitorcode]
+                        : "-"
+                    }}
+                  </view>
+                  <div class="spacer"></div>
+                  <!-- 间距 -->
+                  <view
+                    class="demo-layout bg-purple-light"
+                    style="color: #677799"
+                  >
+                    {{ item.des }}
+                  </view>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="flex-container" v-else-if="TabCur == 'fanlocal'">
+            <!-- <div>主机</div> -->
+            <div
+              class="itemback"
+              v-for="(item, index) in showColum[TabCur + '_monitor_right']"
+              :key="index"
+              v-show="item.appShow == 1"
+            >
+              <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="left-content">
+                  <view
+                    v-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.datatype == 1"
+                    class="demo-layout bg-purple-light"
+                    style="margin-top: 60rpx; color: #3787fe"
+                  >
+                    {{
+                      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] !== undefined &&
+                      tableData.readData[item.monitorcode] !== null
+                        ? tableData.readData[item.monitorcode]
+                        : "-"
+                    }}
+                  </view>
+                  <div class="spacer"></div>
+                  <!-- 间距 -->
+                  <view
+                    class="demo-layout bg-purple-light"
+                    style="color: #677799"
+                  >
+                    {{ item.des }}
+                  </view>
+                </div>
+              </div>
+            </div>
+          </div>
         </div>
       </view>
     </view>
@@ -351,6 +482,7 @@ export default {
       fan2State: "",
       deviceid: "", //ID
       cameralist: [], //摄像数据
+      showColum: {},
     };
   },
   onLoad(query) {
@@ -368,7 +500,7 @@ export default {
     fanmainAnimate,
   },
   created() {
-    this.getShowList(this.TabCur);
+    this.getShowColum();
     this.getDeviceInfo(this.itemId);
     this.getVideoUrlById(this.itemId);
   },
@@ -393,29 +525,48 @@ export default {
         delta: 1,
       });
     },
-    //获取app展示字段数据
-    getShowList(type) {
-      const params = {
-        devicekind: type,
-        pagetype: "monitor",
-        pageNo: 1,
-        pageSize: 100,
-      };
+    getShowColum() {
       new Promise((resolve, reject) => {
         api
-          .getShowColumList(params)
+          .getShowColum({})
           .then((response) => {
             if (response.data.code == 200) {
-              this.typeList = response.data.result.records;
+              var showlist = response.data.result;
+              this.$store.commit("SET_SHOWCOLUM", showlist);
+              this.showColum = showlist;
             } else {
               resolve(response);
             }
           })
           .catch((error) => {
+            console.log("catch===>response", response);
             reject(error);
           });
       });
     },
+    // //获取app展示字段数据
+    // getShowList(type) {
+    //   const params = {
+    //     devicekind: type,
+    //     pagetype: "detail",
+    //     pageNo: 1,
+    //     pageSize: 100,
+    //   };
+    //   new Promise((resolve, reject) => {
+    //     api
+    //       .getShowColumList(params)
+    //       .then((response) => {
+    //         if (response.data.code == 200) {
+    //           this.typeList = response.data.result.records;
+    //         } else {
+    //           resolve(response);
+    //         }
+    //       })
+    //       .catch((error) => {
+    //         reject(error);
+    //       });
+    //   });
+    // },
     //获取详情数据
     getDeviceInfo(ID) {
       let IDString = String(ID); // 将 ID 转换为字符串
@@ -456,6 +607,9 @@ export default {
               this.doorNetStatus = result.netStatus;
               this.warnFlag = result.warnLevel_str;
               this.readTime = result.readTime;
+              this.qidongfengji = result.readData.Fan1StartStatus
+                ? result.readData.Fan1StartStatus
+                : result.readData.Fan2StartStatus;
               var maxarea = result.maxarea;
               this.windowAngle =
                 (this.tableData.forntArea / maxarea) * 100 * 0.9;
@@ -561,7 +715,16 @@ export default {
   grid-template-columns: repeat(4, 1fr);
   gap: 5px; /* 可以根据需要调整行列之间的间距 */
 }
-
+.fanContent {
+  display: flex;
+  flex-direction: column;
+  margin-top: 10rpx;
+  margin-bottom: 10rpx;
+}
+.top,
+.bottom {
+  flex: 1; /* 各占 50% */
+}
 .flcard {
   padding: 20rpx;
   background-color: #ffffff;

+ 4 - 13
pages/home/detail/fanmainAnimate/fanmainAnimate.vue

@@ -485,20 +485,11 @@ export default {
     // 风机动画
     setFengjiDonghua() {
       if (this.nowfengji == "2") {
-        if (configUrl.group != "lh") {
-          document.getElementById("box1").style.animationPlayState = "running";
-          document.getElementById("box1").style.WebkitAnimationPlayState =
-            "running";
-          document.getElementById("box2").style.animationPlayState = "paused";
-          document.getElementById("box2").style.WebkitAnimationPlayState =
-            "paused";
-        }
-        document.getElementById("box1-s").style.animationPlayState = "running";
-        document.getElementById("box1-s").style.WebkitAnimationPlayState =
+        document.getElementById("box1").style.animationPlayState = "running";
+        document.getElementById("box1").style.WebkitAnimationPlayState =
           "running";
-
-        document.getElementById("box2-s").style.animationPlayState = "paused";
-        document.getElementById("box2-s").style.WebkitAnimationPlayState =
+        document.getElementById("box2").style.animationPlayState = "paused";
+        document.getElementById("box2").style.WebkitAnimationPlayState =
           "paused";
       } else if (this.nowfengji == "1") {
         if (configUrl.group != "lh") {

+ 269 - 8
pages/home/home.vue

@@ -40,7 +40,7 @@
                       <span style="float: right">连接</span>
                     </div>
                   </u-col>
-                  <u-col span="4">
+                  <u-col span="6">
                     <div v-if="item.warnFlag == 0" class="success-tag">
                       <image
                         src="/static/model/alarmTrue.svg"
@@ -60,14 +60,14 @@
                       }}</span>
                     </div>
                   </u-col>
-                  <u-col span="5">
+                  <u-col span="3">
                     <u--text class="timetext" :text="item.readTime"></u--text>
                   </u-col>
                 </u-row>
-                <view v-if="colums[TabCur + '_detail'] != null">
+                <view v-if="TabCur != 'fanmain' && TabCur != 'fanlocal'">
                   <view
                     class="datacard"
-                    v-for="(showitem, index) in colums[TabCur + '_detail']"
+                    v-for="(showitem, index) in deviceShowList"
                     :key="index"
                     v-show="
                       showitem.appShow == 1 &&
@@ -157,6 +157,257 @@
                     </view>
                   </view>
                 </view>
+
+                <div class="fanContent" v-else>
+                  <div class="top">
+                    <view>主机</view>
+                    <view
+                      class="datacard"
+                      v-for="(showitem, index) in deviceShowList"
+                      :key="index"
+                      v-show="
+                        showitem.appShow == 1 &&
+                        showitem.monitorcode != 'strinstallpos' &&
+                        showitem.monitorcode != 'netStatus' &&
+                        showitem.monitorcode != 'warnFlag' &&
+                        showitem.monitorcode != 'readTime' &&
+                        showitem.monitorcode != ''
+                      "
+                    >
+                      <view
+                        :class="TabCur"
+                        style="
+                          padding-top: 10rpx;
+                          padding-bottom: 10rpx;
+                          display: flex;
+                          flex-direction: column;
+                          align-items: center;
+                          height: 100%;
+                        "
+                      >
+                        <view
+                          v-if="
+                            showitem.datatype == 1 &&
+                            showitem.monitorcode == 'doorUse'
+                          "
+                          class="demo-layout bg-purple-light"
+                          style="
+                            margin-top: 10rpx;
+                            color: #3787fe;
+                            font-size: 30rpx;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{
+                            item[showitem.monitorcode] == "2"
+                              ? "行人"
+                              : item[showitem.monitorcode] == "1"
+                              ? "行车"
+                              : "-"
+                          }}
+                        </view>
+                        <view
+                          v-else-if="showitem.datatype == 1"
+                          class="demo-layout bg-purple-light"
+                          style="
+                            margin-top: 10rpx;
+                            color: #3787fe;
+                            font-size: 30rpx;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{
+                            item[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan1")
+                                : showitem.monitorcode
+                            ] !== undefined &&
+                            item[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan1")
+                                : showitem.monitorcode
+                            ] !== null
+                              ? item[
+                                  showitem.monitorcode.startsWith("Fan")
+                                    ? showitem.monitorcode.replace(
+                                        /^Fan/,
+                                        "Fan1"
+                                      )
+                                    : showitem.monitorcode
+                                ]
+                              : "-"
+                          }}
+                        </view>
+                        <view
+                          v-else-if="showitem.datatype == 2"
+                          class="demo-layout bg-purple-light"
+                          style="
+                            color: #3787fe;
+                            font-size: 30rpx;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{
+                            item.readData[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan1")
+                                : showitem.monitorcode
+                            ] !== undefined &&
+                            item.readData[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan1")
+                                : showitem.monitorcode
+                            ] !== null
+                              ? item.readData[
+                                  showitem.monitorcode.startsWith("Fan")
+                                    ? showitem.monitorcode.replace(
+                                        /^Fan/,
+                                        "Fan1"
+                                      )
+                                    : showitem.monitorcode
+                                ]
+                              : "-"
+                          }}
+                        </view>
+
+                        <view
+                          class="demo-layout bg-purple-light"
+                          style="
+                            margin-top: 20rpx;
+                            color: #677799;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{ showitem.des }}
+                        </view>
+                      </view>
+                    </view>
+                  </div>
+                  <div class="bottom">
+                    <view>备机</view>
+                    <view
+                      class="datacard"
+                      v-for="(showitem, index) in deviceShowList"
+                      :key="index"
+                      v-show="
+                        showitem.appShow == 1 &&
+                        showitem.monitorcode != 'strinstallpos' &&
+                        showitem.monitorcode != 'netStatus' &&
+                        showitem.monitorcode != 'warnFlag' &&
+                        showitem.monitorcode != 'readTime' &&
+                        showitem.monitorcode != ''
+                      "
+                    >
+                      <view
+                        :class="TabCur"
+                        style="
+                          padding-top: 10rpx;
+                          padding-bottom: 10rpx;
+                          display: flex;
+                          flex-direction: column;
+                          align-items: center;
+                          height: 100%;
+                        "
+                      >
+                        <view
+                          v-if="
+                            showitem.datatype == 1 &&
+                            showitem.monitorcode == 'doorUse'
+                          "
+                          class="demo-layout bg-purple-light"
+                          style="
+                            margin-top: 10rpx;
+                            color: #3787fe;
+                            font-size: 30rpx;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{
+                            item[showitem.monitorcode] == "2"
+                              ? "行人"
+                              : item[showitem.monitorcode] == "1"
+                              ? "行车"
+                              : "-"
+                          }}
+                        </view>
+                        <view
+                          v-else-if="showitem.datatype == 1"
+                          class="demo-layout bg-purple-light"
+                          style="
+                            margin-top: 10rpx;
+                            color: #3787fe;
+                            font-size: 30rpx;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{
+                            item[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan2")
+                                : showitem.monitorcode
+                            ] !== undefined &&
+                            item[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan2")
+                                : showitem.monitorcode
+                            ] !== null
+                              ? item[
+                                  showitem.monitorcode.startsWith("Fan")
+                                    ? showitem.monitorcode.replace(
+                                        /^Fan/,
+                                        "Fan2"
+                                      )
+                                    : showitem.monitorcode
+                                ]
+                              : "-"
+                          }}
+                        </view>
+                        <view
+                          v-else-if="showitem.datatype == 2"
+                          class="demo-layout bg-purple-light"
+                          style="
+                            color: #3787fe;
+                            font-size: 30rpx;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{
+                            item.readData[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan2")
+                                : showitem.monitorcode
+                            ] !== undefined &&
+                            item.readData[
+                              showitem.monitorcode.startsWith("Fan")
+                                ? showitem.monitorcode.replace(/^Fan/, "Fan2")
+                                : showitem.monitorcode
+                            ] !== null
+                              ? item.readData[
+                                  showitem.monitorcode.startsWith("Fan")
+                                    ? showitem.monitorcode.replace(
+                                        /^Fan/,
+                                        "Fan2"
+                                      )
+                                    : showitem.monitorcode
+                                ]
+                              : "-"
+                          }}
+                        </view>
+
+                        <view
+                          class="demo-layout bg-purple-light"
+                          style="
+                            margin-top: 20rpx;
+                            color: #677799;
+                            margin-top: 20rpx;
+                          "
+                        >
+                          {{ showitem.des }}
+                        </view>
+                      </view>
+                    </view>
+                  </div>
+                </div>
               </div>
             </u-list-item>
           </template>
@@ -171,6 +422,7 @@
 
 <script>
 import api from "@/api/api";
+import { computed } from "vue";
 export default {
   data() {
     return {
@@ -180,6 +432,7 @@ export default {
       deviceList: {},
       colums: {},
       typeList: [], //详情页展示数据
+      deviceShowList: [], //设备展示字段
     };
   },
   props: ["showColum", "deviceType"],
@@ -191,9 +444,7 @@ export default {
       async handler(data) {
         if (data) {
           this.TabCur = data;
-          console.log(this.TabCur, "sssssabafjuabf");
           this.curlist = this.deviceList[this.TabCur];
-
           if (this.curlist == null) {
             this.curlist = [];
           }
@@ -209,6 +460,8 @@ export default {
   },
   created() {
     this.colums = this.showColum;
+    const key = this.TabCur + "_monitor";
+    this.deviceShowList = this.colums[key];
   },
   async mounted() {
     await this.loadData(this.TabCur);
@@ -241,7 +494,6 @@ export default {
           .getDeviceMonitor({
             devicetype: type,
             pagetype: "normal",
-            filterParams: {},
           })
           .then((response) => {
             if (response.data.code == 200) {
@@ -383,7 +635,16 @@ export default {
   background-color: #ffffff;
   margin-bottom: 5rpx;
 }
-
+.fanContent {
+  display: flex;
+  flex-direction: column;
+  margin-top: 10rpx;
+  margin-bottom: 10rpx;
+}
+.top,
+.bottom {
+  flex: 1; /* 各占 50% */
+}
 .datacard .content {
   width: 30rpx;
   height: 30rpx;

+ 8 - 4
pages/warndata/warndata.vue

@@ -171,7 +171,11 @@
             >
           </view>
           <view class="gascontainer">
-            <view class="gascard" v-for="(item, index) in gasDevice">
+            <view
+              class="gascard"
+              v-for="(item, index) in gasDevice"
+              :key="index"
+            >
               <view style="margin-top: 20rpx">
                 <text class="text-style1">{{ item.pumpNumber }}</text>
                 <view style="margin: 10rpx">{{ item.systemname }}</view>
@@ -233,8 +237,8 @@ export default {
   watch: {},
   data() {
     return {
-	  backPic0: "url(/static/topnavbar0.png)",
-	  backPic: "url(../../static/topnavbar.png)",
+      backPic0: "url(/static/topnavbar0.png)",
+      backPic: "url(../../static/topnavbar.png)",
       titleName: "预警分析",
       isShowDetail: true,
       detailComponent: "",
@@ -392,7 +396,7 @@ export default {
   flex: 1;
   width: 100%;
   margin-top: 45px;
-		background: #f1f5f6;
+  background: #f1f5f6;
   /* 内容区域顶部留出导航栏的高度 */
 }