Browse Source

手机APP问题修改

bobo04052021@163.com 2 months ago
parent
commit
dbeeb5ee41
4 changed files with 309 additions and 182 deletions
  1. 91 80
      pages/history/history.vue
  2. 63 42
      pages/home/detail/autodoor/autodoor.vue
  3. 136 40
      pages/index/index.vue
  4. 19 20
      pages/warndata/warndata.vue

+ 91 - 80
pages/history/history.vue

@@ -83,92 +83,96 @@
             v-model="dataTime"
           ></u-datetime-picker>
         </div>
-        <u-list>
-          <u-list-item
-            class="itemback"
-            v-for="(item, index) in historyData"
-            :key="index"
-          >
-            <u-row gutter="5" customStyle="margin-bottom: 10px">
-              <u-col span="24">
-                <u--text :text="item.ginstallpos"></u--text>
-              </u-col>
-            </u-row>
-            <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">
-                  <image
-                    src="/static/model/connectFalse.svg"
-                    alt=""
-                    class="icon-style"
-                  />
-                  <span style="float: right">断开</span>
-                </div>
-                <div v-else class="success-tag">
-                  <image
-                    src="/static/model/connectTrue.svg"
-                    alt=""
-                    class="icon-style"
-                  />
-                  <span style="float: right">连接</span>
-                </div>
-              </u-col>
-              <u-col span="2"> </u-col>
-              <u-col span="3"> </u-col>
-              <u-col span="5">
-                <u--text class="timetext" :text="item.ttime"></u--text>
-              </u-col>
-            </u-row>
-            <view v-if="colums[TabCur + '_monitor'] != null">
-              <view
-                class="datacard"
-                v-for="(showitem, index) in colums[TabCur + '_monitor']"
-                :key="index"
-                v-show="showitem.appShow == 1"
-              >
-                <view class="content">
-                  <view>
-                    <view
-                      v-if="
-                        showitem.datatype == 1 &&
-                        item.readData[showitem.monitorcode] !== null &&
-                        item.readData[showitem.monitorcode] !== undefined
-                      "
-                      class="demo-layout bg-purple-light"
-                      style="margin-top: 10rpx; color: #3787fe"
-                      >{{ item[showitem.monitorcode] }}</view
-                    >
-                    <view
-                      v-else-if="
-                        showitem.datatype == 2 &&
-                        item.readData[showitem.monitorcode] !== null &&
-                        item.readData[showitem.monitorcode] !== undefined
-                      "
-                      class="demo-layout bg-purple-light"
-                      style="color: #3787fe"
-                      >{{ 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: 10px; color: #677799"
-                      >{{ showitem.des }}</view
-                    >
+        <u-list class="historycontainer">
+          <template v-if="historyData.length > 0">
+            <u-list-item
+              class="itemback"
+              v-for="(item, index) in historyData"
+              :key="index"
+            >
+              <u-row gutter="5" customStyle="margin-bottom: 10px">
+                <u-col span="24">
+                  <u--text :text="item.ginstallpos"></u--text>
+                </u-col>
+              </u-row>
+              <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">
+                    <image
+                      src="/static/model/connectFalse.svg"
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">断开</span>
+                  </div>
+                  <div v-else class="success-tag">
+                    <image
+                      src="/static/model/connectTrue.svg"
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">连接</span>
+                  </div>
+                </u-col>
+                <u-col span="2"> </u-col>
+                <u-col span="3"> </u-col>
+                <u-col span="5">
+                  <u--text class="timetext" :text="item.ttime"></u--text>
+                </u-col>
+              </u-row>
+              <view v-if="colums[TabCur + '_monitor'] != null">
+                <view
+                  class="datacard"
+                  v-for="(showitem, index) in colums[TabCur + '_monitor']"
+                  :key="index"
+                  v-show="showitem.appShow == 1"
+                >
+                  <view class="content">
+                    <view>
+                      <view
+                        v-if="
+                          showitem.datatype == 1 &&
+                          item.readData[showitem.monitorcode] !== null &&
+                          item.readData[showitem.monitorcode] !== undefined
+                        "
+                        class="demo-layout bg-purple-light"
+                        style="margin-top: 10rpx; color: #3787fe"
+                        >{{ item[showitem.monitorcode] }}</view
+                      >
+                      <view
+                        v-else-if="
+                          showitem.datatype == 2 &&
+                          item.readData[showitem.monitorcode] !== null &&
+                          item.readData[showitem.monitorcode] !== undefined
+                        "
+                        class="demo-layout bg-purple-light"
+                        style="color: #3787fe"
+                        >{{ 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: 10px; color: #677799"
+                        >{{ showitem.des }}</view
+                      >
+                    </view>
                   </view>
                 </view>
               </view>
-            </view>
-          </u-list-item>
+            </u-list-item>
+          </template>
+
+          <template v-else>
+            <div class="empty-message">数据为空</div>
+          </template>
         </u-list>
       </view>
     </view>
-    <view v-if="loading"> 加载中...... </view>
-    <view v-else-if="!hasMoreData"> 没有更多数据了 </view>
   </view>
 </template>
 
@@ -457,6 +461,13 @@ export default {
 </script>
 
 <style>
+.empty-message {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 16px;
+  color: #333;
+}
 .main {
   /* margin-top: 100rpx; */
   display: flex;

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

@@ -16,37 +16,31 @@
         <div class="button-grid flcard" v-if="this.TabCur == 'gate'">
           <u-button
             type="primary"
-            shape="circle"
             text="打开前门"
             @click="showPasswordDialog('frontGateOpen_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="关闭前门"
             @click="showPasswordDialog('frontGateClose_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="打开后门"
             @click="showPasswordDialog('rearGateOpen_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="关闭后门"
             @click="showPasswordDialog('rearGateClose_S')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="打开前后门"
             @click="showPasswordDialog('sameTimeOpen')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="关闭前后门"
             @click="showPasswordDialog('sameTimeClose')"
           ></u-button>
@@ -57,7 +51,6 @@
         >
           <u-button
             type="primary"
-            shape="circle"
             text="设定面积"
             @click="showPasswordDialog('frontSetValue')"
           ></u-button>
@@ -68,13 +61,11 @@
         >
           <u-button
             type="primary"
-            shape="circle"
             text="设定前窗面积"
             @click="showPasswordDialog('frontSetValue')"
           ></u-button>
           <u-button
             type="primary"
-            shape="circle"
             text="设定后窗面积"
             @click="showPasswordDialog('rearSetValue')"
           ></u-button>
@@ -232,36 +223,49 @@
         </div>
       </view>
     </view>
-    <view class="passwordPopup">
-      <u-modal :show="show" :title="title" :content="content"></u-modal>
-      <u-popup
-        :show="show"
-        mode="bottom"
-        :round="14"
-        :safeAreaInsetBottom="false"
-      >
-        <view style="margin-top: 15px" v-if="this.TabCur == 'window'"
-          >风窗面积:</view
-        >
-        <u-input
-          style="margin-top: 15px"
-          v-model="windowArea"
-          v-if="this.TabCur == 'window'"
-        ></u-input>
-        <view style="margin-top: 15px">请输入密码:</view>
-        <u-input
-          style="margin-top: 15px"
-          v-model="password"
-          type="password"
-        ></u-input>
-        <view class="btns">
-          <u-button type="primary" shape="circle" @click="confirmPassword()"
-            >确认</u-button
+    <u-popup :show="show" mode="bottom" :safeAreaInsetBottom="false">
+      <div class="containers">
+        <view class="passWordName">
+          <view
+            class="title"
+            style="margin-top: 15px"
+            v-if="this.TabCur == 'window'"
+            >风窗面积</view
           >
-          <u-button shape="circle" @click="cancelPassword()">取消</u-button>
+          <u-input
+            class="passArea"
+            style="margin-top: 15px; border-color: #2a94ff"
+            v-model="windowArea"
+            type="text"
+            v-if="this.TabCur == 'window'"
+          ></u-input>
         </view>
-      </u-popup>
-    </view>
+        <view class="passWordInput">
+          <view style="margin-top: 15px" class="title">输入密码</view>
+          <u-input
+            style="margin-top: 15px; border-color: #2a94ff"
+            v-model="password"
+            type="password"
+          ></u-input
+        ></view>
+      </div>
+      <view class="btns">
+        <u-button
+          style="margin: 20px"
+          type="primary"
+          @click="confirmPassword()"
+          color="linear-gradient(to right, rgb(53, 138, 254), rgb(38, 171, 244))"
+          >确认</u-button
+        >
+        <u-button
+          style="margin: 20px"
+          type="primary"
+          :plain="true"
+          @click="cancelPassword()"
+          >取消</u-button
+        >
+      </view>
+    </u-popup>
   </view>
 </template>
 
@@ -498,10 +502,6 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-passwordPopup {
-  height: 300rpx;
-  background-color: #fff;
-}
 .top-nav {
   background-image: url(../../../../static/topnavbar.png);
   background-size: cover; /* 背景图片大小适应 */
@@ -695,6 +695,27 @@ div.window_new_5 {
 }
 .btns {
   display: flex;
-  margin-top: 15px;
+}
+.containers {
+  background-color: #fff;
+}
+.passWordName {
+  margin: 20px;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+}
+.title {
+  margin-right: 20px;
+  line-height: 40px;
+}
+.passWordInput {
+  margin: 20px;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+}
+.passArea {
+  border-color: red;
 }
 </style>

+ 136 - 40
pages/index/index.vue

@@ -1,34 +1,70 @@
 <template>
   <view class="app-container">
-    <view v-if="iframeloading" class="loadding-box" :style="{
-      height: wvHeight + 'px',
-      width: wvWidth + 'px',
-      marginTop: wvTop + 'px',
-      border: 'none'
-    }">
-      <u-loading-icon></u-loading-icon>
+    <view
+      v-if="iframeloading"
+      class="loadding-box"
+      :style="{
+        height: wvHeight + 'px',
+        width: wvWidth + 'px',
+        marginTop: wvTop + 'px',
+        border: 'none',
+      }"
+    >
+      <!-- <u-loading-icon></u-loading-icon> -->
     </view>
-    <iframe v-if="PageCur == 'tun2D'" ref="iframe" src="http://182.92.126.35:8098/" @load="viewLoad" :style="{
-      height: wvHeight + 'px',
-      width: wvWidth + 'px',
-      marginTop: wvTop + 'px',
-      border: 'none',
-      background: '#000',
-    }"></iframe>
-    <Device v-if="PageCur == 'device'" :style="{ marginTop: wvTop + 20 + 'px' }"></Device>
+    <iframe
+      v-if="PageCur == 'tun2D'"
+      ref="iframe"
+      src="http://182.92.126.35:8098/"
+      @load="viewLoad"
+      :style="{
+        height: wvHeight + 'px',
+        width: wvWidth + 'px',
+        marginTop: wvTop + 'px',
+        border: 'none',
+        background: '#000',
+      }"
+    ></iframe>
+    <Device
+      v-if="PageCur == 'device'"
+      :style="{ marginTop: wvTop + 20 + 'px' }"
+    ></Device>
     <filecenter :cur="PageCur" v-if="PageCur == 'filecenter'"></filecenter>
     <warndata v-if="PageCur == 'warndata'" :cur="PageCur"></warndata>
     <gasreport :cur="PageCur" v-if="PageCur == 'gasreport'"></gasreport>
     <user :cur="PageCur" v-if="PageCur == 'user'"></user>
-    <u-tabbar :value="PageCur" @change="NavChange" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
-      <u-tabbar-item v-for="(item, index) in permission " :key="index" :text="item.meta.title" :name="item.component"
-        :icon="index = 0 ? 'list-dot' : index == 1 ? 'calendar' : index == 2 ? 'plus-circle' : index == 3 ? 'file-text' : index == 4 ? 'bell' : 'list-dot'"></u-tabbar-item>
-    <!--  <u-tabbar-item
+    <u-tabbar
+      :value="PageCur"
+      @change="NavChange"
+      :fixed="true"
+      :placeholder="true"
+      :safeAreaInsetBottom="true"
+    >
+      <u-tabbar-item
+        v-for="(item, index) in permission"
+        :key="index"
+        :text="item.meta.title"
+        :name="item.component"
+        :icon="
+          (index = 0
+            ? 'list-dot'
+            : index == 1
+            ? 'calendar'
+            : index == 2
+            ? 'plus-circle'
+            : index == 3
+            ? 'file-text'
+            : index == 4
+            ? 'bell'
+            : 'list-dot')
+        "
+      ></u-tabbar-item>
+      <!--  <u-tabbar-item
         text="通风系统图"
         name="tun2D"
         icon="list-dot"
       ></u-tabbar-item> -->
-     <!-- <u-tabbar-item
+      <!-- <u-tabbar-item
         text="设备中心"
         name="device"
         icon="calendar"
@@ -48,11 +84,7 @@
         name="gasreport"
         icon="bell"
       ></u-tabbar-item> -->
-      <u-tabbar-item
-        text="我的"
-        name="user"
-        icon="bell"
-      ></u-tabbar-item>
+      <u-tabbar-item text="我的" name="user" icon="bell"></u-tabbar-item>
     </u-tabbar>
   </view>
 </template>
@@ -77,28 +109,92 @@ export default {
   },
   computed: {
     permission: function () {
-		var data = uni.getStorageSync('menuPermission');
-		console.log(JSON.stringify(data))
-		if(data==null ||data==""||data.length==0){
-			data = [{"redirect":null,"path":"/device","ver":null,"component":"device","route":"1","meta":{"keepAlive":false,"des":null,"internalOrExternal":false,"componentName":"device","title":"设备中心"},"name":"device","id":"1862300062379954178"},{"redirect":null,"path":"/warndata","ver":null,"component":"warndata","route":"1","meta":{"keepAlive":false,"des":null,"internalOrExternal":false,"componentName":"warndata","title":"预警分析"},"name":"warndata","id":"1862301272310829057"},{"redirect":null,"path":"/filecenter","ver":null,"component":"filecenter","route":"1","meta":{"keepAlive":false,"des":null,"internalOrExternal":false,"componentName":"filecenter","title":"文件共享中心"},"name":"filecenter","id":"1862301712700166146"},{"redirect":null,"path":"/gasreport","ver":null,"component":"gasreport","route":"1","meta":{"keepAlive":false,"des":null,"internalOrExternal":false,"componentName":"gasreport","title":"瓦斯上报"},"name":"gasreport","id":"1862302433877184513"}]
-		}
-      return data
-    }
+      var data = uni.getStorageSync("menuPermission");
+      console.log(JSON.stringify(data));
+      if (data == null || data == "" || data.length == 0) {
+        data = [
+          {
+            redirect: null,
+            path: "/device",
+            ver: null,
+            component: "device",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "device",
+              title: "设备中心",
+            },
+            name: "device",
+            id: "1862300062379954178",
+          },
+          {
+            redirect: null,
+            path: "/warndata",
+            ver: null,
+            component: "warndata",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "warndata",
+              title: "预警分析",
+            },
+            name: "warndata",
+            id: "1862301272310829057",
+          },
+          {
+            redirect: null,
+            path: "/filecenter",
+            ver: null,
+            component: "filecenter",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "filecenter",
+              title: "文件共享中心",
+            },
+            name: "filecenter",
+            id: "1862301712700166146",
+          },
+          {
+            redirect: null,
+            path: "/gasreport",
+            ver: null,
+            component: "gasreport",
+            route: "1",
+            meta: {
+              keepAlive: false,
+              des: null,
+              internalOrExternal: false,
+              componentName: "gasreport",
+              title: "瓦斯上报",
+            },
+            name: "gasreport",
+            id: "1862302433877184513",
+          },
+        ];
+      }
+      return data;
+    },
   },
   watch: {
     permission: {
       handler(newV, oldV) {
-		  debugger
-		if(newV!=null && newV != "")
-          this.PageCur=newV[0].component
+        debugger;
+        if (newV != null && newV != "") this.PageCur = newV[0].component;
       },
       immediate: true,
-    }
+    },
   },
   onLoad() {
     this.changeWV();
   },
-  mounted() { },
+  mounted() {},
   onShow() {
     // this.changeWV()
   },
@@ -136,9 +232,9 @@ export default {
           _this.wvHeight = _this.isLandScape
             ? sysinfo.windowHeight - sysinfo.statusBarHeight - 20
             : sysinfo.windowHeight -
-            sysinfo.statusBarHeight -
-            sysinfo.statusBarHeight -
-            38;
+              sysinfo.statusBarHeight -
+              sysinfo.statusBarHeight -
+              38;
           _this.wvWidth = _this.isLandScape
             ? sysinfo.windowWidth
             : sysinfo.windowWidth;

+ 19 - 20
pages/warndata/warndata.vue

@@ -16,7 +16,6 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">通风监测预警</text>
-            <u-icon name="eye" @click="getDetail('vent')"></u-icon>
           </view>
           <u-icon @click="toggleIsShow1" name="arrow-up-fill"></u-icon>
         </view>
@@ -24,10 +23,10 @@
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">通风监测预警</text>
-          <u-icon @click="toggleIsShow1" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow1" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow1">
+      <view class="flcard" @click="getDetail('vent')" v-show="isShow1">
         <view class="datacard demo-layout bg-purple-light">
           <view style="margin-top: 10rpx">
             <text class="text-style1">{{ windData.zongjinfeng }}</text>
@@ -51,18 +50,17 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">火灾监测预警</text>
-            <u-icon name="eye" @click="getDetail('fire')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow2" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow2" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">火灾监测预警</text>
-          <u-icon @click="toggleIsShow2" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow2" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow2">
+      <view class="flcard" v-show="isShow2" @click="getDetail('fire')">
         <view class="firecontainer">
           <view class="title">
             <span class="firetext">内因火灾</span>
@@ -109,18 +107,17 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">粉尘监测预警</text>
-            <u-icon name="eye" @click="getDetail('dust')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow3" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow3" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">粉尘监测预警</text>
-          <u-icon @click="toggleIsShow3" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow3" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow3">
+      <view class="flcard" v-show="isShow3" @click="getDetail('dust')">
         <view class="firecard fire-style">
           <view v-for="(value, key) in dustData" :key="key" class="fire-item">
             <view style="margin-top: 20rpx">
@@ -141,25 +138,24 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">瓦斯监测预警</text>
-            <u-icon name="eye" @click="getDetail('gas')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow4" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow4" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">瓦斯监测预警</text>
-          <u-icon @click="toggleIsShow4" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow4" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard" v-show="isShow4">
+      <view class="flcard" v-show="isShow4" @click="getDetail('gas')">
         <view class="firecontainer">
           <view class="title">
             <span class="firetext" v-if="gasDevice.length > 0"
               >安全监测系统监测点</span
             >
           </view>
-          <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.gasNumber }}</text>
               <view style="margin: 10rpx">{{ item.systemname }}</view>
@@ -186,18 +182,21 @@
         <view class="typeBar">
           <view class="icon-vent">
             <text class="text-style">设备监测预警</text>
-            <u-icon name="eye" @click="getDetail('device')"></u-icon>
           </view>
-          <u-icon @click="toggleIsShow5" name="arrow-up"></u-icon>
+          <u-icon @click="toggleIsShow5" name="arrow-up-fill"></u-icon>
         </view>
       </view>
       <view class="flcard" v-else>
         <view class="typeBar">
           <text class="text-style">设备监测预警</text>
-          <u-icon @click="toggleIsShow5" name="arrow-down"></u-icon>
+          <u-icon @click="toggleIsShow5" name="arrow-down-fill"></u-icon>
         </view>
       </view>
-      <view class="flcard demo-layout bg-purple-light" v-show="isShow5">
+      <view
+        class="flcard demo-layout bg-purple-light"
+        v-show="isShow5"
+        @click="getDetail('device')"
+      >
         <view class="deviceCard">
           <view
             class="item-container"