开启分片

This commit is contained in:
RenCheng 2025-02-24 14:41:28 +08:00
parent 995f5677bb
commit 240e52f077
5 changed files with 234 additions and 10 deletions

View File

@ -3,10 +3,12 @@ import { getAction, deleteAction, putAction, postAction, httpAction,uploadAction
const getFileLinkInfo = (params)=>getAction("/fileDataLink/getFileLinkInfo",params); const getFileLinkInfo = (params)=>getAction("/fileDataLink/getFileLinkInfo",params);
const processFile = (params)=>postAction("/fileDataLink/processFile",params); const processFile = (params)=>postAction("/fileDataLink/processFile",params);
const fileDataLinkDelete = (params)=>deleteAction("/fileDataLink/delete",params); const fileDataLinkDelete = (params)=>deleteAction("/fileDataLink/delete",params);
const isDataLinkFileParsed = (params)=>getAction("/fileDataLink/isDataLinkFileParsed",params);
export { export {
getFileLinkInfo, getFileLinkInfo,
processFile, processFile,
fileDataLinkDelete fileDataLinkDelete,
isDataLinkFileParsed
} }

21
src/api/recycleBin.js Normal file
View File

@ -0,0 +1,21 @@
import { getAction, deleteAction, putAction, postAction, httpAction,uploadAction } from '@/api/manage'
//上传文件目录管理
const downloadFile = (params)=>httpAction("/file/downloadFile",params);
const filePreview = (params)=>getAction("/file/filePreview",params);
const logicDeleteFile = (params)=>deleteAction("/file/logicDeleteFile",params);
const pageList = (params)=>getAction("/file/pageList",params);
const uoloadFile = (params)=>uploadAction("/file/uoloadFile",params);
const verifyFileExist = (params)=>getAction("/file/verifyFileExist",params);
const fullTextSearching = (params)=>getAction("/file/fullTextSearching",params);
export {
downloadFile,
filePreview,
logicDeleteFile,
pageList,
uoloadFile,
verifyFileExist,
fullTextSearching
}

View File

@ -182,7 +182,7 @@ export default {
if (currentRow) { if (currentRow) {
// 0 // 0
currentRow.percentage = 0 currentRow.percentage = 0
const _20M = 200000000000 * 1024 * 1024 // const _20M = 20 * 1024 * 1024 //
if (file.size > _20M) { // 20M if (file.size > _20M) { // 20M
this.uploadByPieces({ // this.uploadByPieces({ //
file, // file, //

View File

@ -42,14 +42,8 @@
<!-- :locale="myLocale"--> <!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
<span slot="name" slot-scope="text">
<j-ellipsis :value="text" :length="20" />
</span>
<span slot="describe" slot-scope="text">
<j-ellipsis :value="text" :length="20" />
</span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="processFile(record)" v-has="'cont:btn'">解析</a> <a @click="processFile(record)" v-has="'cont:btn'" >解析</a>
<a-divider type="vertical" v-has="'cont:btn'" /> <a-divider type="vertical" v-has="'cont:btn'" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
@ -66,7 +60,7 @@
<script> <script>
import uploadModal from './modules/uploadModal' import uploadModal from './modules/uploadModal'
import { getFileLinkInfo,processFile,fileDataLinkDelete } from '@/api/fileDataLink' import { getFileLinkInfo,processFile,fileDataLinkDelete,isDataLinkFileParsed } from '@/api/fileDataLink'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from "@/components/jeecg/JEllipsis"; import JEllipsis from "@/components/jeecg/JEllipsis";
import {deleteAction, postAction} from '@/api/manage' import {deleteAction, postAction} from '@/api/manage'

View File

@ -0,0 +1,207 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="模式名称">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.schemaName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="表名">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.tableName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24" >
<a-button type="primary" style="left: 10px" @click="loadData" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
<a-button type="primary" @click="handleAdd" icon="upload" style="margin-left: 8px;left: 10px">上传</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<div style="height:900px;overflow-y:auto;">
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
@change="handleTableChange">
<!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示-->
<span slot="action" slot-scope="text, record">
<a @click="processFile(record)" v-has="'cont:btn'" >解析</a>
<a-divider type="vertical" v-has="'cont:btn'" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<uploadModal ref="modalForm" @ok="loadData"></uploadModal>
</a-card>
</template>
<script>
import uploadModal from './modules/uploadModal'
import { getFileLinkInfo,processFile,fileDataLinkDelete,isDataLinkFileParsed } from '@/api/fileDataLink'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from "@/components/jeecg/JEllipsis";
import {deleteAction, postAction} from '@/api/manage'
export default {
name: "recycling",
mixins:[JeecgListMixin],
components: {
uploadModal,
JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
},
},
data () {
return {
description: '文件接引',
dataSources: [],
queryParam: {
pageNum :1,
pageSize:20,
schemaName:'',
tableName:'',
dataLinkType:'1'
},
columns: [
{
title: '#',
dataIndex: '',
key:'id',
width:60,
align:"id",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '文件名称',
align:"fileName",
dataIndex: 'fileName',
},
{
title: '创建时间',
align:"createTime",
dataIndex: 'createTime'
},
{
title: '模式名称',
align:"schemaName",
dataIndex: 'schemaName'
},
{
title: '表名',
align:"tableName",
dataIndex: 'tableName',
},
{
title: '解析进度',
align:"center",
dataIndex: 'percent',
},
{
title: '解析时间开始',
align:"analyzeStartTime",
dataIndex: 'analyzeStartTime',
},
{
title: '解析时间完成',
align:"analyzeEndTime",
dataIndex: 'analyzeEndTime',
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width:180,
scopedSlots: { customRender: 'action' },
}
]
}
},
computed: {
},
created () {
this.loadData();
},
methods: {
//handleTableChange
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.loadData();
},
loadData() {
getFileLinkInfo(this.queryParam).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
if(res.result.total)
{
this.ipagination.total = res.result.total;
}
} else {
this.$message.warning(res.message);
}
});
},
handleDelete: function (id) {
var that = this;
deleteAction("/fileDataLink/delete?id="+id,{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
that.loadData();
} else {
this.$message.warning(res.message);
}
});
},
processFile: function (record) {
var that = this;
postAction("/fileDataLink/processFile?dataLinkId="+record.id,{}).then((res) => {
if (res.success) {
this.$message.success(res.message);
that.loadData();
} else {
this.$message.warning(res.message);
}
});
},
handleAdd() {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "文件上传";
this.$refs.modalForm.dataLinkType=this.queryParam.dataLinkType;
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>