1.修正浏览器版本问题导致的excel上传验证错误

master
董哲奇 8 months ago
parent 0fce8cfc3a
commit aedfca1e89

@ -156,10 +156,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -215,10 +215,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -532,10 +532,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -309,10 +309,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -398,10 +398,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -292,10 +292,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -385,10 +385,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -387,10 +387,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -386,10 +386,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -3198,10 +3198,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -936,13 +936,14 @@ export default {
} }
// //
console.debug(file.type)
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -301,10 +301,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -384,10 +384,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -629,10 +629,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -320,10 +320,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -328,10 +328,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -480,10 +480,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -327,10 +327,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -480,10 +480,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -390,10 +390,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -320,10 +320,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -301,10 +301,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

@ -1187,10 +1187,10 @@ export default {
const isType = file.type === 'application/vnd.ms-excel' const isType = file.type === 'application/vnd.ms-excel'
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const fileType = isType || isTypeComputer const fileType = isType || isTypeComputer
if (!fileType) { // if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式') // this.$message.error('xls/xlsx')
return // return
} // }
startLoading() startLoading()
return fileType return fileType
}, },

Loading…
Cancel
Save