Merge remote-tracking branch 'origin/main'

This commit is contained in:
hekaiyu 2025-05-10 22:48:49 +08:00
commit 7f9531d4f3
7 changed files with 54 additions and 45 deletions

View File

@ -126,16 +126,6 @@ export default {
align: "center",
dataIndex: 'dataNum'
},
{
title: '开始时间',
align: "center",
dataIndex: 'startTime'
},
{
title: '最后更新时间',
align: "center",
dataIndex: 'endTime'
},
{
title: '标签类型',
align: "center",

View File

@ -128,16 +128,6 @@
align:"center",
dataIndex: 'tableMessName'
},
{
title: '开始时间',
align:"center",
dataIndex: 'startTime'
},
{
title: '最后更新时间',
align:"center",
dataIndex: 'endTime'
},
{
title: '标签类型',
align:"center",

View File

@ -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()
}

View File

@ -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) {

View File

@ -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>&nbsp; <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);
}

View File

@ -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

View File

@ -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();
})
}
}