|
|
@@ -12,7 +12,7 @@
|
|
|
<div class="sort">
|
|
|
<Count :sum='sum'/>
|
|
|
<p>排序</p>
|
|
|
- <select v-model="order" @change="sort()">
|
|
|
+ <select v-model="order" @change="sort">
|
|
|
<option value="">按时间排序</option>
|
|
|
<option value="ASC">按时间降序</option>
|
|
|
<option value="DESC">按时间升序</option>
|
|
|
@@ -24,22 +24,32 @@
|
|
|
>
|
|
|
</Table>
|
|
|
</div>
|
|
|
+ <TablePage
|
|
|
+ :currentPage='currentPage'
|
|
|
+ :totalPage='totalPage'
|
|
|
+ @change_page='changePage'
|
|
|
+ @jump_page='jumpPage'
|
|
|
+ ></TablePage>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import Count from '../../components/Count';
|
|
|
import Table from './components/UploadRecordTable'
|
|
|
+import TablePage from '../../components/TablePage'
|
|
|
export default {
|
|
|
components: {
|
|
|
Count,
|
|
|
- Table
|
|
|
+ Table,
|
|
|
+ TablePage
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
inputValue: '请输入要搜索的资料名',
|
|
|
order: '', // 排序方式
|
|
|
- sum: '100', // 表格总数据
|
|
|
+ sum: 100, // 表格总数据
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 20,
|
|
|
data: [
|
|
|
{name:'雷克萨斯ES上市', time1:'2021/04',range: '共同', download1: 50, download2: 25, time2: '2021/03/10 18:19'},
|
|
|
{name:'雷克萨斯ES上市', time1:'2021/04',range: '共同', download1: 50, download2: 25, time2: '2021/03/10 18:19'},
|
|
|
@@ -49,6 +59,12 @@ export default {
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ // 表格总页数
|
|
|
+ totalPage() {
|
|
|
+ return Math.ceil(this.sum/this.pageSize);
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
focusInput: function() {
|
|
|
this.inputValue = '';
|
|
|
@@ -60,7 +76,29 @@ export default {
|
|
|
sort: function(){
|
|
|
// ASC降序
|
|
|
console.log(this.order);
|
|
|
- }
|
|
|
+ },
|
|
|
+ changePage: function(page) {
|
|
|
+ this.currentPage = page;
|
|
|
+ console.log(page);
|
|
|
+ },
|
|
|
+ // 点击上一页,下一页,首页,尾页
|
|
|
+ jumpPage: function(item) {
|
|
|
+ switch(item) {
|
|
|
+ case 1:
|
|
|
+ this.currentPage = 1;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.currentPage = this.currentPage - 1;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ this.currentPage = this.currentPage + 1;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ this.currentPage = this.totalPage;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ console.log(this.currentPage);
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
}
|
|
|
@@ -97,8 +135,14 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
margin-top: 10px;
|
|
|
+ height: 30px;
|
|
|
p{
|
|
|
- margin: 0 5px 0 15px;
|
|
|
+ margin: 10px 5px 0 15px;
|
|
|
+ text-align: center;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+ select{
|
|
|
+ border: 1px solid #ccc;
|
|
|
}
|
|
|
}
|
|
|
}
|