Преглед изворни кода

修改查看练习结果的表格分页展示

lm пре 1 месец
родитељ
комит
1e2ed2c360

+ 7 - 2
src/views/targetImprove/components/Table.vue

@@ -39,13 +39,14 @@
     </el-table>
 
     <div class="page_pagination" v-if="!hidePagination">
+      <slot name="paginationDesc"></slot>
       <el-pagination
         :hide-on-single-page="hidesinglePage"
         :current-page="currentPage"
         :page-size="pageSize"
         :page-sizes="[20, 50, 100]"
         background
-        layout="prev, pager, next"
+        :layout="(showPageSize ? 'sizes,' : '') + 'prev, pager, next'"
         :total="Number(totalNum)"
         @current-change="(val) => $emit('paginationChange', { type: 'currentPage', val })"
         @size-change="(val) => $emit('paginationChange', { type: 'pageSize', val })"
@@ -83,6 +84,10 @@ export default {
       type: Number,
       default: 1
     },
+    showPageSize:{
+      type:Boolean,
+      default:false
+    },
     pageSize: {
       type: Number,
       default: 20
@@ -158,7 +163,7 @@ export default {
 <style lang="scss" scoped>
 .page_table {
   // flex-shrink: 0;
-  overflow: auto;
+  // overflow: auto;
   display: flex;
   flex-direction: column;
   justify-content: flex-start;

+ 6 - 0
src/views/targetImprove/practice/practiceResults.vue

@@ -27,6 +27,7 @@
       
         <Table class="practice_table end_item" 
             :currentPage="currentPage" :pageSize="pageSize" :totalNum="totalNum"
+            :showPageSize="true"
             :tableData="tableData"  :tableColumns="tableColumns" 
             @paginationChange="HandlePaginationChange">
 
@@ -92,6 +93,11 @@
                     <el-button type="text" @click="viewDetails(row)">查看</el-button>
                 </div>
             </template>
+
+            <template v-slot:paginationDesc>
+                <span style="color:#666666;flex:1 1;">共 {{totalNum}} 条数据</span>
+            </template>
+            
         </Table>
 
         <div class="page_dialog">