|
|
|
@ -34,10 +34,12 @@
|
|
|
|
|
搜索
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-upload
|
|
|
|
|
accept="image/*, video/*"
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
:action="upLoadUrl"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:data="{ module: code }"
|
|
|
|
|
:before-upload="beforeUpload"
|
|
|
|
|
:on-success="uploadSuccess"
|
|
|
|
|
:on-error="uploadError"
|
|
|
|
|
multiple
|
|
|
|
@ -222,6 +224,17 @@ export default {
|
|
|
|
|
message: '上传失败'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
beforeUpload (file) {
|
|
|
|
|
const isImage = file.type.startsWith('image/')
|
|
|
|
|
const isVideo = file.type.startsWith('video/')
|
|
|
|
|
const isValidFileType = isImage || isVideo
|
|
|
|
|
console.log(isValidFileType)
|
|
|
|
|
if (!isValidFileType) {
|
|
|
|
|
this.$message.error('只能上传图片或视频文件')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return isValidFileType
|
|
|
|
|
},
|
|
|
|
|
uploadSuccess (response, file, fileList) {
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
@ -240,6 +253,8 @@ export default {
|
|
|
|
|
get('/bigScreen/file/getAllFileSuffix').then((data) => {
|
|
|
|
|
this.options = []
|
|
|
|
|
this.options.push({ label: '全部', value: '' })
|
|
|
|
|
// 过滤data的空数据
|
|
|
|
|
data = data.filter((item) => item)
|
|
|
|
|
data.forEach((item) => this.options.push({ label: item, value: item }))
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|