ソースを参照

样式修改 图片展示bug修改

bobo04052021@163.com 6 ヶ月 前
コミット
3cd7e1be84

+ 1 - 1
pages/filecenter/filecenter.vue

@@ -2,8 +2,8 @@
   <view class="container">
     <u-navbar
       title="文件中心"
+      :safeAreaInsetTop="false"
       style="margin-top: 30px"
-      :safeAreaInsetTop="true"
       leftIcon=""
     >
     </u-navbar>

+ 18 - 10
pages/history/Historymodel.vue

@@ -5,7 +5,7 @@
       title="历史数据"
       @leftClick="devicemenuShow"
       :safeAreaInsetTop="false"
-	  style="margin-top: 30px"
+      style="margin-top: 30px"
     >
       <view class="u-nav-slot" slot="left">
         <u-icon name="list" size="20"> </u-icon>
@@ -98,16 +98,16 @@
             <u-row gutter="5" customStyle="margin-bottom: 10px">
               <u-col span="2" style="margin-right: 15rpx">
                 <div v-if="item.netStatus == 0" class="error-tag1">
-                  <img
-                    src="'/static/model/connectFalse.svg "
+                  <image
+                    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 "
+                  <image
+                    src="/static/model/connectTrue.svg"
                     alt=""
                     class="icon-style"
                   />
@@ -116,16 +116,16 @@
               </u-col>
               <u-col span="2">
                 <div v-if="item.readData[warnFlag] == 0" class="success-tag">
-                  <img
-                    src="'/static/model/alarmTrue.svg "
+                  <image
+                    src="/static/model/alarmTrue.svg"
                     alt=""
                     class="icon-style"
                   />
                   <span style="float: right">{{ item.readData[warndes] }}</span>
                 </div>
                 <div v-else class="error-tag">
-                  <img
-                    src="'/static/model/alarmFalse.svg "
+                  <image
+                    src="/static/model/alarmFalse.svg"
                     alt=""
                     class="icon-style"
                   />
@@ -250,7 +250,7 @@ export default {
       ],
       deviceID: "", //设备ID
       deviceType: "", //设备类型
-      skip: "", //时间间隔
+      skip: 8, //时间间隔
       dataTime: dayjs().toDate(),
       historyData: [], //历史数据
     };
@@ -266,6 +266,14 @@ export default {
   },
   created() {
     this.colums = this.showColum;
+    const startTime = new Date(
+      new Date(
+        new Date().getTime() - 3600 * 1000 * 24 * 30
+      ).toLocaleDateString()
+    );
+    const endTime = new Date();
+    this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
+    this.EndTime = dayjs(endTime).format("YYYY-MM-DD HH:mm:ss");
   },
   mounted() {},
   methods: {

+ 2 - 2
pages/history/devicemenu/treeMenu/typeMenu.vue

@@ -2,7 +2,7 @@
   <view>
     <scroll-view>
       <!-- 通风设备 -->
-      <view v-for="(typeitem, index) in typeList">
+      <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' }]"
@@ -26,7 +26,7 @@
                 style="width: 50px; height: 30px"
               >
               </image>
-              <img class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
+              <image class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
               <view class="margin-top-xs">{{ item.itemText }}</view>
             </view>
           </view>

+ 175 - 80
pages/home/detail/autodoor/autodoor.vue

@@ -1,7 +1,7 @@
 <template>
   <view style="overflow: auto; height: 100%">
     <!-- 建议放在外层 -->
-    <u-navbar :title="name" @leftClick="backPage" :bgImage="backPic" style="margin-top: 30px">
+    <u-navbar :title="name" @leftClick="backPage" :bgImage="backPic">
       <view class="u-nav-slot" slot="left">
         <u-icon name="arrow-left" size="20"> </u-icon>
       </view>
@@ -77,7 +77,8 @@
         <div class="flcard" v-if="this.TabCur == 'gate'">
           <doorAnimate
             :gatestate1="frontGateStatus"
-            :gatestate2="rearGateStatus"
+            :gatestate2="midGateStatus"
+            :gatestate3="rearGateStatus"
             :videoURL="viedeoUrl"
             :height="height"
             :doorcount="ndoorcount"
@@ -140,17 +141,30 @@
               </div>
               <div class="datacard" v-if="item.monitorcode !== 'readTime'">
                 <div class="left-content">
-                  <view v-if="item.monitorcode == 'ndoortype'"
+                  <view
+                    v-if="item.monitorcode == 'ndoortype'"
                     class="demo-layout bg-purple-light"
                     style="margin-top: 10rpx; color: #3787fe"
                   >
-                    {{ tableData[item.monitorcode] == '1'?'行人':tableData[item.monitorcode] == '2'?'行车':'-' }}
+                    {{
+                      tableData[item.monitorcode] == "1"
+                        ? "行人"
+                        : tableData[item.monitorcode] == "2"
+                        ? "行车"
+                        : "-"
+                    }}
                   </view>
-                  <view v-else
+                  <view
+                    v-else
                     class="demo-layout bg-purple-light"
                     style="margin-top: 10rpx; color: #3787fe"
                   >
-                    {{ tableData[item.monitorcode] == null || tableData[item.monitorcode] == ''?'-':tableData[item.monitorcode]}}
+                    {{
+                      tableData[item.monitorcode] == null ||
+                      tableData[item.monitorcode] == ""
+                        ? "-"
+                        : tableData[item.monitorcode]
+                    }}
                   </view>
                   <div class="spacer"></div>
                   <!-- 间距 -->
@@ -167,28 +181,28 @@
                     backgroundImage:
                       item.monitorcode === 'frontRearDP' ||
                       item.monitorcode === 'frontRearDifference'
-                        ? 'url(\'/static/model/Pa.png\')'
+                        ? 'url(\'../../../../static/model/Pa.png\')'
                         : item.monitorcode === 'sourcePressure'
-                        ? 'url(\'/static/model/MPa.png\')'
+                        ? 'url(\'../../../../static/model/MPa.png\')'
                         : item.monitorcode === 'frontGateOpen'
-                        ? 'url(\'/static/model/doorNet.png\')'
+                        ? 'url(\'../../../../static/model/doorNet.png\')'
                         : item.monitorcode === 'rearGateOpen'
-                        ? 'url(\'/static/model/doorNet.png\')'
+                        ? 'url(\'../../../../static/model/doorNet.png\')'
                         : item.monitorcode === 'midGateOpen'
-                        ? 'url(\'/static/model/doorNet.png\')'
+                        ? 'url(\'../../../../static/model/doorNet.png\')'
                         : item.monitorcode === 'warnFlag'
-                        ? 'url(\'/static/model/9432.png\')'
+                        ? 'url(\'../../../../static/model/9432.png\')'
                         : item.monitorcode === 'netStatus'
-                        ? 'url(\'/static/model/9431.png\')'
+                        ? 'url(\'../../../../static/model/9431.png\')'
                         : item.monitorcode === 'm3'
-                        ? 'url(\'/static/model/windM3.png\')'
+                        ? 'url(\'../../../../static/model/windM3.png\')'
                         : item.monitorcode === 'fsectarea'
-                        ? 'url(\'/static/model/duanArea.png\')'
+                        ? 'url(\'../../../../static/model/duanArea.png\')'
                         : item.monitorcode === 'incipientWindSpeed1' ||
                           item.monitorcode === 'incipientWindSpeed2' ||
                           item.monitorcode === 'incipientWindSpeed3' ||
                           item.monitorcode === 'va'
-                        ? 'url(\'/static/model/fengsu.png\')'
+                        ? 'url(\'../../../../static/model/fengsu.png\')'
                         : 'url(\'\')',
                     backgroundSize: '100% 100%',
                   }"
@@ -241,7 +255,6 @@ import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
 export default {
   data() {
     return {
-	  timer: undefined,
       tableData: [], //监测数据
       typeList: [], //展示字段
       itemId: "", // 初始化 itemId
@@ -270,46 +283,38 @@ export default {
       windowAngle1: 0, //后窗打开角度
       windowArea: "", //风窗面积设定值
       viedeoUrl: "", //监控url
-	  sign:"",
-	  title:"测风设备",
-	  fan1State:'',
-	  fan2State:''
+      sign: "",
+      title: "测风设备",
+      fan1State: "",
+      fan2State: "",
     };
   },
-  onLoad(options) {
-	      // 通过 options 对象获取传递过来的参数
-	      const id = options.id;
-	      const name = options.name;
-	      const type = options.type;
-    this.itemId = id;
-    this.name = name;
-    this.TabCur = type;
+  onLoad(query) {
+    //保存id到 data 中 可以在整个页面中使用
+    this.itemId = query.id;
+    this.name = query.name;
+    this.TabCur = query.type;
     this.ndoorcount = 2;
   },
-  components: { doorAnimate, windowAnimate,windrectAnimate,fanlocalAnimate },
-  async created() {
-	await this.getShowList(this.TabCur);
-    await this.getDeviceInfo(this.itemId);
-    await this.getVideoUrlById(this.itemId);
+  components: { doorAnimate, windowAnimate, windrectAnimate, fanlocalAnimate },
+  created() {
+    this.getShowList(this.TabCur);
+    this.getDeviceInfo(this.itemId);
+    this.getVideoUrlById(this.itemId);
   },
   mounted() {
-    this.startTimer(false);
+    this.startTimer();
   },
   methods: {
-    startTimer(flag = true) {
-      this.timer = setTimeout(async() => {
+    startTimer() {
+      this.timer = setInterval(() => {
         // 执行定时任务
-		await this.getShowList(this.TabCur);
-        await this.getDeviceInfo(this.itemId);
-		if(this.timer){
-			this.startTimer()
-		}
-      }, !flag ? 0 : 2000);
+        this.getDeviceInfo(this.itemId);
+      }, 5000);
     },
     stopTimer() {
       // 停止定时器
-      clearTimeout(this.timer);
-	  this.timer = undefined
+      clearInterval(this.timer);
     },
     // 返回上一个页面
     backPage() {
@@ -326,12 +331,13 @@ export default {
         pageNo: 1,
         pageSize: 100,
       };
-      return new Promise((resolve, reject) => {
+      new Promise((resolve, reject) => {
         api
           .getShowColumList(params)
           .then((response) => {
             if (response.data.code == 200) {
               this.typeList = response.data.result.records;
+              console.log(this.typeList, "ssssssssssssssssc sa a ");
             } else {
               resolve(response);
             }
@@ -344,15 +350,16 @@ export default {
     //获取详情数据
     getDeviceInfo(ID) {
       let IDString = String(ID); // 将 ID 转换为字符串
-      return new Promise((resolve, reject) => {
+      new Promise((resolve, reject) => {
         api
           .getDeviceMonitor({ devicetype: this.TabCur, ids: IDString })
           .then((response) => {
-            if (response.data.code == 200 && response.data.result.msgTxt[0].datalist.length>0) {
-				var result = response.data.result.msgTxt[0].datalist[0];
-              this.tableData =
-                result.readData;
-				console.log('监测数据------------>', result)
+            if (
+              response.data.code == 200 &&
+              response.data.result.msgTxt[0].datalist.length > 0
+            ) {
+              var result = response.data.result.msgTxt[0].datalist[0];
+              this.tableData = result.readData;
               if (this.tableData.frontGateOpen == "1") {
                 this.tableData.frontGateOpen = "打开";
               } else {
@@ -368,25 +375,21 @@ export default {
               } else {
                 this.tableData.rearGateOpen = "关闭";
               }
-			  this.fan1State = result.readData.Fan1StartStatus
-			  this.fan2State = result.readData.Fan2StartStatus
-              this.nwindownum =
-                result.nwindownum;
-              this.ndoorcount =
-                result.ndoorcount;
-              this.deviceType =
-                result.deviceType;
-              this.state =
-                result.readData.sign;
+              this.fan1State = result.readData.Fan1StartStatus;
+              this.fan2State = result.readData.Fan2StartStatus;
+              this.nwindownum = result.nwindownum;
+              this.ndoorcount = result.ndoorcount;
+              this.deviceType = result.deviceType;
+              this.state = result.readData.sign;
               this.frontGateStatus = this.tableData.frontGateOpen;
+              this.midGateStatus = this.tableData.midGateOpen;
               this.rearGateStatus = this.tableData.rearGateOpen;
               var maxarea = result.maxarea;
               this.windowAngle =
                 (this.tableData.forntArea / maxarea) * 100 * 0.9;
               this.windowAngle1 =
                 (this.tableData.rearArea / maxarea) * 100 * 0.9;
-			  this.$forceUpdate()
-			  resolve(null)
+              this.$forceUpdate();
             } else {
               resolve(response);
             }
@@ -399,14 +402,14 @@ export default {
     //获取监控URL 通过ID获取
     getVideoUrlById(ID) {
       let IDString = String(ID); // 将 ID 转换为字符串
-      return new Promise((resolve, reject) => {
+      new Promise((resolve, reject) => {
         api
           .getCameraById({ deviceid: IDString })
           .then((response) => {
             if (response.data.code == 200) {
-				if(response.data.result.records.length>0){
-              this.viedeoUrl = response.data.result.records[0].addr;
-			  }
+              if (response.data.result.records.length > 0) {
+                this.viedeoUrl = response.data.result.records[0].addr;
+              }
             } else {
               resolve(response);
             }
@@ -455,7 +458,7 @@ export default {
       this.ctrlDevice(this.password);
       // 发起请求后关闭密码输入弹窗
       this.show = false;
-    }
+    },
   },
   destroyed() {
     // 停止定时器
@@ -464,16 +467,13 @@ export default {
 };
 </script>
 
-<style lang="scss">
->>> .u-navbar--fixed {
-	margin-top: 20px;
-}
+<style>
 passwordPopup {
   height: 300rpx;
   background-color: #fff;
 }
 .top-nav {
-  background-image: url(/static/topnavbar.png);
+  background-image: url(../../../../static/topnavbar.png);
   background-size: cover; /* 背景图片大小适应 */
   height: 100%;
 }
@@ -515,14 +515,13 @@ passwordPopup {
   border: 1rpx solid #000000;
   border-radius: 20rpx;
 }
-.flex-container {
+.flex-containe {
   display: flex;
   flex-direction: row;
   flex-wrap: wrap;
 }
 .itemback {
-  width: calc(48% - 5px);
-  // flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
+  flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
   margin: 5px; /* 间距设置为5px */
 }
 .datacardtime {
@@ -542,10 +541,10 @@ passwordPopup {
 }
 .datacard {
   display: flex;
-  /* width: 48%; */
+  width: 48%;
   flex: 1;
   margin: 1%;
-  /* float: left; */
+  float: left;
   height: 100rpx;
   text-align: center;
   background: linear-gradient(
@@ -565,9 +564,105 @@ passwordPopup {
 }
 .right-content {
   width: 50%; /* 右侧内容占据50%宽度 */
-  background-image: url(/static/model/Pa.png);
+  background-image: url(../../../../static/model/Pa.png);
   background-size: 100% 125%;
 }
+
+/*风窗样式*/
+div.autowindow_new {
+  width: 200px;
+  height: 200px;
+  background-image: url(../../../../static/window/window-bk.png);
+  background-size: 100% 100%;
+  perspective: 800px;
+}
+/*风窗1 2 3 4*/
+
+div.window_new_1 {
+  margin-top: 12px;
+  margin-left: 15px;
+  width: 170px;
+  height: 30px;
+  background-color: crimson;
+  box-sizing: border-box;
+  float: left;
+  z-index: 1;
+  /* transition: all 2s; */
+  background-image: url(../../../../static/window/window_new1.png);
+  background-size: 100% 100%;
+}
+div.window_new_2 {
+  margin-top: 2px;
+  margin-left: 15px;
+  width: 170px;
+  height: 29px;
+  background-color: crimson;
+  box-sizing: border-box;
+  float: left;
+  z-index: 1;
+  /* transition: all 2s; */
+  background-image: url(../../../../static/window/window_new1.png);
+  background-size: 100% 100%;
+}
+div.window_new_3 {
+  margin-top: 2px;
+  margin-left: 15px;
+  width: 170px;
+  height: 29px;
+  background-color: crimson;
+  box-sizing: border-box;
+  float: left;
+  z-index: 1;
+  /* transition: all 2s; */
+  background-image: url(../../../../static/window/window_new1.png);
+  background-size: 100% 100%;
+}
+div.window_new_4 {
+  margin-top: 2px;
+  margin-left: 15px;
+  width: 170px;
+  height: 29px;
+  background-color: crimson;
+  box-sizing: border-box;
+  float: left;
+  z-index: 1;
+  /* transition: all 2s; */
+  background-image: url(../../../../static/window/window_new1.png);
+  background-size: 100% 100%;
+}
+div.window_new_5 {
+  margin-top: 2px;
+  margin-left: 15px;
+  width: 170px;
+  height: 29px;
+  background-color: crimson;
+  box-sizing: border-box;
+  float: left;
+  z-index: 1;
+  /* transition: all 2s; */
+  background-image: url(../../../../static/window/window_new1.png);
+  background-size: 100% 100%;
+}
+div.window_new_1 {
+  transition: all 2s ease;
+  transform-origin: center center;
+}
+div.window_new_2 {
+  transition: all 2s ease;
+  transform-origin: center center;
+}
+div.window_new_3 {
+  transition: all 2s ease;
+  transform-origin: center center;
+}
+div.window_new_4 {
+  transition: all 2s ease;
+  transform-origin: center center;
+}
+div.window_new_5 {
+  transition: all 2s ease;
+  transform-origin: center center;
+}
 .btns {
   display: flex;
   margin-top: 15px;

+ 23 - 24
pages/home/devicemenu/treeMenu/typeMenu.vue

@@ -2,7 +2,7 @@
   <view>
     <scroll-view>
       <!-- 通风设备 -->
-      <view v-for="(typeitem, index) in typeList">
+      <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' }]"
@@ -26,7 +26,7 @@
                 style="width: 50px; height: 30px"
               >
               </image>
-              <img class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
+              <image class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
               <view class="margin-top-xs">{{ item.itemText }}</view>
             </view>
           </view>
@@ -55,6 +55,25 @@ export default {
       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() {
@@ -86,29 +105,9 @@ export default {
     goPage(page) {
       this.$emit("menuClick", page);
     },
-
     getIcon(itemValue) {
-      const 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",
-      };
-      // 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
-      return iconMap[itemValue];
+      // 根据itemValue获取对应的图标路径
+      return "/static/sidebar/" + itemValue + ".svg";
     },
   },
 };

+ 8 - 8
pages/home/firstmodel.vue

@@ -27,7 +27,7 @@
             <div @tap="openNewPage(item)">
               <u-row gutter="5" customStyle="margin-bottom: 10px">
                 <u-col span="24">
-                  <img
+                  <image
                     style="position: absolute; width: 18px; height: 18px"
                     class="icon"
                     :src="getIcon(TabCur)"
@@ -39,7 +39,7 @@
               <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
+                    <image
                       src="/static/model/connectFalse.svg"
                       alt=""
                       class="icon-style"
@@ -47,7 +47,7 @@
                     <span style="float: right">断开</span>
                   </div>
                   <div v-else class="success-tag">
-                    <img
+                    <image
                       src="/static/model/connectTrue.svg"
                       alt=""
                       class="icon-style"
@@ -57,16 +57,15 @@
                 </u-col>
                 <u-col span="4">
                   <div v-if="item.warnFlag == 0" class="success-tag">
-                    <img
+                    <image
                       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
+                    <image
                       src="/static/model/alarmFalse.svg"
                       alt=""
                       class="icon-style"
@@ -197,7 +196,8 @@ export default {
     this.colums = this.showColum;
   },
   mounted() {
-    this.startTimer();
+    this.loadData(this.TabCur);
+	this.startTimer();
   },
   methods: {
     startTimer() {
@@ -269,7 +269,7 @@ export default {
       this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
     },
     devicemenuShow(e) {
-      this.menushow = true;
+      this.menushow = !this.menushow;
     },
     menuClick(id) {
       this.TabCur = id;

+ 1 - 1
pages/index/index.vue

@@ -67,7 +67,7 @@ export default {
       commponent2Key: 1,
       commponent3Key: 2,
       commponent4Key: 3,
-      commponent5Key: 4,
+      commponent5Key: 4
     };
   },
   onLoad: function () {

+ 2 - 2
pages/operation/devicemenu/treeMenu/typeMenu.vue

@@ -2,7 +2,7 @@
   <view>
     <scroll-view>
       <!-- 通风设备 -->
-      <view v-for="(typeitem, index) in typeList">
+      <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' }]"
@@ -26,7 +26,7 @@
                 style="width: 50px; height: 30px"
               >
               </image>
-              <img class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
+              <image class="icon" :src="getIcon(item.itemValue)" alt="Icon" />
               <view class="margin-top-xs">{{ item.itemText }}</view>
             </view>
           </view>

+ 11 - 2
pages/operation/operationModel.vue

@@ -114,7 +114,7 @@ export default {
       dataShow: false,
       dataShow1: false,
       dataTime: dayjs().toDate(),
-      deviceType: "", //设备类型
+      deviceType: "gate", //设备类型
       StartTime: "",
       EndTime: "",
       historyData: [],
@@ -132,6 +132,15 @@ export default {
   },
   created() {
     this.colums = this.showColum;
+    const startTime = new Date(
+      new Date(
+        new Date().getTime() - 3600 * 1000 * 24 * 30
+      ).toLocaleDateString()
+    );
+    const endTime = new Date();
+    this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
+    this.EndTime = dayjs(endTime).format("YYYY-MM-DD HH:mm:ss");
+    this.checkHistoryData();
   },
   mounted() {},
   methods: {
@@ -150,7 +159,7 @@ export default {
       this.dataShow1 = false;
     },
     devicemenuShow(e) {
-      this.menushow = true;
+      this.menushow = !this.menushow;
     },
     menuClick(id) {
       this.TabCur = id;

+ 84 - 104
pages/warndata/warndata.vue

@@ -1,128 +1,103 @@
-<template name="warndata">
+<template>
   <view class="container">
     <u-navbar
       title="预警分析"
       :safeAreaInsetTop="false"
       style="margin-top: 30px"
-      leftIcon=""
+      left-icon=""
     >
     </u-navbar>
     <view class="main">
-      <u-collapse @change="change" @close="close" @open="open">
-        <u-collapse-item
-          title="通风监测预警"
-          name="wind"
-          class="text-style flcard"
-        >
-          <view class="">
-            <view class="datacard demo-layout bg-purple-light">
-              <view style="margin-top: 10rpx">
-                <text class="text-style">{{ windData.zongjinfeng }}</text>
-              </view>
-              <view style="margin-top: 10rpx">总进风量(m³/min):</view>
-            </view>
-            <view class="datacard demo-layout bg-purple-light">
-              <view style="margin-top: 10rpx">
-                <text class="text-style">{{ windData.zonghuifeng }}</text>
-              </view>
-              <view style="margin-top: 10rpx">总回风量(m³/min):</view>
-            </view>
-            <view class="datacard demo-layout bg-purple-light">
-              <view style="margin-top: 10rpx">
-                <text class="text-style">{{
-                  windData.sysdata.xufengliang
-                }}</text>
-              </view>
-              <view style="margin-top: 10rpx">总需风量(m³/min):</view>
-            </view>
-            <!-- <view class="datacard1 demo-layout bg-purple-light">
-				<view style="margin-top: 10rpx">
-				  <text class="text-style">aaaaaaaaaaaaa</text>
-				</view>
-				<view style="margin-top: 10rpx">测试:</view>
-			</view> -->
+      <view class="flcard">
+        <text class="text-style">通风监测预警</text>
+      </view>
+      <view class="flcard">
+        <view class="datacard demo-layout bg-purple-light">
+          <view style="margin-top: 10rpx">
+            <text class="text-style1">{{ windData.zongjinfeng }}</text>
           </view>
-        </u-collapse-item>
-        <u-collapse-item
-          title="设备监测预警"
-          name="device"
-          class="text-style flcard"
-        >
-          <view class="demo-layout bg-purple-light">
-            <view style="margin-top: 10rpx">
-              <view class="deviceCard">
-                <view
-                  class="item-container"
-                  v-for="(item, index) in devicekindData"
-                  :key="index"
-                >
-                  <view class="item">
-                    <text style="margin-right: 10px">{{ item.name }}</text>
-                    <text>{{ item.status }}</text>
-                  </view>
-                </view>
-              </view>
-            </view>
+          <view style="margin-top: 10rpx">总进风量(m³/min):</view>
+        </view>
+        <view class="datacard demo-layout bg-purple-light">
+          <view style="margin-top: 10rpx">
+            <text class="text-style1">{{ windData.zonghuifeng }}</text>
           </view>
-        </u-collapse-item>
-        <u-collapse-item
-          title="火灾监测预警"
-          name="fire"
-          class="text-style flcard"
-        >
-          <view class="firecontainer">
-            <view class="title">
-              <span class="firetext">外因火灾</span>
-            </view>
-            <view class="firecard"> </view>
+          <view style="margin-top: 10rpx">总回风量(m³/min):</view>
+        </view>
+        <view class="datacard demo-layout bg-purple-light">
+          <view style="margin-top: 10rpx">
+            <text class="text-style1">{{ xufengliang }}</text>
           </view>
-          <view class="firecontainer">
-            <view class="title">
-              <span class="firetext">内因火灾</span>
-            </view>
-            <view class="firecard"> </view>
+          <view style="margin-top: 10rpx">总需风量(m³/min):</view>
+        </view>
+      </view>
+      <view class="flcard">
+        <text class="text-style">火灾监测预警</text>
+      </view>
+      <view class="flcard">
+        <view class="firecontainer">
+          <view class="title">
+            <span class="firetext">外因火灾</span>
           </view>
-        </u-collapse-item>
-        <u-collapse-item
-          title="粉尘监测预警"
-          name="dust"
-          class="text-style flcard"
-        >
-          <text class="u-collapse-content"
-            >众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text
-          >
-        </u-collapse-item>
-        <u-collapse-item
-          title="瓦斯监测预警"
-          name="gas"
-          class="text-style flcard"
+          <view class="firecard"> </view>
+        </view>
+        <view class="firecontainer">
+          <view class="title">
+            <span class="firetext">内因火灾</span>
+          </view>
+          <view class="firecard"> </view>
+        </view>
+      </view>
+      <view class="flcard">
+        <text class="text-style">粉尘监测预警</text>
+      </view>
+      <view class="flcard">
+        <text class="u-collapse-content"
+          >众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text
         >
-          <view class="firecontainer">
-            <view class="title">
-              <span class="firetext">{{ gasData.devices[0].systemname }}</span>
-            </view>
-            <view class="firecard"> </view>
+      </view>
+      <view class="flcard">
+        <text class="text-style">瓦斯监测预警</text>
+      </view>
+      <view class="flcard">
+        <view class="firecontainer">
+          <view class="title">
+            <span class="firetext" v-if="gasDevice.length > 0">{{ gasDevice[0].systemname }}</span>
           </view>
-          <view class="firecontainer">
-            <view class="title">
-              <span class="firetext">{{ gasData.devices[1].systemname }}</span>
+          <view class="firecard"> </view>
+        </view>
+        <view class="firecontainer">
+          <view class="title">
+            <span class="firetext"	v-if="gasDevice.length > 0">{{ gasDevice[1].systemname }}</span>
+          </view>
+          <view class="firecard"> </view>
+        </view>
+      </view>
+      <view class="flcard">
+        <text class="text-style">设备监测预警</text>
+      </view>
+      <view class="flcard demo-layout bg-purple-light">
+        <view class="deviceCard">
+          <view
+            class="item-container"
+            v-for="(item, index) in devicekindData"
+            :key="index"
+          >
+            <view class="item">
+              <text style="margin-right: 10px">{{ item.name }}</text>
+              <text>{{ item.status }}</text>
             </view>
-            <view class="firecard"> </view>
           </view>
-        </u-collapse-item>
-      </u-collapse>
+        </view>
+      </view>
     </view>
   </view>
 </template>
 
 <script>
-import { log } from "../../plugin/uni-simple-router/helpers/warn";
 import api from "@/api/api";
 export default {
-  name: "warndata",
-  props: {
-    cur: String,
-  },
+  props: {},
   watch: {},
   data() {
     return {
@@ -130,6 +105,8 @@ export default {
       devicekindData: [],
       fireData: [],
       gasData: [],
+      gasDevice: [],
+      xufengliang: "", //总需风量
     };
   },
   mounted() {
@@ -147,6 +124,9 @@ export default {
               this.devicekindData = response.data.result.info.devicekindInfo;
               this.fireData = response.data.result.info.sysInfo.fireS;
               this.gasData = response.data.result.info.sysInfo.gasS;
+              this.gasDevice = this.gasData.devices;
+              console.log(this.gasDevice, "数据");
+              this.xufengliang = this.windData.sysdata.xufengliang;
             } else {
               reject(response);
             }
@@ -174,7 +154,6 @@ export default {
   font-weight: bold;
 }
 .flcard {
-  margin-top: 20rpx;
   padding: 20rpx;
   background-color: #ffffff;
   margin-bottom: 5rpx;
@@ -236,6 +215,7 @@ export default {
 .deviceCard {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
+  margin-top: 10rpx;
 }
 
 .item-container {
@@ -251,7 +231,7 @@ export default {
 .firetext {
   margin: 20px;
 }
-.text-style {
+.text-style1 {
   color: #3787fe;
   font-size: large;
 }