Skip to content

Commit be4b78e

Browse files
committed
add screen for table
1 parent 098fe34 commit be4b78e

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

src/components/page/BaseTable.vue

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@
66
<el-breadcrumb-item>基础表格</el-breadcrumb-item>
77
</el-breadcrumb>
88
</div>
9-
10-
<el-table :data="tableData" border style="width: 100%">
9+
<div class="handle-box">
10+
<el-button class="handle-del mr10">批量删除</el-button>
11+
<el-select v-model="select_cate" placeholder="筛选省份" class="handle-select mr10">
12+
<el-option key="1" label="广东省" value="1"></el-option>
13+
<el-option key="2" label="湖南省" value="2"></el-option>
14+
</el-select>
15+
<el-input v-model="select_word" placeholder="筛选关键词" class="handle-input mr10"></el-input>
16+
<el-button type="primary" icon="search">搜索</el-button>
17+
</div>
18+
<el-table :data="tableData" border style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange">
19+
<el-table-column type="selection" width="55"></el-table-column>
1120
<el-table-column prop="date" label="日期" sortable width="150">
1221
</el-table-column>
1322
<el-table-column prop="name" label="姓名" width="120">
@@ -39,7 +48,10 @@
3948
return {
4049
url: '../../../static/vuetable.json',
4150
tableData: [],
42-
cur_page: 1
51+
cur_page: 1,
52+
multipleSelection: [],
53+
select_cate: '',
54+
select_word: ''
4355
}
4456
},
4557
created(){
@@ -70,7 +82,27 @@
7082
},
7183
handleDelete(index, row) {
7284
this.$message.error('删除第'+(index+1)+'');
85+
},
86+
handleSelectionChange: function(val) {
87+
this.multipleSelection = val;
7388
}
7489
}
7590
}
76-
</script>
91+
</script>
92+
93+
<style scoped>
94+
.handle-box{
95+
margin-bottom: 20px;
96+
}
97+
.handle-del{
98+
border-color: #bfcbd9;
99+
color: #999;
100+
}
101+
.handle-select{
102+
width: 120px;
103+
}
104+
.handle-input{
105+
width: 300px;
106+
display: inline-block;
107+
}
108+
</style>

static/css/main.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ a{text-decoration: none}
3434
.el-button+.el-tooltip {
3535
margin-left: 10px;
3636
}
37-
.el-table td,.el-table th{
38-
padding:5px 18px;
39-
}
37+
4038
.el-table tr:hover{
4139
background: #f6faff;
4240
}

0 commit comments

Comments
 (0)