فهرست منبع

'楼层功能添加折行处理'

zhangyu 4 سال پیش
والد
کامیت
6103fab392
4فایلهای تغییر یافته به همراه47 افزوده شده و 11 حذف شده
  1. 1 1
      public/index.html
  2. 10 3
      src/views/AssetDetail.vue
  3. 21 4
      src/views/FloorFunc.vue
  4. 15 3
      src/views/overview/MapView.vue

+ 1 - 1
public/index.html

@@ -11,7 +11,7 @@
         <meta http-equiv="Cache" content="no-cache" />
         <!-- <meta name="viewport" content="target-densitydpi=device-dpi,width=750,user-scalable=0" /> -->
         <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
-        <link rel="stylesheet" href="//at.alicdn.com/t/font_2072883_4p4goyb4c3s.css" />
+        <link rel="stylesheet" href="//at.alicdn.com/t/font_2072883_81hqakjsv38.css" />
         <title><%= htmlWebpackPlugin.options.title %></title>
     </head>
     <body>

+ 10 - 3
src/views/AssetDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class='asset-detail'>
-    <van-nav-bar title="设备详情" @click-left='backPage' @click-right='handleRightClick'>
+    <van-nav-bar :title="isMaintenanceShow || isRepairShow?'设备详情':'设备信息'" @click-left='backPage' @click-right='handleRightClick'>
       <template #left>
         <van-icon name="arrow-left" size="18" color="#333333" />
       </template>
@@ -8,8 +8,10 @@
         <i class='iconfont wanda-scan'></i>
       </template>
     </van-nav-bar>
-
-    <van-tabs v-model='active' class='other-tabs' color='#025BAA' @change='changeTab' title-active-color='#025BAA'
+    <div class="asset-information" v-if="!isMaintenanceShow && !isRepairShow">
+      <Information :data="informationData" />
+    </div>
+    <van-tabs v-else v-model='active' class='other-tabs' color='#025BAA' @change='changeTab' title-active-color='#025BAA'
       :line-width='60'>
       <van-tab title='设备信息'>
         <Information :data="informationData" />
@@ -422,6 +424,11 @@ export default {
 .asset-detail {
   width: 100%;
   height: 100%;
+  .asset-information {
+    height: calc(100% - 45px);
+    background: #f5f6f7;
+    overflow-y: auto;
+  }
   .other-tabs {
     height: calc(100% - 46px);
     /deep/ .van-tab__text {

+ 21 - 4
src/views/FloorFunc.vue

@@ -2,13 +2,17 @@
   <div class='floor-function'>
     <div class="floor-item" v-for="floor in floorData" :key="floor.FloorId">
       <div class="floor-item-title">
-        <span class="floor-item-text"><i class="iconfont wanda-louceng1"></i> {{floor.FloorName}}</span>
+        <span class="floor-item-text">
+          <i class="iconfont" @click="handleClickOpenFloor(floor)"
+            :class="{'wanda-right-mini': !floor.Open, 'wanda-bottom-mini': floor.Open, 'icon-disable': !((floor.Statistics && floor.Statistics.length) || (floor.Properties && floor.Properties.length))}"></i>
+          {{floor.FloorName}}
+        </span>
         <p class="floor-item-goMap" @click='goToMapView(floor)'>
           <span>查看平面图 </span>
           <van-icon class='floor-item-arrow' name='arrow' />
         </p>
       </div>
-      <div v-if="floor.Statistics && floor.Statistics.length" class="floor-item-table">
+      <div v-if="floor.Statistics && floor.Statistics.length && floor.Open" class="floor-item-table">
         <table class="table-box">
           <tr>
             <th>
@@ -59,7 +63,7 @@
           查看附加数据
         </h2>
       </div>
-      <div v-else-if="floor.Properties && floor.Properties.length" class="floor-item-table">
+      <div v-else-if="floor.Properties && floor.Properties.length && floor.Open" class="floor-item-table">
         <table class="table-box">
           <tr>
             <th colspan="3">
@@ -137,13 +141,17 @@ export default {
                 return item.ItemExplain && item.ItemExplain !== "";
               })
               floor.Properties = arr;
+              floor.Open = false;
             }
             return floor;
           });
         })
       } else {
         appGraphElementQuery(params).then(res => {
-          this.floorData = res.Data;
+          this.floorData = res.Data.map(floor => {
+            floor.Open = false;
+            return floor;
+          });
         })
       }
     },
@@ -166,6 +174,12 @@ export default {
         }
       })
     },
+    // 展开楼层数据
+    handleClickOpenFloor(floor) {
+      if ((floor.Statistics && floor.Statistics.length) || (floor.Properties && floor.Properties.length)) {
+        floor.Open = !floor.Open;
+      }
+    },
     goToMapView(floor) {
       if (floor.FloorId && floor.FloorName) {
         let floorObj = {
@@ -206,6 +220,9 @@ export default {
         font-size: 16px;
         font-weight: 600;
         display: inline-block;
+        .icon-disable {
+          color: rgba(2, 91, 170, 0.3);
+        }
       }
       .floor-item-goMap {
         font-size: 14px;

+ 15 - 3
src/views/overview/MapView.vue

@@ -87,7 +87,11 @@ export default {
   },
   methods: {
     backPage() {
-      this.$router.go(-1)
+      if (this.direction === '横屏') {
+        this.roateY()
+        this.direction = '竖屏'
+      }
+      this.$router.go(-1);
     },
     // 切换楼层
     emitFloor(floorObj) {
@@ -475,8 +479,16 @@ export default {
         this.$nextTick(() => {
           this.floorid = floor.FloorId;
           this.floorName = floor.FloorName;
-          this.$refs.fList.currentFloorId = floor.FloorId;
-          this.init(floor.FloorId);
+          let index = this.floorsArr.findIndex(item => {
+            return item.gcname === floor.FloorId
+          })
+          let item = {
+            gcname: floor.FloorId,
+            code: floor.FloorName
+          }
+          this.$refs.fList.tabFloor(item ,index);
+          // this.$refs.fList.currentFloorId = floor.FloorId;
+          // this.init(floor.FloorId);
         })
       },
       immediate: true,