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", align: "center",
dataIndex: 'dataNum' dataIndex: 'dataNum'
}, },
{
title: '开始时间',
align: "center",
dataIndex: 'startTime'
},
{
title: '最后更新时间',
align: "center",
dataIndex: 'endTime'
},
{ {
title: '标签类型', title: '标签类型',
align: "center", align: "center",

View File

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

View File

@ -91,8 +91,8 @@ export default {
tableParams: { tableParams: {
schemaMass: null, schemaMass: null,
tableName: null, tableName: null,
startDateString: null, startTime: null,
endDateString: null, endTime: null,
pageSize: 10, pageSize: 10,
pageNum: 1 pageNum: 1
}, },
@ -182,14 +182,14 @@ export default {
onChangeTime(date, dateString) { onChangeTime(date, dateString) {
if (date.length == 0) { if (date.length == 0) {
this.defaultTime = [] this.defaultTime = []
this.tableParams.startDateString = null this.tableParams.startTime = null
this.tableParams.endDateString = null this.tableParams.endTime = null
this.tableParams.pageNum = 1 this.tableParams.pageNum = 1
this.getTableDataList() this.getTableDataList()
} else { } else {
this.tableParams.startDateString = moment(date[0]).format(this.dateFormat); this.tableParams.startTime = moment(date[0]).format(this.dateFormat);
this.tableParams.endDateString = moment(date[1]).format(this.dateFormat); this.tableParams.endTime = moment(date[1]).format(this.dateFormat);
this.defaultTime = [this.tableParams.startDateString, this.tableParams.endDateString] this.defaultTime = [this.tableParams.startTime, this.tableParams.endTime]
this.tableParams.pageNum = 1 this.tableParams.pageNum = 1
this.getTableDataList() this.getTableDataList()
} }

View File

@ -75,7 +75,7 @@ export default {
maxFile: Number, maxFile: Number,
accept: { accept: {
type: String, type: String,
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg' default: '.txt,.csv'
}, },
autoUpload: { // autoUpload: { //
type: Boolean, type: Boolean,
@ -200,6 +200,13 @@ export default {
this.$message.warning("请先选择上传的模式"); this.$message.warning("请先选择上传的模式");
return 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) const currentRow = this.tableDate.find((row) => row.uid === file.uid)
if (currentRow) { if (currentRow) {

View File

@ -20,9 +20,10 @@
</a-form> </a-form>
</div> </div>
<div style="margin-top: 15px"> <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"> <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>
@ -33,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() {
@ -70,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',
@ -112,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)
}, },
} }
}, },
@ -124,6 +131,13 @@ export default {
}, },
methods: { 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){ download(item){
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot"; let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
window.open(apiBaseUrl+"/file/downloadFile?fileId="+item.id); window.open(apiBaseUrl+"/file/downloadFile?fileId="+item.id);
@ -146,14 +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 }
this.dataSource = res.result.rows
pagination.total = res.result.total
this.pagination = pagination
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }

View File

@ -75,7 +75,7 @@ export default {
maxFile: Number, maxFile: Number,
accept: { accept: {
type: String, 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: { // autoUpload: { //
type: Boolean, type: Boolean,
@ -209,10 +209,18 @@ export default {
this.$message.error('文件目录选择异常请刷新页面') this.$message.error('文件目录选择异常请刷新页面')
return; return;
} }
// if(this.taskId.length <= 0){ // if(this.taskId.length <= 0){
// this.$message.error('') // this.$message.error('')
// return; // 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) const currentRow = this.tableDate.find((row) => row.uid === file.uid)
if (currentRow) { if (currentRow) {
// 0 // 0

View File

@ -207,12 +207,12 @@ import { taskCreate,
if(res.success){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.$emit('ok'); that.$emit('ok');
this.close()
}else{ }else{
that.$message.warning(res.message); that.$message.warning(res.message);
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false;
that.close();
}) })
}else{ }else{
taskUpdateById({id:this.model.id,name:values.name,describe:values.describe,shipModelId:values.shipModelId,shipNumId:values.shipNumId, 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){ if(res.success){
that.$message.success(res.message); that.$message.success(res.message);
that.$emit('ok'); that.$emit('ok');
this.close()
}else{ }else{
that.$message.warning(res.message); that.$message.warning(res.message);
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false;
that.close();
}) })
} }
} }