制度表单多文件

This commit is contained in:
zhal 2022-07-07 20:03:06 +08:00
parent feb9c54e2f
commit b14a45e11c
2 changed files with 17 additions and 4 deletions

View File

@ -63,7 +63,8 @@ export default defineComponent({
groupValue: 'yili', groupValue: 'yili',
fileValue: '', fileValue: '',
appId: 'com.actionsoft.apps.coe.pal.datamigration', appId: 'com.actionsoft.apps.coe.pal.datamigration',
fileName: '' fileName: '',
fileNames:''
}); });
const handlePreview = () => {} const handlePreview = () => {}
const handleRemove = () => {} const handleRemove = () => {}
@ -71,16 +72,21 @@ export default defineComponent({
const handleExceed = () => {} const handleExceed = () => {}
const handleSuccess = (res: any,uploadFile: any,uploadFiles: any) => { const handleSuccess = (res: any,uploadFile: any,uploadFiles: any) => {
console.log(res,'---',uploadFile,'----',uploadFiles) console.log(res,'---',uploadFile,'----',uploadFiles)
info.fileNames += res.files.name+ ",";
info.fileName = res.files.name info.fileName = res.files.name
let tempFileObj = {id: uploadFile.uid,name: res.files.name,downloadUrl: res.data.data.attrs.downloadUrl} let tempFileObj = {id: uploadFile.uid,name: res.files.name,downloadUrl: res.data.data.attrs.downloadUrl}
info.fileList.push(tempFileObj) info.fileList.push(tempFileObj)
console.info('fileList',info.fileList) console.info('fileList',info.fileList)
console.info("==================="+info.fileNames)
} }
const next = () => { const next = () => {
if (info.fileList.length === 0) { if (info.fileList.length === 0) {
$this.$message({type:'warning',message:'请上传文件'}); $this.$message({type:'warning',message:'请上传文件'});
return; return;
} }
info.fileNames = info.fileNames.substr(0, info.fileNames.length - 1);
let param = { let param = {
url: './jd', url: './jd',
data: { data: {
@ -89,7 +95,7 @@ export default defineComponent({
wsId: settingParam.wsId ? settingParam.wsId : '6f4e292c-1b90-4dd2-8c20-7da159cb20a5', wsId: settingParam.wsId ? settingParam.wsId : '6f4e292c-1b90-4dd2-8c20-7da159cb20a5',
groupValue: info.groupValue, groupValue: info.groupValue,
fileValue: info.fileValue, fileValue: info.fileValue,
fileName: info.fileName fileName: info.fileNames
} }
} }
$this.awsuiaxios.post(param) $this.awsuiaxios.post(param)

View File

@ -63,24 +63,31 @@ export default defineComponent({
groupValue: 'yili', groupValue: 'yili',
fileValue: '', fileValue: '',
appId: 'com.actionsoft.apps.coe.pal.datamigration', appId: 'com.actionsoft.apps.coe.pal.datamigration',
fileName: '' fileName: '',
fileNames:''
}); });
const handlePreview = () => {} const handlePreview = () => {}
const handleRemove = () => {} const handleRemove = () => {}
const beforeRemove = () => {} const beforeRemove = () => {}
const handleExceed = () => {} const handleExceed = () => {}
const handleSuccess = (res: any,uploadFile: any,uploadFiles: any) => { const handleSuccess = (res: any,uploadFile: any,uploadFiles: any) => {
debugger;
console.log(res,'---',uploadFile,'----',uploadFiles) console.log(res,'---',uploadFile,'----',uploadFiles)
info.fileNames += res.files.name+ ",";
info.fileName = res.files.name info.fileName = res.files.name
let tempFileObj = {id: uploadFile.uid,name: res.files.name,downloadUrl: res.data.data.attrs.downloadUrl} let tempFileObj = {id: uploadFile.uid,name: res.files.name,downloadUrl: res.data.data.attrs.downloadUrl}
info.fileList.push(tempFileObj) info.fileList.push(tempFileObj)
console.info('fileList',info.fileList) console.info('fileList',info.fileList)
console.info("==================="+info.fileNames)
} }
const next = () => { const next = () => {
if (info.fileList.length === 0) { if (info.fileList.length === 0) {
$this.$message({type:'warning',message:'请上传文件'}); $this.$message({type:'warning',message:'请上传文件'});
return; return;
} }
info.fileNames = info.fileNames.substr(0, info.fileNames.length - 1);
let param = { let param = {
url: './jd', url: './jd',
data: { data: {
@ -89,7 +96,7 @@ export default defineComponent({
wsId: settingParam.wsId ? settingParam.wsId : '6f4e292c-1b90-4dd2-8c20-7da159cb20a5', wsId: settingParam.wsId ? settingParam.wsId : '6f4e292c-1b90-4dd2-8c20-7da159cb20a5',
groupValue: info.groupValue, groupValue: info.groupValue,
fileValue: info.fileValue, fileValue: info.fileValue,
fileName: info.fileName fileName: info.fileNames
} }
} }
$this.awsuiaxios.post(param) $this.awsuiaxios.post(param)