diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js index 55fe2542c..9952a5154 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js @@ -241,6 +241,7 @@ export default { const fileType = fileInfo.F_FileType const fileSize = fileInfo.F_FileSize + const fileName = fileInfo.F_FileName const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(wxfile.F_Id, true) fileList.push({ @@ -248,7 +249,8 @@ export default { type: fileType, uid:wxfile.F_Id, folderId:wxfile.F_FolderId, - size: fileSize + size: fileSize, + name:fileName }) } return fileList diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js index a1fca19e7..24c4d6497 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/custompage.js @@ -191,22 +191,38 @@ export default { return val ? moment(val).format('YYYY-MM-DD HH:mm') : '' case 'upload': - const uploadUid = [] - for (const entity of val) { - if (entity.uid) { - uploadUid.push(entity.uid) - continue - } else { - - const fileId = await this.HTTP_UPLOAD(entity) - if (fileId) { - uploadUid.push(fileId) - } - } - - } - - return uploadUid.join(',') + // const uploadUid = [] + // for (const entity of val) { + // if (entity.uid) { + // uploadUid.push(entity.uid) + // continue + // } else { + + // const fileId = await this.HTTP_UPLOAD(entity) + // if (fileId) { + // uploadUid.push(fileId) + // } + // } + + // } + + // return uploadUid.join(',') + + var uploadUid = ''; + + for (const item of val) { + if (item.uid) { + uploadUid = item.uid + continue + } + + const fileId = await this.HTTP_UPLOAD(item.path || item, undefined, guid || '') + if (fileId) { + uploadUid = fileId; + } + } + + return uploadUid; default: return val || '' @@ -245,21 +261,49 @@ export default { async convertToFormValue(scheme, val, dataSource) { switch (scheme.type) { case 'upload': - if (!val) { return [] } - const uidList = val.split(',') - const fileList = [] - - for (const uid of uidList || []) { - const fileInfo = await this.FETCH_FILEINFO(uid) - if (!fileInfo) { continue } - - const fileType = fileInfo.F_FileType - const fileSize = fileInfo.F_FileSize - - const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(uid, true) - fileList.push({ path, type: fileType, uid, size: fileSize }) - } - return fileList + // if (!val) { return [] } + // const uidList = val.split(',') + // const fileList = [] + + // for (const uid of uidList || []) { + // const fileInfo = await this.FETCH_FILEINFO(uid) + // if (!fileInfo) { continue } + + // const fileType = fileInfo.F_FileType + // const fileSize = fileInfo.F_FileSize + // const fileName = fileInfo.F_FileName + + // const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(uid, true) + // fileList.push({ path, type: fileType, uid, size: fileSize, name:fileName }) + // } + // return fileList + if (!val) { + return [] + } + const uidList = val; + const fileList = [] + const wxlist = await this.FETCH_FILEList(uidList); + for (const wxfile of wxlist) { + const fileInfo = await this.FETCH_FILEINFO(wxfile.F_Id) + if (!fileInfo) { + continue + } + + const fileType = fileInfo.F_FileType + const fileSize = fileInfo.F_FileSize + const fileName = fileInfo.F_FileName + + const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(wxfile.F_Id, true) + fileList.push({ + path, + type: fileType, + uid:wxfile.F_Id, + folderId:wxfile.F_FolderId, + size: fileSize, + name:fileName + }) + } + return fileList case 'radio': case 'select': diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js index 71bb4a076..a1edafd79 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/mixins.js @@ -237,7 +237,7 @@ export default { return await this.HTTP_GET('learun/adms/annexes/wxlist', folderId) }, - // 根据文件夹id获取图片列表 + // 根据文件夹id获取图片列表用于上传组件 async getFileListById(folderId){ if(!folderId){ return [] @@ -251,6 +251,7 @@ export default { const fileType = fileInfo.F_FileType const fileSize = fileInfo.F_FileSize + const fileName = fileInfo.F_FileName const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(wxfile.F_Id, true) fileList.push({ @@ -258,7 +259,8 @@ export default { type: fileType, uid:wxfile.F_Id, folderId:wxfile.F_FolderId, - size: fileSize + size: fileSize, + name:fileName }) } return fileList diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue index 348d4decc..a7f9b272c 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue @@ -9,7 +9,8 @@ - + + { + success: ({ tempFilePaths,tempFiles }) => { const newList = JSON.parse(JSON.stringify(this.value || [])).concat( - tempFilePaths//.map(t => ({ path: t, type: this.getFileExt(t) })) + // tempFilePaths//.map(t => ({ path: t, type: this.getFileExt(t) })) + tempFilePaths.map((t,i) => ({ path: t, type: tempFiles[i].type, size:tempFiles[i].size, name:tempFiles[i].name, noUpdated:true} )) ) this.$emit('input', newList) this.$emit('change', newList) @@ -171,4 +172,14 @@ export default { line-height: 100%; position: static; } +.mask{ + position: absolute; + top: 0;left: 0; + width: 100%; + height: 100%; + // background: rgba(255,252,153,0.2); + background: rgba(0,0,0,0.7); + z-index: 100; + pointer-events: none; +}