Browse Source

预警修改

bobo04052021@163.com 5 tháng trước cách đây
mục cha
commit
1a0ea654e2

+ 147 - 0
pages/device/devicemenu/treeMenu/typeMenu.vue

@@ -0,0 +1,147 @@
+<template>
+  <view class="device-type-modal">
+    <scroll-view>
+      <!-- 通风设备 -->
+      <view v-for="(typeitem, index) in typeList" :key="index">
+        <view
+          class="cu-bar bg-white solid-bottom margin-top"
+          :style="[{ animation: 'show 0.5s 1' }]"
+        >
+          <view class="action">
+            <text style="font-weight: bold">{{ typeitem.itemText }}</text>
+          </view>
+        </view>
+
+        <view class="cu-list grid col-4 text-sm">
+          <view
+            class="cu-item animation-slide-bottom"
+            :style="[{ animationDelay: (index + 1) * 0.05 + 's' }]"
+            v-for="(item, index) in typeitem.children"
+            :key="index"
+            @tap="goPage(item.itemValue)"
+          >
+            <view class="padding text-center">
+              <image
+                :src="icon_prefix + 'bottombg.png'"
+                style="width: 50px; height: 30px"
+              >
+              </image>
+              <image class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
+              <view class="margin-top-xs">{{ item.itemText }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </scroll-view>
+    <view class="cu-tabbar-height margin-top"></view>
+  </view>
+</template>
+
+<script>
+import { us, os } from "@/common/util/type.js";
+import socket from "@/common/js-sdk/socket/socket.js";
+import api from "@/api/api";
+export default {
+  name: "home",
+  watch: {},
+  data() {
+    return {
+      icon_prefix: "/static/sidebar/",
+      typeList: [],
+      usList: us.data,
+      osList: os.data,
+      dsList: os.data,
+      msgCount: 0,
+      dot: {
+        mailHome: false,
+      },
+      iconMap: {
+        gate: "/static/sidebar/ventS/gate.svg",
+        window: "/static/sidebar/ventS/window.svg",
+        windrect: "/static/sidebar/ventS/windrect.svg",
+        fanmain: "/static/sidebar/ventS/fanmain.svg",
+        fanlocal: "/static/sidebar/ventS/fanlocal.svg",
+        drilling: "/static/sidebar/gasS/drilling.svg",
+        gasmonitor: "/static/sidebar/gasS/gasmonitor.svg",
+        pump: "/static/sidebar/gasS/pump.svg",
+        unit: "/static/sidebar/gasS/unit.svg",
+        dusting: "/static/sidebar/dustS/dusting.svg",
+        spray: "/static/sidebar/dustS/spray.svg",
+        bundletube: "/static/sidebar/fireS/bundletube.svg",
+        fiber: "/static/sidebar/fireS/fiber.svg",
+        nitrogen: "/static/sidebar/fireS/nitrogen.svg",
+        obfurage: "/static/sidebar/fireS/obfurage.svg",
+        pulping: "/static/sidebar/fireS/pulping.svg",
+        atomizing: "/static/sidebar/dustS/atomizing.svg",
+      },
+    };
+  },
+  created() {
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      return new Promise((resolve, reject) => {
+        api
+          .getDeviceType({})
+          .then((response) => {
+            if (response.data.code == 200) {
+              for (var i = 0; i < response.data.result.length; i++) {
+                if (
+                  response.data.result[i].itemValue.indexOf("synthesizeS") == -1
+                )
+                  this.typeList.push(response.data.result[i]);
+              }
+            } else {
+              resolve(response);
+            }
+          })
+          .catch((error) => {
+            console.log("catch===>response", response);
+            reject(error);
+          });
+      });
+    },
+    goPage(page) {
+      this.$emit("menuClick", page);
+    },
+    getIcon(itemValue) {
+      const defaultIconPath = "/static/sidebar/fireS/pulping.svg";
+
+      // 检查 iconMap 中是否存在对应的图标路径
+      if (itemValue && this.iconMap[itemValue]) {
+        return "/static/sidebar/" + itemValue + ".svg";
+      }
+      // 如果不存在对应的图标路径,则返回默认图标路径
+      return defaultIconPath;
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.device-type-modal {
+  margin-top: 30rpx;
+}
+.cu-list.grid > .cu-item {
+  padding: 0rpx 0rpx;
+  background: linear-gradient(
+    to right,
+    rgba(55, 135, 254, 0.08),
+    rgba(4, 184, 255, 0.08),
+    rgba(60, 161, 237, 0.08)
+  );
+}
+.line2-icon {
+  width: 60rpx;
+  height: 60rpx;
+}
+.icon {
+  position: absolute;
+  top: 5rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 20rpx;
+  height: 20rpx;
+}
+</style>

+ 6 - 6
pages/home/detail/autodoor/autodoor.vue

@@ -287,8 +287,8 @@ export default {
       title: "测风设备",
       fan1State: "",
       fan2State: "",
-	  deviceid:'',//ID
-	  cameralist:[],//摄像数据
+      deviceid: "", //ID
+      cameralist: [], //摄像数据
     };
   },
   onLoad(query) {
@@ -302,7 +302,7 @@ export default {
   created() {
     this.getShowList(this.TabCur);
     this.getDeviceInfo(this.itemId);
-	this.getVideoUrlById(this.itemId);
+    this.getVideoUrlById(this.itemId);
   },
   mounted() {
     this.startTimer();
@@ -390,7 +390,7 @@ export default {
                 (this.tableData.forntArea / maxarea) * 100 * 0.9;
               this.windowAngle1 =
                 (this.tableData.rearArea / maxarea) * 100 * 0.9;
-				this.deviceid = result.deviceID;
+              this.deviceid = result.deviceID;
               this.$forceUpdate();
             } else {
               resolve(response);
@@ -406,7 +406,7 @@ export default {
       let IDString = String(ID); // 将 ID 转换为字符串
       new Promise((resolve, reject) => {
         api
-          .getCameraById({ deviceId: IDString })
+          .getCameraById({ deviceid: IDString })
           .then((response) => {
             if (response.data.code == 200) {
               if (response.data.result.records.length > 0) {
@@ -483,7 +483,7 @@ passwordPopup {
   background-color: #ffffff;
 }
 .main {
-  /* margin-top: 100rpx; */
+  margin-top: 80rpx;
 }
 .container {
   display: flex;

+ 10 - 4
pages/home/devicemenu/treeMenu/typeMenu.vue

@@ -106,16 +106,22 @@ export default {
       this.$emit("menuClick", page);
     },
     getIcon(itemValue) {
-      // 根据itemValue获取对应的图标路径
-      return "/static/sidebar/" + itemValue + ".svg";
+      const defaultIconPath = "/static/sidebar/fireS/pulping.svg";
+
+      // 检查 iconMap 中是否存在对应的图标路径
+      if (itemValue && this.iconMap[itemValue]) {
+        return "/static/sidebar/" + itemValue + ".svg";
+      }
+      // 如果不存在对应的图标路径,则返回默认图标路径
+      return defaultIconPath;
     },
   },
 };
 </script>
 
 <style scoped lang="scss">
-.device-type-modal{
-	margin-top: 30rpx;
+.device-type-modal {
+  margin-top: 30rpx;
 }
 .cu-list.grid > .cu-item {
   padding: 0rpx 0rpx;

+ 0 - 446
pages/home/firstmodel.vue.bak

@@ -1,446 +0,0 @@
-<template>
-  <view class="container">
-    <!-- 建议放在外层 -->
-    <u-navbar
-      title="设备监测"
-      @leftClick="devicemenuShow"
-      :safeAreaInsetTop="true"
-    >
-      <view class="u-nav-slot" slot="left">
-        <u-icon name="list" size="20"> </u-icon>
-      </view>
-    </u-navbar>
-
-    <view v-show="menushow" class="menupage">
-      <DeviceMenu @menuClick="menuClick"></DeviceMenu>
-    </view>
-
-    <view v-show="!menushow" class="main">
-      <view class="u-page">
-        <u-list>
-          <u-list-item
-            class="itemback"
-            v-for="(item, index) in curlist"
-            :key="index"
-          >
-            <div @tap="openNewPage(item)">
-              <u-row gutter="5" customStyle="margin-bottom: 10px">
-                <u-col span="24">
-					
-				 <img style="position: absolute;width: 35rpx;height:35ropx;" class="icon" :src="getIcon(TabCur)" alt="Icon" />
-                    <span class="title">{{item.strinstallpos}}</span>
-                </u-col>
-              </u-row>
-              <u-row gutter="5" customStyle="margin-bottom: 10px">
-                <u-col span="3" style="margin-right: 5rpx">
-                  <div v-if="item.netStatus == 0" class="error-tag1">
-                    <img
-                      src="'../../../../static/model/connectFalse.svg "
-                      alt=""
-                      class="icon-style"
-                    />
-                    <span style="float: right">断开</span>
-                  </div>
-                  <div v-else class="success-tag">
-                    <img
-                      src="'../../../../static/model/connectTrue.svg "
-                      alt=""
-                      class="icon-style"
-                    />
-                    <span style="float: right">连接</span>
-                  </div>
-                </u-col>
-                <u-col span="4">
-                  <div v-if="item.warnFlag == 0" class="success-tag">
-                    <img
-                      src="'../../../../static/model/alarmTrue.svg "
-                      alt=""
-                      class="icon-style"
-                    />
-                    <span style="float: right">{{ item.warnLevel_str }}</span>
-                  </div>
-                  <div v-else class="error-tag">
-                    <img
-                      src="'../../../../static/model/alarmFalse.svg "
-                      alt=""
-                      class="icon-style"
-                    />
-                    <span style="float: right">{{ item.warnDes }}</span>
-                  </div>
-                </u-col>
-                <u-col span="5">
-                  <u--text class="timetext" :text="item.readTime"></u--text>
-                </u-col>
-              </u-row>
-              <view v-if="colums[TabCur + '_monitor'] != null">
-                <view
-                  class="datacard"
-                  v-for="(showitem, index) in colums[TabCur + '_monitor']"
-<<<<<<< Updated upstream
-                  :key="index"
-                  v-show="showitem.appShow == 1"
-                >
-                  <view
-                    class="content"
-                    :style="{
-                      backgroundImage:
-                        showitem.monitorcode === 'frontRearDP' ||
-                        showitem.monitorcode === 'frontRearDifference'
-                          ? 'url(\'../../../../static/model/Pa.png\')'
-                          : showitem.monitorcode === 'sourcePressure'
-                          ? 'url(\'../../../../static/model/MPa.png\')'
-                          : showitem.monitorcode === 'frontGateOpen'
-                          ? 'url(\'../../../../static/model/doorNet.png\')'
-                          : showitem.monitorcode === 'rearGateOpen'
-                          ? 'url(\'../../../../static/model/doorNet.png\')'
-                          : showitem.monitorcode === 'warnFlag'
-                          ? 'url(\'../../../../static/model/9432.png\')'
-                          : showitem.monitorcode === 'netStatus'
-                          ? 'url(\'../../../../static/model/9431.png\')'
-                          : showitem.monitorcode === 'm3'
-                          ? 'url(\'../../../../static/model/windM3.png\')'
-                          : showitem.monitorcode === 'fsectarea'
-                          ? 'url(\'../../../../static/model/duanArea.png\')'
-                          : showitem.monitorcode === 'incipientWindSpeed1' ||
-                            showitem.monitorcode === 'incipientWindSpeed2' ||
-                            showitem.monitorcode === 'incipientWindSpeed3' ||
-                            showitem.monitorcode === 'va'
-                          ? 'url(\'../../../../static/model/fengsu.png\')'
-                          : 'url(\'\')',
-                      backgroundSize: '100% 100%',
-                    }"
-                  >
-                    <view
-                      v-show="
-=======
-                  v-show="showitem.appShow == 1 && 
->>>>>>> Stashed changes
-                        showitem.monitorcode != 'strinstallpos' &&
-                        showitem.monitorcode != 'netStatus' &&
-                        showitem.monitorcode != 'warnFlag' &&
-                        showitem.monitorcode != 'readTime' &&
-<<<<<<< Updated upstream
-                        showitem.monitorcode != ''
-                      "
-                    >
-                      <view
-                        v-if="
-                          showitem.datatype == 1 &&
-                          item.readData[showitem.monitorcode] !== undefined &&
-                          item.readData[showitem.monitorcode] !== null
-                        "
-=======
-                        showitem.monitorcode != '' &&
-                        showitem.monitorcode != null"
-                >
-				<view :class="TabCur">
-                    <view style="padding-top:10rpx;padding-bottom: 10rpx;">
-					  <view v-if="showitem.datatype == 1 && showitem.monitorcode == 'doorUse'"
->>>>>>> Stashed changes
-                        class="demo-layout bg-purple-light"
-                        style="margin-top: 10rpx; color: #3787fe;font-size: 30rpx;margin-top: 5rpx;"
-					  >
-					    {{ 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: 5rpx;"
-					  >
-					    {{ item[showitem.monitorcode] == null || item[showitem.monitorcode] == ''?'-':item[showitem.monitorcode]}}
-					  </view>
-                      <view
-                        v-else-if="
-                          showitem.datatype == 2 &&
-                          item.readData[showitem.monitorcode] !== undefined &&
-                          item.readData[showitem.monitorcode] !== null
-                        "
-                        class="demo-layout bg-purple-light"
-                        style="color: #3787fe;font-size: 30rpx;margin-top: 5rpx;"
-                        >{{ item.readData[showitem.monitorcode]==null || item.readData[showitem.monitorcode] == ''?'-':item.readData[showitem.monitorcode] }}</view
-                      >
-                      <view
-                        v-else
-                        class="demo-layout bg-purple-light"
-                        style="color: #3787fe"
-                        >--</view
-                      >
-                      <view
-                        class="demo-layout bg-purple-light"
-                        style="margin-top: 6rpx; color: #677799;margin-bottom: 5rpx;"
-                        >{{ showitem.des }}</view
-                      >
-                    </view>
-                  </view>
-                </view>
-              </view>
-            </div>
-          </u-list-item>
-        </u-list>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-import DeviceMenu from "./devicemenu/devicemenu.vue";
-import api from "@/api/api";
-export default {
-  data() {
-    return {
-      menushow: false,
-      TabCur: "gate",
-      curlist: [],
-      deviceList: {},
-      scrollLeft: 0,
-      currentTab: 0,
-      colums: {},
-    };
-  },
-  components: {
-    DeviceMenu,
-  },
-  props: ["showColum"],
-  watch: {
-    showColum(data) {
-      this.colums = data;
-      console.log(this.colums);
-    },
-  },
-  created() {
-    this.colums = this.showColum;
-  },
-  mounted() {
-    this.startTimer();
-  },
-  methods: {
-    startTimer() {
-      // 每隔一段时间执行某个操作
-      this.timer = setInterval(() => {
-        // 执行定时任务
-        this.loadData(this.TabCur);
-        console.log("定时任务执行中...");
-      }, 5000);
-    },
-    stopTimer() {
-      // 停止定时器
-      clearInterval(this.timer);
-    },
-    getIcon(itemValue) {
-      // 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
-      return '/static/sidebar/'+itemValue+".svg";
-    },
-    getValueIcon(itemValue) {
-      // 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
-      return '/static/sidebar/'+itemValue+".svg";
-    },
-    loadData(type) {
-      new Promise((resolve, reject) => {
-        api
-          .getDeviceMonitor({
-            devicetype: type,
-            pagetype: "normal",
-            filterParams: {},
-          })
-          .then((response) => {
-            if (response.data.code == 200) {
-              this.deviceList[type] = response.data.result.msgTxt[0].datalist;
-              this.curlist = this.deviceList[type];
-              this.curlist.forEach((item) => {
-                if (item.readData.frontGateOpen == 1) {
-                  item.readData.frontGateOpen = "打开";
-                } else {
-                  item.readData.frontGateOpen = "关闭";
-                }
-                if (item.readData.midGateOpen == 1) {
-                  item.readData.midGateOpen = "打开";
-                } else {
-                  item.readData.midGateOpen = "关闭";
-                }
-                if (item.readData.rearGateOpen == 1) {
-                  item.readData.rearGateOpen = "打开";
-                } else {
-                  item.readData.rearGateOpen = "关闭";
-                }
-                if (item.readData.midGateOpen == 1) {
-                  item.readData.midGateOpen = "打开";
-                } else {
-                  item.readData.midGateOpen = "关闭";
-                }
-              });
-            } else {
-              resolve(response);
-            }
-          })
-          .catch((error) => {
-            console.log("catch===>response", response);
-            reject(error);
-          });
-      });
-    },
-    tabSelect(e) {
-      this.currentTab = e.currentTarget.dataset.id;
-      this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
-    },
-    devicemenuShow(e) {
-      this.menushow = true;
-    },
-    menuClick(id) {
-      this.TabCur = id;
-      // 显示该分类的数据
-      this.curlist = this.deviceList[this.TabCur];
-
-      if (this.curlist == null) {
-        this.curlist = [];
-      }
-      // 选择设备分类,重新获取数据
-      this.loadData(this.TabCur);
-      this.menushow = false;
-    },
-    openNewPage(params) {
-      this.$destroy();
-      uni.navigateTo({
-        url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
-      });
-    },
-  },
-  destroyed() {
-    // 停止定时器
-    this.stopTimer();
-  },
-};
-</script>
-
-<style>
-.top-nav {
-  height: 100rpx;
-  line-height: 100rpx;
-  background-color: #2aa9f3;
-  color: #daaaa;
-}
-.top-nav2 {
-  background-color: #ffffff;
-}
-.main {
-  margin-top: 100rpx;
-  display: flex;
-  flex-direction: column;
-}
-.card {
-  background-color: #ffffff;
-  margin: auto;
-  margin-top: 20rpx;
-  width: 10%;
-  height: 280rpx;
-  border: 1rpx solid #000000;
-  border-radius: 20rpx;
-}
-.menupage {
-  position: absolute;
-  z-index: 2;
-  top: 40rpx;
-  height: calc(100% - 40rpx);
-  width: 100%;
-}
-.timetext {
-  text-align: right;
-  float: right;
-}
-.itemback {
-  padding: 20rpx;
-  background-color: #ffffff;
-  margin-bottom: 5rpx;
-}
-.datacard .content{
-	width: 30rpx;
-	height: 30rpx;
-	left: 0rpx;
-	top:0rpx;
-	position: absolute;
-}
-.datacard {
-	border-radius: 10rpx;
-	border: rgba(55, 135, 254, 0.28);
-  width: 30%;
-  margin: 1%;
-  float: left;
-  height: 105rpx;
-  text-align: center;
-  background: linear-gradient(
-    to right,
-    rgba(55, 135, 254, 0.08),
-    rgba(4, 184, 255, 0.08),
-    rgba(60, 161, 237, 0.08)
-  );
-}
-.datacard .gate{
-  background: linear-gradient(
-    to right,
-    rgba(75, 135, 254, 0.08),
-    rgba(24, 184, 255, 0.08),
-    rgba(80, 161, 237, 0.08)
-  );
-}
-.datacard .window{
-  background: linear-gradient(
-    to right,
-    rgba(55, 125, 254, 0.08),
-    rgba(4, 164, 255, 0.08),
-    rgba(60, 131, 237, 0.08)
-  );
-}
-.datacard .windrect{
-  background: linear-gradient(
-    to right,
-    rgba(85, 125, 254, 0.08),
-    rgba(34, 164, 255, 0.08),
-    rgba(90, 131, 237, 0.08)
-  );
-}
-.error-tag {
-  border-radius: 10%;
-  display: inline-block;
-  color: #e90000;
-  line-height: 50rpx;
-  font-size: 14px;
-  text-align: center;
-  float: left;
-  width: 180rpx;
-  height: 50rpx;
-  padding-right:30rpx;
-  background-color: rgba(233, 0, 0, 0.2);
-}
-.error-tag1 {
-  border-radius: 10%;
-  display: inline-block;
-  color: #696969;
-  line-height: 50rpx;
-  font-size: 14px;
-  text-align: center;
-  margin-top: 10rpx;
-  float: left;
-  width: 120rpx;
-  height: 50rpx;
-  background-color: rgba(105, 105, 105, 0.2);
-}
-.success-tag {
-  border-radius: 10%;
-  color: #42c000;
-  line-height: 50rpx;
-  font-size: 14px;
-  width: 120rpx;
-  height: 50rpx;
-  padding-right:30rpx;
-  background-color: rgba(226, 250, 214);
-}
-.icon-style {
-  margin: 15rpx;
-  width: 14px;
-  height: 14px;
-}
-.title{
-	margin-left: 40rpx;
-	float: left;
-	font-size: 32rpx;
-	font-weight: 400;
-}
-</style>

+ 123 - 128
pages/index/index.vue

@@ -1,172 +1,167 @@
 <template>
-  <view class='app-container'>
-	<web-view v-if="PageCur == 'tun2D'" src="http://192.168.10.104:8088" @message="handleMessage"></web-view>
-	<Device v-if="PageCur == 'device'"/>
-	<filecenter
-	  :cur="PageCur"
-	  v-if="PageCur == 'filecenter'"
-	></filecenter>
-	<warndata
-	  v-if="PageCur == 'warndata'"
-	  :cur="PageCur"
-	></warndata>
+  <view class="app-container">
+    <web-view
+      v-if="PageCur == 'tun2D'"
+      src="http://192.168.183.216:8088/"
+      @message="handleMessage"
+    ></web-view>
+    <Device v-if="PageCur == 'device'" />
+    <filecenter :cur="PageCur" v-if="PageCur == 'filecenter'"></filecenter>
+    <warndata v-if="PageCur == 'warndata'" :cur="PageCur"></warndata>
     <u-tabbar
       :value="PageCur"
       @change="NavChange"
       :fixed="true"
-	  :placeholder="true"
-	  :safeAreaInsetBottom="true"
+      :placeholder="true"
+      :safeAreaInsetBottom="true"
     >
       <u-tabbar-item
         text="通风系统图"
         name="tun2D"
         icon="list-dot"
-
       ></u-tabbar-item>
       <u-tabbar-item
         text="设备中心"
         name="device"
         icon="calendar"
       ></u-tabbar-item>
-	  <u-tabbar-item
-	    text="预警分析"
-	    name="warndata"
-	    icon="plus-circle"
-	  ></u-tabbar-item>
-	  <u-tabbar-item
-	    text="文件共享"
-	    name="filecenter"
-	    icon="file-text"
-	  ></u-tabbar-item>
+      <u-tabbar-item
+        text="预警分析"
+        name="warndata"
+        icon="plus-circle"
+      ></u-tabbar-item>
+      <u-tabbar-item
+        text="文件共享"
+        name="filecenter"
+        icon="file-text"
+      ></u-tabbar-item>
     </u-tabbar>
-	
   </view>
 </template>
 
 <script>
-import Device from '../device/index.vue'
+import Device from "../device/index.vue";
 export default {
-	components: {
-	  Device,
-	},
+  components: {
+    Device,
+  },
   data() {
     return {
       PageCur: "tun2D",
-	  tun3DPage: null,
-	  wv: null, // 定义(app)webview对象节点
-	  webV:{}, // 定义(H5)webview对象节点
+      tun3DPage: null,
+      wv: null, // 定义(app)webview对象节点
+      webV: {}, // 定义(H5)webview对象节点
     };
   },
-  
+
   onLoad: function () {
-	this.PageCur = "tun2D";
-	
-		
-	
+    this.PageCur = "tun2D";
   },
 
-  mounted:function(){
-	this.changeWV()
+  mounted: function () {
+    this.changeWV();
   },
-  onResize(){
-  	let _this = this
-  	uni.getSystemInfo({  
-		success: function(res) {
-			if (res.windowWidth > res.windowHeight) {  
-			   // 横屏
-				// _this.isLandScape = true
-				console.log('横屏')
-				_this.changeWV(true)
-				
-			} else {  
-			   // 竖屏
-				// _this.isLandScape = false
-				console.log('竖屏')
-				_this.changeWV(false)
-				
-			}
-			
-		}  
-  	})
+  onResize() {
+    let _this = this;
+    uni.getSystemInfo({
+      success: function (res) {
+        if (res.windowWidth > res.windowHeight) {
+          // 横屏
+          // _this.isLandScape = true
+          console.log("横屏");
+          _this.changeWV(true);
+        } else {
+          // 竖屏
+          // _this.isLandScape = false
+          console.log("竖屏");
+          _this.changeWV(false);
+        }
+      },
+    });
   },
   methods: {
     NavChange: function (e) {
       this.PageCur = e;
-	  if(e == 'tun2D'){
-		this.changeWV()
-	  }
+      if (e == "tun2D") {
+        this.changeWV();
+      }
+    },
+    handleMessage(e) {},
+    // 发送消息到 HTML
+    sendRequestData(res) {
+      const _this = this;
+      let param = { type: "orientationchange" };
+      // App端
+      // #ifdef APP-PLUS
+      // 页面栈最顶层就是当前webview
+      let currentWebview = _this.$scope.$getAppWebview();
+      _this.wv = currentWebview.children()[0];
+      this.wv.evalJS(`requestData(${param})`);
+
+      // #endif
+
+      // H5端
+      // #ifdef H5
+
+      window.addEventListener(
+        "message",
+        (e) => {
+          _this.webV = e.source; // window的对象
+          console.log(e.data.data.arg, "接收h5页面发来的消息"); // 接收h5页面发来的消息(11)  ====>H5端
+        },
+        false
+      );
+
+      if (this.webV.postMessage) {
+        this.webV.postMessage(param);
+      }
+
+      // #endif
+    },
+    changeWV(isLandScape) {
+      const _this = this;
+      let height = 0; // 动态高度变量
+      let width = 0; // 动态高度变量
+      let statusbar = 0; // 动态状态栏高度
+      uni.getSystemInfo({
+        // 获取当前设备的具体信息
+        success: (sysinfo) => {
+          statusbar = isLandScape ? 0 : sysinfo.statusBarHeight + 20;
+          height = isLandScape
+            ? sysinfo.windowHeight - sysinfo.statusBarHeight - 20
+            : sysinfo.windowHeight -
+              sysinfo.statusBarHeight -
+              sysinfo.statusBarHeight -
+              38;
+          width = isLandScape ? sysinfo.windowWidth : sysinfo.windowWidth;
+
+          let currentWebview = _this.$scope.$getAppWebview(); // 获取当前web-view
+          if (currentWebview) {
+            var wv = currentWebview.children()[0]; // 获取web-view的子节点(即需要设置样式的元素)
+            wv.setStyle({
+              // 设置web-view距离顶部的距离以及自己的高度,单位为px
+              top: statusbar, // 距离顶部的高度,应该是你页面的头部
+              height: height, // webview的高度
+              width: width,
+            });
+            wv.reload();
+            console.log(width, height, statusbar);
+            // _this.sendRequestData([], 1)
+          }
+        },
+      });
     },
-	handleMessage(e) {
-		
-	},
-	// 发送消息到 HTML
-	sendRequestData(res) {
-		const _this = this
-		let param = {type:'orientationchange'}
-		// App端
-		// #ifdef APP-PLUS
-		// 页面栈最顶层就是当前webview
-		let currentWebview = _this.$scope.$getAppWebview();
-		_this.wv = currentWebview.children()[0]
-		this.wv.evalJS(`requestData(${param})`);
-		
-		// #endif
-		
-		// H5端
-		// #ifdef H5
-		
-		window.addEventListener('message',e => {
-			_this.webV = e.source  // window的对象
-			console.log(e.data.data.arg,'接收h5页面发来的消息'); // 接收h5页面发来的消息(11)  ====>H5端
-		},false)
-		
-		if(this.webV.postMessage){
-			this.webV.postMessage(param)
-		}
-		
-		// #endif
-		
-		
-	},
-	changeWV(isLandScape) {
-		const _this = this
-		  let height = 0; // 动态高度变量
-		  let width = 0; // 动态高度变量
-		  let statusbar = 0; // 动态状态栏高度
-		  uni.getSystemInfo({ // 获取当前设备的具体信息
-			success: (sysinfo) => {
-				statusbar = isLandScape ? 0 : sysinfo.statusBarHeight + 20;
-				height = isLandScape ? sysinfo.windowHeight - sysinfo.statusBarHeight - 20 : sysinfo.windowHeight - sysinfo.statusBarHeight  - sysinfo.statusBarHeight - 38;
-				width = isLandScape ? sysinfo.windowWidth : sysinfo.windowWidth
-					
-				let currentWebview = _this.$scope.$getAppWebview(); // 获取当前web-view
-				if(currentWebview){
-					var wv = currentWebview.children()[0]; // 获取web-view的子节点(即需要设置样式的元素)
-					wv.setStyle({ // 设置web-view距离顶部的距离以及自己的高度,单位为px
-						top: statusbar, // 距离顶部的高度,应该是你页面的头部
-						height: height ,// webview的高度
-						width: width
-					});
-					wv.reload()
-					console.log( width, height, statusbar)
-					// _this.sendRequestData([], 1)
-				}
-				
-			}
-		  });
-		
-	}
   },
 };
 </script>
 
 <style>
-.app-container{
-	width: 100%;
-	height: 100%;
-	padding-left: 10rpx;
-	padding-right: 10rpx;
+.app-container {
+  width: 100%;
+  height: 100%;
+  padding-left: 10rpx;
+  padding-right: 10rpx;
 }
-.tun3D-box{
+.tun3D-box {
 }
 </style>

+ 2 - 6
pages/warndata/warndata.vue

@@ -1,10 +1,6 @@
 <template>
   <view class="container">
-    <u-navbar
-      title="预警分析"
-      :safeAreaInsetTop="true"
-      left-icon=""
-    >
+    <u-navbar title="预警分析" :safeAreaInsetTop="true" left-icon="">
     </u-navbar>
     <view class="main">
       <view class="flcard" v-if="isShow1">
@@ -311,7 +307,7 @@ export default {
 .container {
   display: flex;
   flex-direction: column;
-
+}
 .main {
   display: flex;
   flex-direction: column;