修改全文检索

This commit is contained in:
RenCheng 2025-05-09 23:54:22 +08:00
parent a41172471a
commit 36adff7ab2

View File

@ -21,18 +21,9 @@
</div> </div>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<a-table <a-table size="middle" bordered :columns="columns" :data-source="dataSource" :loading="loading"
ref="table" :pagination="pagination" :scroll="{ y: 'calc(100vh - 420px)' }" rowKey="id"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange">
>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="download(record,$event)">下载</a>&nbsp; <a @click="viewFile(record,$event)">预览</a> <a @click="download(record,$event)">下载</a>&nbsp; <a @click="viewFile(record,$event)">预览</a>
</span> </span>
@ -43,6 +34,7 @@
<script> <script>
import {createDir,logicDelDir,renameDir,dirtreeList} from '@/api/dirapi' import {createDir,logicDelDir,renameDir,dirtreeList} from '@/api/dirapi'
import {downloadFile,filePreview,fullTextSearching} from '@/api/fileapi' import {downloadFile,filePreview,fullTextSearching} from '@/api/fileapi'
export default { export default {
name: "fileManage", name: "fileManage",
data() { data() {
@ -80,12 +72,6 @@ export default {
width: 80, width: 80,
dataIndex: 'fileTypeName' dataIndex: 'fileTypeName'
}, },
{
title: '创建人',
align: "center",
width: 100,
dataIndex: 'createByName'
},
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
@ -122,6 +108,17 @@ export default {
searchFile:{ searchFile:{
"queryCriteria":"", "queryCriteria":"",
"fileType":"", "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: { methods: {
handleTableChange(pagination, filters, sorter) { handleTableChange(pagination, filters, sorter) {
// this.pagination = pagination
//TODO this.searchFile.pageNum = pagination.current
if (Object.keys(sorter).length > 0) { this.searchFile.pageSize = pagination.pageSize
this.isorter.column = sorter.field; console.log(pagination.pageSize)
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" this.getFileList()
}
this.ipagination = pagination;
this.getFileList();
}, },
download(item){ download(item){
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot"; let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
@ -166,18 +160,14 @@ export default {
this.getFileList(); this.getFileList();
}, },
getFileList(){ getFileList(){
if(this.selectId == "0"){
this.$message.warning("必须选择查询目录");
return;
}
this.searchFile.fileType = this.checkboxValue.join() this.searchFile.fileType = this.checkboxValue.join()
fullTextSearching(this.searchFile).then((res) => { fullTextSearching(this.searchFile).then((res) => {
console.log(res)
if (res.success) { if (res.success) {
this.dataSource = res.result const pagination = { ...this.pagination }
if(res.result.total) this.dataSource = res.result.rows
{ pagination.total = res.result.total
this.ipagination.total = res.result.total; this.pagination = pagination
}
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }