Browse Source

暂无数据图片修改

yunxing 4 years ago
parent
commit
51698c49fd

+ 23 - 3
src/views/otherMatter/ComprehensiveMatter.vue

@@ -34,7 +34,11 @@
             </van-list>
         </div>
         <div class='main' v-show='noData'>
-            <van-empty description='暂无数据' />
+            <van-empty class='m-empty' description='暂无数据'>
+                <template #image>
+                    <img class='no-data' src='../../assets/images/search_null.png' alt />
+                </template>
+            </van-empty>
         </div>
     </div>
 </template>
@@ -353,8 +357,24 @@ export default {
                 }
             }
         }
-        /deep/ .van-empty {
-            height: 100%;
+        // 空状态
+        .m-empty {
+            // position: fixed;
+            // top: 0;
+            // left: 0;
+            // width: 100%;
+            // height: 100%;
+            display: flex;
+            align-items: center;
+            /deep/ .van-empty__image {
+                display: flex;
+                justify-content: center;
+                align-items: flex-end;
+                img {
+                    width: auto !important;
+                    height: auto !important;
+                }
+            }
         }
     }
 }

+ 24 - 1
src/views/otherMatter/ComprehensiveMatterList.vue

@@ -40,7 +40,11 @@
             </van-list>
         </div>
         <div class='main' v-show='noData'>
-            <van-empty description='暂无数据' />
+            <van-empty class='m-empty' description='暂无数据'>
+                <template #image>
+                    <img class='no-data' src='../../assets/images/search_null.png' alt />
+                </template>
+            </van-empty>
         </div>
         <!-- 现场照片预览 -->
         <ImagePreview :key='imgKey' class='update-img-preview' :visible.sync='showImgPreview' :imgList='imgList' />
@@ -241,6 +245,25 @@ export default {
                 }
             }
         }
+        // 空状态
+        .m-empty {
+            // position: fixed;
+            // top: 0;
+            // left: 0;
+            // width: 100%;
+            // height: 100%;
+            display: flex;
+            align-items: center;
+            /deep/ .van-empty__image {
+                display: flex;
+                justify-content: center;
+                align-items: flex-end;
+                img {
+                    width: auto !important;
+                    height: auto !important;
+                }
+            }
+        }
     }
 }
 </style>

+ 49 - 18
src/views/overview/index.vue

@@ -88,7 +88,11 @@
                         </ul>
                         <ul class='zb' v-else>
                             <!--  暂无数据 -->
-                            <van-empty description='暂无数据' />
+                            <van-empty class='m-empty' description='暂无数据'>
+                                <template #image>
+                                    <img class='no-data' src='../../assets/images/search_null.png' alt />
+                                </template>
+                            </van-empty>
                         </ul>
                     </van-tab>
                     <van-tab title='分包'>
@@ -151,7 +155,11 @@
                         </ul>
                         <ul class='fb' v-else>
                             <!--   暂无数据 -->
-                            <van-empty description='暂无数据' />
+                            <van-empty class='m-empty' description='暂无数据'>
+                                <template #image>
+                                    <img class='no-data' src='../../assets/images/search_null.png' alt />
+                                </template>
+                            </van-empty>
                         </ul>
                     </van-tab>
                 </van-tabs>
@@ -160,7 +168,7 @@
         <div class='bottom'>
             <!-- <span v-if='false'>近一个月,重要维保8条,重要维修3条,其他事项5条,综合事项10条</span> -->
             <van-notice-bar
-                v-if='showNoticeBar'
+                v-if='showNoticeBar && noticeBarText.length>=25'
                 class='bottom-notice'
                 background='#e5eef6'
                 color='#025baa'
@@ -169,7 +177,8 @@
                 :text='noticeBarText'
                 @click='goToUpdateRecord'
             />
-            <span v-else>近一个月,说明书无更新</span>
+            <span v-else-if='noticeBarText && noticeBarText.length<25'>{{noticeBarText}}</span>
+            <span class='text' v-else>近一个月,说明书无更新</span>
             <van-icon v-show='showNoticeBar' class='building-arrow' name='arrow' size='14px' />
         </div>
     </div>
@@ -302,7 +311,20 @@ export default {
             }
             let data = await queryRecordCount({ getParams })
             console.log(data)
-            if (!data || data.result !== 'success') {
+            // 测试数据
+            // data = {
+            //     data: [
+            //         {
+            //             cnt: 6,
+            //             objtype: 4, //变更内容类型(1:重要维保 3:综合事项 4:重要维修 5:其他事项)
+            //         },
+            //         { cnt: 10, objtype: 1 },
+            //         { cnt: 45, objtype: 3 },
+            //         { cnt: 4, objtype: 5 },
+            //     ],
+            //     result: 'success',
+            // }
+            if (!data || data.result !== 'success' || !data.data.length) {
                 this.showNoticeBar = false //底部noticeBar 显隐
                 this.noticeBarText = ''
                 return true
@@ -311,18 +333,6 @@ export default {
             data.sort((a, b) => a.objtype - b.objtype)
             this.showNoticeBar = true
             this.noticeBarText = ''
-
-            /* 
-            // 测试数据
-            data = [
-                {
-                    cnt: 6,
-                    objtype: 4, //变更内容类型(1:重要维保 3:综合事项 4:重要维修 5:其他事项)
-                },
-                { cnt: 10, objtype: 1 },
-                { cnt: 45, objtype: 3 },
-                { cnt: 4, objtype: 5 },
-            ] */
             // 文本处理
             let noticeBarText = '近一个月,'
             data.map((item) => {
@@ -574,7 +584,25 @@ export default {
             }
         }
     }
-
+    // 空状态
+    .m-empty {
+        // position: fixed;
+        // top: 0;
+        // left: 0;
+        // width: 100%;
+        // height: 100%;
+        display: flex;
+        align-items: center;
+        /deep/ .van-empty__image {
+            display: flex;
+            justify-content: center;
+            align-items: flex-end;
+            img {
+                width: auto !important;
+                height: auto !important;
+            }
+        }
+    }
     // 底部固定条
     .bottom {
         width: 100%;
@@ -596,6 +624,9 @@ export default {
             width: 20px;
             // right: 16px;
         }
+        .text {
+            padding-left: 15px;
+        }
     }
 }