|
@@ -61,7 +61,7 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
// 上传地址
|
|
// 上传地址
|
|
- newAction: this.action,
|
|
|
|
|
|
+ newAction: baseUrl + this.action,
|
|
// 请求头
|
|
// 请求头
|
|
headers: {
|
|
headers: {
|
|
Authorization: "Bearer " + getToken(),
|
|
Authorization: "Bearer " + getToken(),
|
|
@@ -146,13 +146,18 @@ export default {
|
|
onProgress(e) {
|
|
onProgress(e) {
|
|
this.percent = parseInt(e.percent)
|
|
this.percent = parseInt(e.percent)
|
|
this.newTitle = `已上传${parseInt(e.percent - 1)}%`
|
|
this.newTitle = `已上传${parseInt(e.percent - 1)}%`
|
|
|
|
+ this.$emit('loading')
|
|
|
|
+ this.visible = true
|
|
},
|
|
},
|
|
|
|
+
|
|
// 上传失败
|
|
// 上传失败
|
|
onError() {
|
|
onError() {
|
|
this.newTitle = `上传失败`
|
|
this.newTitle = `上传失败`
|
|
this.btnType = `danger`
|
|
this.btnType = `danger`
|
|
this.isStatus = 'exception'
|
|
this.isStatus = 'exception'
|
|
|
|
+ this.$emit('upload')
|
|
},
|
|
},
|
|
|
|
+
|
|
// 上传成功
|
|
// 上传成功
|
|
onSuccess(res) {
|
|
onSuccess(res) {
|
|
if (this.listType === 'picture-card') {
|
|
if (this.listType === 'picture-card') {
|
|
@@ -163,7 +168,6 @@ export default {
|
|
this.newTitle = '上传成功'
|
|
this.newTitle = '上传成功'
|
|
this.btnType = 'success'
|
|
this.btnType = 'success'
|
|
}
|
|
}
|
|
-
|
|
|
|
// 传参
|
|
// 传参
|
|
this.form.file = res.data
|
|
this.form.file = res.data
|
|
this.$emit('upload', this.form)
|
|
this.$emit('upload', this.form)
|