【修改】限制邮箱最多50
This commit is contained in:
@@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
<el-button class="uploadBtn" @click="dialogFile=true">
|
<el-button class="uploadBtn" @click="dialogFile=true">
|
||||||
|
|
||||||
{{fileList.length>0?'查看文件':'选择文件'}}
|
{{fileList.length>0?('上传文件(已上传'+fileList.length+'个文件)'):'上传文件'}}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -117,9 +117,9 @@
|
|||||||
}" :workNumFlag="true" :isOrg="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
|
}" :workNumFlag="true" :isOrg="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
|
||||||
<el-dialog title="上传文件" :visible.sync="dialogFile" width="10%" :close-on-click-modal="false"
|
<el-dialog title="上传文件" :visible.sync="dialogFile" width="10%" :close-on-click-modal="false"
|
||||||
:close-on-press-escape="false" modal-append-to-body append-to-body>
|
:close-on-press-escape="false" modal-append-to-body append-to-body>
|
||||||
<el-upload :disabled="formControl" action="#" :http-request="(params) => uploadFile(params)" :show-file-list="true"
|
<el-upload :disabled="formControl" action="/library/api/report/uploadFile" :show-file-list="true"
|
||||||
:before-upload="beforeUploadFile" :on-remove="handleRemove"
|
:before-upload="beforeUploadFile" :on-remove="handleRemove"
|
||||||
:file-list="fileList" multiple
|
:file-list="fileList" multiple :on-success="onSuccess"
|
||||||
drag :class="{'disable':formControl}">
|
drag :class="{'disable':formControl}">
|
||||||
<i class="el-icon-upload" ></i>
|
<i class="el-icon-upload" ></i>
|
||||||
<div class="el-upload__text">点击或拖拽上传文件</div>
|
<div class="el-upload__text">点击或拖拽上传文件</div>
|
||||||
@@ -478,11 +478,26 @@ export default {
|
|||||||
})
|
})
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
|
onSuccess(res, file,fileList){
|
||||||
|
if(res.ok){
|
||||||
|
// this.fileList.push({url:res.data.fullurl})//以前的错误代码
|
||||||
|
this.fileList=fileList
|
||||||
|
this.form.fileList = this.fileList.map(item=>{
|
||||||
|
return {
|
||||||
|
fileId:item.id,
|
||||||
|
fileName:item.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$refs.processFormRef.clearValidate(['fileList'])
|
||||||
|
}
|
||||||
|
console.log( res," this.fileList3")
|
||||||
|
},
|
||||||
// 上传文件
|
// 上传文件
|
||||||
uploadFile(params) {
|
uploadFile(params) {
|
||||||
let fd = new FormData();
|
let fd = new FormData();
|
||||||
fd.append('file', params.file);
|
fd.append('file', params.file);
|
||||||
this.$api.report.reportUploadFile(fd).then(({data}) => {
|
this.$api.report.reportUploadFile(fd).then(({data}) => {
|
||||||
|
console.log( this.fileList," this.fileList")
|
||||||
this.fileList.push(data)
|
this.fileList.push(data)
|
||||||
this.form.fileList = this.fileList.map(item=>{
|
this.form.fileList = this.fileList.map(item=>{
|
||||||
return {
|
return {
|
||||||
@@ -492,6 +507,7 @@ export default {
|
|||||||
})
|
})
|
||||||
this.$refs.processFormRef.clearValidate(['fileList'])
|
this.$refs.processFormRef.clearValidate(['fileList'])
|
||||||
})
|
})
|
||||||
|
console.log( this.fileList," this.fileList22222")
|
||||||
},
|
},
|
||||||
// 上传文件前
|
// 上传文件前
|
||||||
beforeUploadFile(file) {
|
beforeUploadFile(file) {
|
||||||
|
|||||||
Reference in New Issue
Block a user