forked from mt-fe-group/mt-yd-ui
update 文件上传组件
This commit is contained in:
@@ -58,14 +58,14 @@ export default {
|
||||
|
||||
this.$watch('uploaderInjectFileList', function(val) {
|
||||
if (val && val.length) {
|
||||
console.log('this.uploaderInjectFileList', this.uploaderInjectFileList)
|
||||
// console.log('this.uploaderInjectFileList', this.uploaderInjectFileList)
|
||||
/** uploaderInjectFileList 里关于文件的信息比较全,需要手动过滤一下 */
|
||||
this.fileList = val.map(item => {
|
||||
const name = item.fileUrl.split('/').pop()
|
||||
return { ...pick(item, ['id', 'fileName', 'typeCode']), name }
|
||||
})
|
||||
}
|
||||
console.log('fillist: ', this.fileList)
|
||||
// console.log('fillist: ', this.fileList)
|
||||
})
|
||||
|
||||
// if (this.parentDataForm) {
|
||||
@@ -111,7 +111,7 @@ export default {
|
||||
|
||||
/** 图片验证,由配置文件开启 */
|
||||
validateImage(file) {
|
||||
console.log('[*] 验证图片')
|
||||
// console.log('[*] 验证图片')
|
||||
|
||||
const isRightSize = file.size / 1024 / 1024 < 2
|
||||
if (!isRightSize) {
|
||||
@@ -146,10 +146,10 @@ export default {
|
||||
responseType: 'blob'
|
||||
}).then(({ data: res }) => {
|
||||
const blob = new Blob([res])
|
||||
console.log('blob', blob)
|
||||
// console.log('blob', blob)
|
||||
if ('download' in document.createElement('a')) {
|
||||
const alink = document.createElement('a')
|
||||
console.log('filename: ', fileName)
|
||||
// console.log('filename: ', fileName)
|
||||
alink.download = fileName
|
||||
alink.style.display = 'none'
|
||||
alink.target = '_blank'
|
||||
|
||||
Reference in New Issue
Block a user