Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
7f9531d4f3
|
@ -126,16 +126,6 @@ export default {
|
|||
align: "center",
|
||||
dataIndex: 'dataNum'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align: "center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '最后更新时间',
|
||||
align: "center",
|
||||
dataIndex: 'endTime'
|
||||
},
|
||||
{
|
||||
title: '标签类型',
|
||||
align: "center",
|
||||
|
|
|
@ -128,16 +128,6 @@
|
|||
align:"center",
|
||||
dataIndex: 'tableMessName'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align:"center",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '最后更新时间',
|
||||
align:"center",
|
||||
dataIndex: 'endTime'
|
||||
},
|
||||
{
|
||||
title: '标签类型',
|
||||
align:"center",
|
||||
|
|
|
@ -91,8 +91,8 @@ export default {
|
|||
tableParams: {
|
||||
schemaMass: null,
|
||||
tableName: null,
|
||||
startDateString: null,
|
||||
endDateString: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
},
|
||||
|
@ -182,14 +182,14 @@ export default {
|
|||
onChangeTime(date, dateString) {
|
||||
if (date.length == 0) {
|
||||
this.defaultTime = []
|
||||
this.tableParams.startDateString = null
|
||||
this.tableParams.endDateString = null
|
||||
this.tableParams.startTime = null
|
||||
this.tableParams.endTime = null
|
||||
this.tableParams.pageNum = 1
|
||||
this.getTableDataList()
|
||||
} else {
|
||||
this.tableParams.startDateString = moment(date[0]).format(this.dateFormat);
|
||||
this.tableParams.endDateString = moment(date[1]).format(this.dateFormat);
|
||||
this.defaultTime = [this.tableParams.startDateString, this.tableParams.endDateString]
|
||||
this.tableParams.startTime = moment(date[0]).format(this.dateFormat);
|
||||
this.tableParams.endTime = moment(date[1]).format(this.dateFormat);
|
||||
this.defaultTime = [this.tableParams.startTime, this.tableParams.endTime]
|
||||
this.tableParams.pageNum = 1
|
||||
this.getTableDataList()
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ export default {
|
|||
maxFile: Number,
|
||||
accept: {
|
||||
type: String,
|
||||
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg'
|
||||
default: '.txt,.csv'
|
||||
},
|
||||
autoUpload: { // 自动上传
|
||||
type: Boolean,
|
||||
|
@ -200,6 +200,13 @@ export default {
|
|||
this.$message.warning("请先选择上传的模式");
|
||||
return
|
||||
}
|
||||
const isValidExtension = this.accept.split(',').some(ext =>
|
||||
file.name.toLowerCase().endsWith(ext)
|
||||
);
|
||||
if (!isValidExtension) {
|
||||
this.$message.error(file.name+'文件类型错误阻止上传!');
|
||||
return false;
|
||||
}
|
||||
// 开始执行上传逻辑
|
||||
const currentRow = this.tableDate.find((row) => row.uid === file.uid)
|
||||
if (currentRow) {
|
||||
|
|
|
@ -20,9 +20,10 @@
|
|||
</a-form>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" class="fileTable"
|
||||
:dataSource="dataSource" :loading="loading"
|
||||
>
|
||||
|
||||
<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>
|
||||
|
@ -33,6 +34,7 @@
|
|||
<script>
|
||||
import {createDir,logicDelDir,renameDir,dirtreeList} from '@/api/dirapi'
|
||||
import {downloadFile,filePreview,fullTextSearching} from '@/api/fileapi'
|
||||
|
||||
export default {
|
||||
name: "fileManage",
|
||||
data() {
|
||||
|
@ -70,12 +72,6 @@ export default {
|
|||
width: 80,
|
||||
dataIndex: 'fileTypeName'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'createByName'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
|
@ -112,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)
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -124,6 +131,13 @@ export default {
|
|||
|
||||
},
|
||||
methods: {
|
||||
handleTableChange(pagination, filters, sorter) {
|
||||
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";
|
||||
window.open(apiBaseUrl+"/file/downloadFile?fileId="+item.id);
|
||||
|
@ -146,14 +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
|
||||
const pagination = { ...this.pagination }
|
||||
this.dataSource = res.result.rows
|
||||
pagination.total = res.result.total
|
||||
this.pagination = pagination
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ export default {
|
|||
maxFile: Number,
|
||||
accept: {
|
||||
type: String,
|
||||
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg'
|
||||
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg,.bmp,.mp4,.avi,.wmv,.mkv,.flv,.mp3,.sql,.db,.dmp,.xls,.xlsx,.wps,.et,.csv,.xml,.json,.other'
|
||||
},
|
||||
autoUpload: { // 自动上传
|
||||
type: Boolean,
|
||||
|
@ -209,10 +209,18 @@ export default {
|
|||
this.$message.error('文件目录选择异常请刷新页面')
|
||||
return;
|
||||
}
|
||||
|
||||
// if(this.taskId.length <= 0){
|
||||
// this.$message.error('请选择任务')
|
||||
// return;
|
||||
// }
|
||||
const isValidExtension = this.accept.split(',').some(ext =>
|
||||
file.name.toLowerCase().endsWith(ext)
|
||||
);
|
||||
if (!isValidExtension) {
|
||||
this.$message.error(file.name+'文件类型错误阻止上传!');
|
||||
return false;
|
||||
}
|
||||
const currentRow = this.tableDate.find((row) => row.uid === file.uid)
|
||||
if (currentRow) {
|
||||
// 当前上传进度归0
|
||||
|
|
|
@ -207,12 +207,12 @@ import { taskCreate,
|
|||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
this.close()
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}else{
|
||||
taskUpdateById({id:this.model.id,name:values.name,describe:values.describe,shipModelId:values.shipModelId,shipNumId:values.shipNumId,
|
||||
|
@ -221,12 +221,12 @@ import { taskCreate,
|
|||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
this.close()
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user