修改全文检索
This commit is contained in:
parent
a41172471a
commit
36adff7ab2
|
@ -21,18 +21,9 @@
|
|||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
>
|
||||
<a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
|
||||
:pagination="pagination" :scroll="{ y: 'calc(100vh - 420px)' }" rowKey="id"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="download(record,$event)">下载</a> <a @click="viewFile(record,$event)">预览</a>
|
||||
</span>
|
||||
|
@ -43,6 +34,7 @@
|
|||
<script>
|
||||
import {createDir,logicDelDir,renameDir,dirtreeList} from '@/api/dirapi'
|
||||
import {downloadFile,filePreview,fullTextSearching} from '@/api/fileapi'
|
||||
|
||||
export default {
|
||||
name: "fileManage",
|
||||
data() {
|
||||
|
@ -80,12 +72,6 @@ export default {
|
|||
width: 80,
|
||||
dataIndex: 'fileTypeName'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'createByName'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
|
@ -122,6 +108,17 @@ export default {
|
|||
searchFile:{
|
||||
"queryCriteria":"",
|
||||
"fileType":"",
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
pagination: {
|
||||
defaultCurrent: 1, // 默认当前页数
|
||||
defaultPageSize: 10, // 默认当前页显示数据的大小total: 0, // 总数,必须先有
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: false,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
showTotal: total => `总共 ${total} 个项目`, // 显示总数
|
||||
onShowSizeChange: (current, pageSize) => (this.pageSize = pageSize)
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -135,14 +132,11 @@ export default {
|
|||
},
|
||||
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();
|
||||
this.pagination = pagination
|
||||
this.searchFile.pageNum = pagination.current
|
||||
this.searchFile.pageSize = pagination.pageSize
|
||||
console.log(pagination.pageSize)
|
||||
this.getFileList()
|
||||
},
|
||||
download(item){
|
||||
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
|
||||
|
@ -166,18 +160,14 @@ export default {
|
|||
this.getFileList();
|
||||
},
|
||||
getFileList(){
|
||||
if(this.selectId == "0"){
|
||||
this.$message.warning("必须选择查询目录");
|
||||
return;
|
||||
}
|
||||
this.searchFile.fileType = this.checkboxValue.join()
|
||||
fullTextSearching(this.searchFile).then((res) => {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
this.dataSource = res.result
|
||||
if(res.result.total)
|
||||
{
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
const pagination = { ...this.pagination }
|
||||
this.dataSource = res.result.rows
|
||||
pagination.total = res.result.total
|
||||
this.pagination = pagination
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user