Kaynağa Gözat

Merge branch 'master' of http://182.92.126.35:3000/msx/Vent-App

lxh 1 hafta önce
ebeveyn
işleme
81c9489a03

+ 60 - 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,11 @@ const apiService = {
   },
   //获取设备历史数据
   getDeviceHistory(params) {
-    const url = buildURL(
-      "/ventanaly-device/safety/ventanalyMonitorData/listdays",
-      params
-    );
+    const url = buildURL("/safety/ventanalyMonitorData/listdays", params);
+    return http.get(url);
+  },
+  getDeviceHistory2(params) {
+    const url = buildURL("/modelreq/monitor/history/getHistoryData", params);
     return http.get(url);
   },
   //获取操作历史
@@ -176,29 +168,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);
   },

+ 1 - 1
common/service/config.service.js

@@ -11,7 +11,7 @@ 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"; //上湾

+ 192 - 65
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,98 @@
                   <u--text class="timetext" :text="item.ttime"></u--text>
                 </u-col>
               </u-row>
-              <div
-                class="datacard"
-                v-for="(showitem, index) in currentHistory"
-                v-show="showitem.appshow == 1"
-                :key="showitem.id + index"
+              <view
+                style="
+                  display: flex;
+                  flex-wrap: wrap;
+                  justify-content: space-between;
+                "
               >
-                <div class="content">
+                <view
+                  class="datacard"
+                  v-for="(showitem, index) in deviceShowList"
+                  :key="index"
+                  v-show="showitem.appShow == 1"
+                >
                   <view
-                    v-if="showitem.datatype == 1"
-                    class="demo-layout bg-purple-light"
-                    style="margin-top: 60rpx; color: #3787fe"
+                    :class="TabCur"
+                    style="
+                      padding-top: 10rpx;
+                      padding-bottom: 10rpx;
+                      display: flex;
+                      flex-direction: column;
+                      align-items: center;
+                      height: 100%;
+                    "
                   >
-                    {{
-                      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"
-                  >
-                    {{
-                      item.readData[showitem.monitorcode] == null ||
-                      item.readData[showitem.monitorcode] == ""
-                        ? "--"
-                        : item.readData[showitem.monitorcode]
-                    }}
+                    <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] == null ||
+                        item[showitem.monitorcode] == ""
+                          ? "-"
+                          : item[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[showitem.monitorcode] == null ||
+                        item[showitem.monitorcode] == ""
+                          ? "-"
+                          : item[showitem.monitorcode]
+                      }}
+                    </view>
+
+                    <view
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 20rpx;
+                        color: #677799;
+                        margin-top: 20rpx;
+                      "
+                    >
+                      {{ showitem.des }}
+                    </view>
                   </view>
-                  <view
-                    class="demo-layout bg-purple-light"
-                    style="color: #3787fe"
-                    >{{ showitem.des }}</view
-                  >
-                </div>
-              </div>
+                </view>
+              </view>
             </u-list-item>
           </template>
           <template v-else>
@@ -174,12 +241,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: [
@@ -187,45 +268,56 @@ export default {
           {
             label: "1秒",
             value: "1",
+            value1: "1s",
           },
           {
             label: "5秒",
             value: "2",
+            value1: "5s",
           },
           {
             label: "10秒",
             value: "3",
+            value1: "10s",
           },
           {
             label: "30秒",
             value: "4",
+            value1: "30s",
           },
           {
             label: "1分钟",
             value: "5",
+            value1: "1m",
           },
           {
             label: "10分钟",
             value: "6",
+            value1: "10m",
           },
           {
             label: "30分钟",
             value: "7",
+            value1: "30m",
           },
           {
             label: "1小时",
             value: "8",
+            value1: "1h",
           },
         ],
       ],
       deviceID: "", //设备ID
       //deviceType: "", //设备类型
       skip: 8, //时间间隔
+      interval: "1h", //时间间隔
       dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
       historyData: [], //历史数据
+      deviceShowList: [],
       loading: false, // 是否正在加载数据
       hasMoreData: true, // 是否还有更多数据可以加载
       pageNo: 1, // 当前页码(用于请求数据时分页)
+      stationType: "plc1", // 站点类型(用于请求数据时的参数)
     };
   },
   components: {
@@ -255,6 +347,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 +359,7 @@ export default {
     this.loadData(this.TabCur);
   },
 
-  computed: {
-    currentHistory() {
-      return this.colums[this.TabCur + "_history"] || [];
-    },
-  },
+  computed: {},
   methods: {
     loadData(type) {
       new Promise((resolve, reject) => {
@@ -301,6 +391,7 @@ export default {
           id: element.deviceID,
           strinstallpos: element.strinstallpos,
           type: element.deviceType,
+          stationType: element.stationType,
         };
         this.devices.push(deviceObj);
       });
@@ -308,10 +399,16 @@ export default {
     //选择设备  点击确定按钮  保存id
     selectDevice(e) {
       this.deviceID = e.value[0].id;
-      this.TabCur = e.value[0].type;
+      this.stationType = e.value[0].stationType;
+      // 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;
@@ -329,12 +426,21 @@ export default {
     //选择间隔时间
     selectSkipTime(e) {
       this.skip = e.value[0].value;
+      this.interval = e.value[0].value1;
       this.lable = e.value[0].label;
       this.show = false;
     },
     //查询历史数据 getDeviceHistory
     checkHistory() {
-      // debugger;
+      if (this.stationType !== "redis") {
+        console.log(this.stationType, "stationType");
+        this.getHistoryData();
+      } else {
+        this.getHistoryData2();
+      }
+    },
+    // 查询历史数据
+    getHistoryData() {
       const params = {
         ttime_begin: this.StartTime,
         ttime_end: this.EndTime,
@@ -348,7 +454,6 @@ export default {
         api
           .getDeviceHistory(params)
           .then((response) => {
-            debugger;
             if (response.data.code == 200) {
               const infolist = response.data.result;
               this.historyData = infolist.datalist.records;
@@ -370,26 +475,50 @@ export default {
                 }
               });
               this.pageNo = response.data.result.datalist.current;
-              // if (infolist.length == 0 && this.pageNo == 1) {
-              //   // console.log('首次加载没数据');
-              //   this.noData = false;
-              //   this.historyData = [];
-              // } else if (infolist.length < 3 && this.pageNo == 1) {
-              //   // console.log('首次加载有数据,但少于4条');
-              //   this.noData = true;
-              //   this.historyData = infolist;
-              // } else if (infolist.length !== 0 && this.pageNo == 1) {
-              //   // console.log('首次加载有数据');
-              //   this.noData = false;
-              //   this.historyData = infolist;
-              // } else if (infolist.length !== 0 && this.pageNo > 1) {
-              //   // console.log('上拉加载更多数据');
-              //   this.noData = false;
-              //   this.historyData = this.historyData.concat(infolist);
-              // } else if (infolist.length == 0 && this.pageNo > 1) {
-              //   // console.log('上拉加载没有更多数据了');
-              //   this.noData = true;
-              // }
+            } else {
+              resolve(response);
+            }
+          })
+          .catch((error) => {
+            reject(error);
+          });
+      });
+    },
+    getHistoryData2() {
+      const params = {
+        startTime: this.StartTime,
+        endTIme: this.EndTime,
+        deviceId: this.deviceID,
+        interval: this.interval,
+        isEmployee: true,
+        pageSize: 10,
+        strtype: this.TabCur,
+      };
+      new Promise((resolve, reject) => {
+        api
+          .getDeviceHistory2(params)
+          .then((response) => {
+            if (response.data.code == 200) {
+              const infolist = response.data.result;
+              this.historyData = infolist.records;
+              this.historyData.forEach((item) => {
+                if (item.readData.frontGateOpen == 1) {
+                  item.readData.frontGateOpen = "打开";
+                } else {
+                  item.readData.frontGateOpen = "关闭";
+                }
+                if (item.readData.rearGateOpen == 1) {
+                  item.readData.rearGateOpen = "打开";
+                } else {
+                  item.readData.rearGateOpen = "关闭";
+                }
+                if (item.readData.midGateOpen == 1) {
+                  item.readData.midGateOpen = "打开";
+                } else {
+                  item.readData.midGateOpen = "关闭";
+                }
+              });
+              this.pageNo = response.data.result.datalist.current;
             } else {
               resolve(response);
             }
@@ -422,7 +551,6 @@ export default {
     },
     devicemenuShow(e) {
       this.menushow = !this.menushow;
-      console.log(this.menushow, "dainjichengg成都多大事");
     },
     menuClick(id) {
       this.TabCur = id;
@@ -464,7 +592,6 @@ export default {
 .content {
   width: 100%;
   display: flex;
-  height: 290rpx;
   flex-direction: column;
 }
 .main {
@@ -544,7 +671,7 @@ export default {
   width: 120rpx;
   height: 50rpx;
   display: inline-block;
-  background-color: rgba(226, 250, 214);
+  background-color: rgba(226, 250, 214, 0.5);
 }
 .icon-style {
   margin: 15rpx;

+ 397 - 46
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"
             >
@@ -217,38 +220,354 @@
                     {{ item.des }}
                   </view>
                 </div>
-                <!-- <div
-                  class="right-content"
-                  :style="{
-                    backgroundImage:
-                      item.monitorcode === 'frontRearDP' ||
-                      item.monitorcode === 'frontRearDifference'
-                        ? 'url(\'../../../../static/model/Pa.png\')'
-                        : item.monitorcode === 'sourcePressure'
-                        ? 'url(\'../../../../static/model/MPa.png\')'
-                        : item.monitorcode === 'frontGateOpen'
-                        ? 'url(\'../../../../static/model/doorNet.png\')'
-                        : item.monitorcode === 'rearGateOpen'
-                        ? 'url(\'../../../../static/model/doorNet.png\')'
-                        : item.monitorcode === 'midGateOpen'
-                        ? 'url(\'../../../../static/model/doorNet.png\')'
-                        : item.monitorcode === 'warnFlag'
-                        ? 'url(\'../../../../static/model/9432.png\')'
-                        : item.monitorcode === 'netStatus'
-                        ? 'url(\'../../../../static/model/9431.png\')'
-                        : item.monitorcode === 'm3'
-                        ? 'url(\'../../../../static/model/windM3.png\')'
-                        : item.monitorcode === 'fsectarea'
-                        ? 'url(\'../../../../static/model/duanArea.png\')'
-                        : item.monitorcode === 'incipientWindSpeed1' ||
-                          item.monitorcode === 'incipientWindSpeed2' ||
-                          item.monitorcode === 'incipientWindSpeed3' ||
-                          item.monitorcode === 'va'
-                        ? 'url(\'../../../../static/model/fengsu.png\')'
-                        : 'url(\'\')',
-                    backgroundSize: '100% 100%',
-                  }"
-                ></div> -->
+              </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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan1")
+                              : 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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData.readData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData.readData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan1")
+                              : 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>
+            <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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan2")
+                              : 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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData.readData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData.readData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan2")
+                              : 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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan1")
+                              : 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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData.readData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan1")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData.readData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan1")
+                              : 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>
+            <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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan2")
+                              : 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.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== undefined &&
+                      tableData.readData[
+                        item.monitorcode.startsWith("Fan")
+                          ? item.monitorcode.replace(/^Fan/, "Fan2")
+                          : item.monitorcode
+                      ] !== null
+                        ? tableData.readData[
+                            item.monitorcode.startsWith("Fan")
+                              ? item.monitorcode.replace(/^Fan/, "Fan2")
+                              : item.monitorcode
+                          ]
+                        : "-"
+                    }}
+                  </view>
+                  <div class="spacer"></div>
+                  <!-- 间距 -->
+                  <view
+                    class="demo-layout bg-purple-light"
+                    style="color: #677799"
+                  >
+                    {{ item.des }}
+                  </view>
+                </div>
               </div>
             </div>
           </div>
@@ -351,6 +670,7 @@ export default {
       fan2State: "",
       deviceid: "", //ID
       cameralist: [], //摄像数据
+      showColum: {},
     };
   },
   onLoad(query) {
@@ -368,7 +688,7 @@ export default {
     fanmainAnimate,
   },
   created() {
-    this.getShowList(this.TabCur);
+    this.getShowColum();
     this.getDeviceInfo(this.itemId);
     this.getVideoUrlById(this.itemId);
   },
@@ -393,29 +713,48 @@ export default {
         delta: 1,
       });
     },
-    //获取app展示字段数据
-    getShowList(type) {
-      const params = {
-        devicekind: type,
-        pagetype: "detail",
-        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 +795,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 +903,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") {

+ 287 - 25
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 + '_monitor'] != null">
+                <view v-if="TabCur != 'fanmain' && TabCur != 'fanlocal'">
                   <view
                     class="datacard"
-                    v-for="(showitem, index) in colums[TabCur + '_monitor']"
+                    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) {
@@ -307,24 +559,25 @@ export default {
       });
     },
     openNewPage(params) {
-      // const reqData = {
-      //   id: params.deviceID,
-      //   name: params.strinstallpos,
-      //   type: this.TabCur,
-      // };
-      // const reqparams = uni.$u.queryParams(reqData);
-      // this.getShowList(this.TabCur).then(() => {
-      //   if (this.typeList.length > 0) {
-      //     this.$destroy();
-      //     uni.navigateTo({
-      //       url: `/pages/home/detail/autodoor/autodoor${reqparams}`,
-      //     });
-      //   }
-      // });
-      this.$destroy();
-      uni.navigateTo({
-        url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
+      const reqData = {
+        id: params.deviceID,
+        name: params.strinstallpos,
+        type: this.TabCur,
+      };
+      const reqparams = uni.$u.queryParams(reqData);
+      this.getShowList(this.TabCur).then(() => {
+        if (this.typeList.length > 0) {
+          this.$destroy();
+          uni.navigateTo({
+            url: `/pages/home/detail/autodoor/autodoor${reqparams}`,
+          });
+        }
       });
+      //   this.$destroy();
+      //   uni.navigateTo({
+      //     url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
+      //   });
+      // },
     },
   },
   destroyed() {
@@ -382,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;
   /* 内容区域顶部留出导航栏的高度 */
 }