lilei 6 hónapja
szülő
commit
f3c1c15411

+ 16 - 4
src/components/VTable/index.vue

@@ -16,8 +16,9 @@
         :columnHiddenOption="columnHiddenOption"
         :row-style-option="{clickHighlight: true}"
         :cellSelectionOption="{enable: false}"
-        :virtual-scroll-option="{enable: false}"
+        :virtual-scroll-option="{enable: true}"
       />
+      <div v-show="localDataSource.length==0" :style="{height:scroll.y+'px'}" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
       <div class="ve-pagination">
         <div class="ve-page-left"></div>
         <a-pagination
@@ -39,6 +40,7 @@
 </template>
 
 <script>
+import { Empty } from 'ant-design-vue'
 export default {
   name: 'VTable',
   props: {
@@ -80,14 +82,13 @@ export default {
   },
   computed: {
     veColumns () {
-      const arr = this.convertColumns(this.columns)
-      console.log(arr)
-      return arr
+      return this.convertColumns(this.columns)
     }
   },
   data () {
     return {
       localLoading: false,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       localDataSource: [],
       sortObj: null,
       isSucceed: true, //  是否请求成功
@@ -286,6 +287,17 @@ export default {
     .ant-spin-container{
       height: 100%;
     }
+    .empty-data{
+        color: #999;
+        text-align: center;
+        position: absolute;
+        bottom: 0;
+        width: 100%;
+        display: flex;
+        align-items: center;
+        flex-direction: column;
+        justify-content: center;
+    }
     .ve-pagination{
       display:flex;
       justify-content: space-between;

+ 1 - 2
src/views/salesManagement/salesQueryNew/list.vue

@@ -179,8 +179,7 @@
           class="sTable fixPagination"
           ref="table"
           :style="{ height: tableHeight+35+'px' }"
-          size="small"
-          :rowKey="(record) => record.id"
+          :pagination="{pageSize:20}"
           :columns="columns"
           :data="loadData"
           :scroll="{ y: tableHeight }"