|
@@ -72,6 +72,7 @@
|
|
fileName,
|
|
fileName,
|
|
// eslint-disable-next-line no-unused-vars
|
|
// eslint-disable-next-line no-unused-vars
|
|
beforeAvatarUpload,
|
|
beforeAvatarUpload,
|
|
|
|
+ exnameFix,
|
|
// eslint-disable-next-line no-unused-vars
|
|
// eslint-disable-next-line no-unused-vars
|
|
openWindowOnUrl,
|
|
openWindowOnUrl,
|
|
// eslint-disable-next-line no-unused-vars
|
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -102,7 +103,8 @@
|
|
createBy: '',
|
|
createBy: '',
|
|
showDivider: true,
|
|
showDivider: true,
|
|
loading: false,
|
|
loading: false,
|
|
- dataListLength: ''
|
|
|
|
|
|
+ dataListLength: '',
|
|
|
|
+ fileType:''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -160,8 +162,9 @@
|
|
* @param showDivider ‘附件‘Divider是否展示
|
|
* @param showDivider ‘附件‘Divider是否展示
|
|
* 注:值为空时,默认值为true
|
|
* 注:值为空时,默认值为true
|
|
* showDivider=false时 ‘附件‘Divider隐藏
|
|
* showDivider=false时 ‘附件‘Divider隐藏
|
|
|
|
+ * @param fileType 附件类型
|
|
*/
|
|
*/
|
|
- async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider) {
|
|
|
|
|
|
+ async newUpload (auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider,fileType) {
|
|
await this.fileLoadingFalse()
|
|
await this.fileLoadingFalse()
|
|
if (this.commonJS.isEmpty(fileList)) {
|
|
if (this.commonJS.isEmpty(fileList)) {
|
|
this.fileLoading = true
|
|
this.fileLoading = true
|
|
@@ -203,6 +206,11 @@
|
|
this.delFlag = delFlag
|
|
this.delFlag = delFlag
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (this.commonJS.isEmpty(fileType)){
|
|
|
|
+ this.fileType = ''
|
|
|
|
+ }else {
|
|
|
|
+ this.fileType = fileType
|
|
|
|
+ }
|
|
for await (let item of fileList) {
|
|
for await (let item of fileList) {
|
|
await this.ossService.getFileSizeByUrl(item.url).then((data) => {
|
|
await this.ossService.getFileSizeByUrl(item.url).then((data) => {
|
|
item.lsUrl = data.url
|
|
item.lsUrl = data.url
|
|
@@ -262,6 +270,14 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async changes (file, fileList) {
|
|
async changes (file, fileList) {
|
|
|
|
+ if (!exnameFix(file, '1', this.fileType)) {
|
|
|
|
+ for (let i = 0; i <fileList.length ; i++) {
|
|
|
|
+ this.deleteById(fileList[i],i,this.dataListNew)
|
|
|
|
+ }
|
|
|
|
+ this.fileList = []
|
|
|
|
+ this.dataListNew = []
|
|
|
|
+ return
|
|
|
|
+ }
|
|
// if (file.status !== 'ready') {
|
|
// if (file.status !== 'ready') {
|
|
// return
|
|
// return
|
|
// }
|
|
// }
|