Просмотр исходного кода

表格组件增加已选条数

@dongkboy 1 год назад
Родитель
Сommit
d8391e9b22
1 измененных файлов с 16 добавлено и 1 удалено
  1. 16 1
      src/views/Core/KtCommonTable.vue

+ 16 - 1
src/views/Core/KtCommonTable.vue

@@ -432,7 +432,7 @@
     </el-table>
     <!--分页栏-->
     <!-- 底部分页 -->
-    <div class="bottomFixed" ref="bottomFixed">
+    <div class="bottomFixed flex a-c" ref="bottomFixed">
       <kt-button
         :label="customToolName"
         :perms="permscustomTool"
@@ -494,6 +494,9 @@
         style="float: left"
         v-if="showBatchPrint"
       />
+      <div v-if="tableSelectedCount" class="tableSelectedCountClass" >已选
+          <span >{{ tableSelectedCount }}</span>
+        条</div>
       <el-pagination
         background
         @size-change="handleSizeChange"
@@ -506,6 +509,7 @@
         style="float: left; margin-left: 20px"
         v-if="isshowpagination"
       >
+
       </el-pagination>
     </div>
   </div>
@@ -809,6 +813,7 @@ export default {
   },
   data() {
     return {
+      tableSelectedCount:"",
       tableHeight: 0,
       loading: false, // 加载标识
       selections: [], // 列表选中列
@@ -1012,6 +1017,7 @@ export default {
     },
     // 选择切换
     selectionChange: function (selections) {
+      this.tableSelectedCount=selections.length;
       this.selections = selections;
       this.$emit("selectionChange", {
         selections: selections,
@@ -1347,6 +1353,15 @@ export default {
 }
 </style>
 <style lang="scss" scoped>
+.tableSelectedCountClass{
+  color: #606266;
+  font-size: 14px;
+  font-weight: bold;
+  margin-left: 10px;
+  span{
+    color:red;
+  }
+}
 /deep/ .el-tag--plain {
   background: rgba(93, 125, 255, 0.1);
   border-radius: 4px;