拆分详情修改
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
|
||||
<a-upload-dragger
|
||||
accept='*.*'
|
||||
:accept='accept'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
name="file"
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
export default {
|
||||
name: 'file',
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType','title','listType','splitVisible'],
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType','accept','title','listType','splitVisible'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -43,7 +43,7 @@
|
||||
isLoding: false,
|
||||
headers:'',
|
||||
previewImage:{},
|
||||
accept:'image/*'
|
||||
// accept:'image/*'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -68,14 +68,20 @@
|
||||
}
|
||||
},
|
||||
beforeUpload(file) {
|
||||
|
||||
if(file.type.split('/')[0]!='image'){
|
||||
this.$message.warning(this.$t('onlyPicture'))
|
||||
let fileTypes=this.accept.split(',')
|
||||
let fileFlag=false
|
||||
fileTypes.forEach(item=>{
|
||||
if(item==file.type){
|
||||
fileFlag=true
|
||||
}
|
||||
})
|
||||
console.log('filetype',fileFlag)
|
||||
if(!fileFlag){
|
||||
this.$message.warning('文件格式不正确')
|
||||
this.fileTypeSatus = false
|
||||
}else{
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
this.fileTypeSatus = true
|
||||
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + '文件大小超出1000MB限制, 请压缩或降低文件质量!'
|
||||
@@ -90,7 +96,7 @@
|
||||
window.open(url, '_blank')
|
||||
},
|
||||
handleChange(info) {
|
||||
console.log('file',info)
|
||||
// console.log('file',info)
|
||||
let { file,fileList } = info
|
||||
const status = info.file.status
|
||||
info.fileList.forEach((val, index) => {
|
||||
@@ -149,7 +155,7 @@
|
||||
}
|
||||
})
|
||||
this.$emit('uploadSuccess', this.fileList,fileList)
|
||||
console.log('uplossss',this.fileList,fileList)
|
||||
// console.log('uplossss',this.fileList,fileList)
|
||||
if (this.myfileList.length > 0) {
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name} `+this.$t('uploadSuccessful'))
|
||||
@@ -166,7 +172,7 @@
|
||||
this.fileList = []
|
||||
},
|
||||
preview(file) {
|
||||
console.log('file111',file)
|
||||
// console.log('file111',file)
|
||||
this.previewImage = file.response.path;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user