拆分条款详情修改
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="ocr-upload">
|
||||
<div class="split-import-upload">
|
||||
<!-- <a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title" class="ocr-upload-modal">-->
|
||||
<a-upload
|
||||
:accept='accept'
|
||||
@@ -13,7 +13,7 @@
|
||||
:headers="headers"
|
||||
:before-upload="beforeUpload"
|
||||
:remove='remove'
|
||||
:showUploadList="false"
|
||||
|
||||
@change="handleChange">
|
||||
<!-- <p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>-->
|
||||
<a-icon type="export" :rotate="-90" />
|
||||
@@ -50,21 +50,33 @@
|
||||
},
|
||||
methods:{
|
||||
beforeUpload(file,fileList) {
|
||||
// console.log('file',this.accept,file,fileList)
|
||||
console.log('file',this.accept,file,fileList,this.myfileList)
|
||||
this.fileTypeSatus=false
|
||||
// if(this.myfileList&&this.myfileList.length>=1){
|
||||
// this.$message.warning('只能上传一个文件')
|
||||
// return false
|
||||
// }else{
|
||||
if(this.myfileList&&this.myfileList.length>=1){
|
||||
// console.log()
|
||||
this.$message.warning('只能上传一个文件')
|
||||
return false
|
||||
}else{
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
if(file.type==this.accept){
|
||||
// console.log('accetptt',this.accept)
|
||||
let acceptFlag=false
|
||||
let accepts = this.accept.split(',')
|
||||
accepts.forEach((item,index)=>{
|
||||
if(item==file.type){
|
||||
acceptFlag=true
|
||||
return
|
||||
}else{
|
||||
acceptFlag=false
|
||||
}
|
||||
})
|
||||
if(acceptFlag){
|
||||
// console.log('111111')
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
}
|
||||
// }
|
||||
}
|
||||
},
|
||||
remove(){
|
||||
this.fileTypeSatus = true;
|
||||
@@ -81,6 +93,7 @@
|
||||
info.fileList.splice(index,1)
|
||||
}
|
||||
})
|
||||
console.log('fileStatue',this.fileTypeSatus)
|
||||
if (this.fileTypeSatus) {
|
||||
if (file.size > 100000000) {
|
||||
this.$message.error(this.errorMessage)
|
||||
@@ -134,10 +147,10 @@
|
||||
this.fileList.push(res)
|
||||
}
|
||||
})
|
||||
let fileList1=[]
|
||||
fileList1[0]=this.fileList[this.fileList.length-1]
|
||||
// let fileList1=[]
|
||||
// fileList1[0]=this.fileList[this.fileList.length-1]
|
||||
if(this.myfileList.length > 0){
|
||||
this.$emit('uploadSuccess', fileList1)
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
// console.log('fileList111',file,this.fileList,fileList1)
|
||||
@@ -148,7 +161,7 @@
|
||||
// this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
}else if( !this.fileTypeSatus&&this.myfileList.length<1){
|
||||
this.$message.warning('不支持上传该类型的文件!')
|
||||
}
|
||||
},
|
||||
@@ -167,5 +180,26 @@
|
||||
z-index: 1002;
|
||||
}
|
||||
}
|
||||
.split-import-upload{
|
||||
.ant-upload-list-item-info{
|
||||
span{
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
text-align: right;
|
||||
.ant-upload-list-item-name{
|
||||
margin-right: 20px;
|
||||
max-width: 800px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-upload-list-text{
|
||||
position: absolute;
|
||||
top: 140px;
|
||||
right: 240px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user