Commit 26aee983 by chenwq

上传,蒙版

1 parent d8b883c7
......@@ -547,10 +547,16 @@ export default {
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
this.loading = true
this.$apis.common
.uploadImgApi({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
}
},
{
......@@ -565,9 +571,15 @@ export default {
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({ file: base64 }).then(res => {
this.editForm[targetItem.name].push(res)
})
this.loading = true
this.$apis.common
.uploadVideoApi({ file: base64 })
.then(res => {
this.editForm[targetItem.name].push(res)
})
.finally(() => {
this.loading = false
})
}
},
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!