修改分页
This commit is contained in:
parent
691b8f7112
commit
a41172471a
|
@ -20,8 +20,18 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 15px">
|
<div style="margin-top: 15px">
|
||||||
<a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" class="fileTable"
|
|
||||||
:dataSource="dataSource" :loading="loading"
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
bordered
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:loading="loading"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
|
||||||
|
@change="handleTableChange">
|
||||||
>
|
>
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<a @click="download(record,$event)">下载</a> <a @click="viewFile(record,$event)">预览</a>
|
<a @click="download(record,$event)">下载</a> <a @click="viewFile(record,$event)">预览</a>
|
||||||
|
@ -124,6 +134,16 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleTableChange(pagination, filters, sorter) {
|
||||||
|
//分页、排序、筛选变化时触发
|
||||||
|
//TODO 筛选
|
||||||
|
if (Object.keys(sorter).length > 0) {
|
||||||
|
this.isorter.column = sorter.field;
|
||||||
|
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
||||||
|
}
|
||||||
|
this.ipagination = pagination;
|
||||||
|
this.getFileList();
|
||||||
|
},
|
||||||
download(item){
|
download(item){
|
||||||
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
|
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
|
||||||
window.open(apiBaseUrl+"/file/downloadFile?fileId="+item.id);
|
window.open(apiBaseUrl+"/file/downloadFile?fileId="+item.id);
|
||||||
|
@ -154,6 +174,10 @@ export default {
|
||||||
fullTextSearching(this.searchFile).then((res) => {
|
fullTextSearching(this.searchFile).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.dataSource = res.result
|
this.dataSource = res.result
|
||||||
|
if(res.result.total)
|
||||||
|
{
|
||||||
|
this.ipagination.total = res.result.total;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message);
|
this.$message.warning(res.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user