diff --git a/src/components/NomalTable/index.vue b/src/components/NomalTable/index.vue index c31c678..de485f7 100644 --- a/src/components/NomalTable/index.vue +++ b/src/components/NomalTable/index.vue @@ -5,6 +5,7 @@
@@ -19,6 +20,7 @@
+ {{ head.text }}
@@ -26,7 +28,36 @@ + + + + + + +
+
+ {{ column.text }} +
+
+ 取消 + 确定 +
+
+ +
+ + +
+
+
+ + + @@ -75,7 +106,7 @@ limit: 20 } } - }, + }, // 查询条件,此处主要需要分页的条件 head: { type: Object, default: function() { @@ -84,7 +115,7 @@ text: '数据列表' } } - }, // 是否显示头 + }, // 是否显示头,一般需要再此行中加按钮需要设置为true listLoading: { type: Boolean, default: false @@ -98,7 +129,7 @@ total: { type: Number, default: 0 - }, + }, // 数据总数 columns: { type: Array, default: function() { @@ -109,7 +140,7 @@ type: Object, default: function() { return { - needIndex: true + needIndex: true // 是否需要序号列 } } }, // 配置项 @@ -122,11 +153,20 @@ size: { type: String, default: '' - }// 表格大小 + }, // 表格大小,默认,small,mini等,与el-table条件仙童 + toolsOption: { + type: Object, + default: function() { + return { + selectColumns: false, // 是否需要筛选列工具 + refresh: false // 是否需要刷新按钮 + } + } + }// 表格工具配置 }, data() { return { - columnsFiltered: [], // 过滤后的列请款 + columnsFiltered: [], // 过滤后的列情况 columnsChecked: [], // 显示列选择情况 visible: false, // 弹窗显示情况 animateClass: '' // 按钮动画效果 @@ -164,6 +204,10 @@ indexMethod(index) { return this.query.limit * (this.query.offset - 1) + index + 1 }, + // 刷新 + refresh() { + this.$emit('change') + }, // 改变页容量 handleSizeChange(val) { this.query.limit = val