|
@@ -2,7 +2,7 @@
|
|
|
<div class="upload-file">
|
|
|
<Input type="text" v-model="payHtml" :placeholder="placeholdered" readonly></Input>
|
|
|
<Input type="text" v-model="validateVar" style="display:none"></Input>
|
|
|
- <Upload
|
|
|
+ <Upload
|
|
|
ref="uploadRef"
|
|
|
:multiple="multipled"
|
|
|
:action="action"
|
|
@@ -38,6 +38,10 @@
|
|
|
type: String,
|
|
|
default: '/filemanage/upload'
|
|
|
},
|
|
|
+ newApi: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
placeholdered: String,
|
|
|
accepted: String,
|
|
|
formated: Array,
|
|
@@ -59,26 +63,20 @@
|
|
|
},
|
|
|
handleSuccess(res, file) {// 文件上传成功
|
|
|
this.uploadShow = false
|
|
|
- this.$Notice.success({title: '上传成功'})
|
|
|
+ this.$notify.success({title: '上传成功'})
|
|
|
this.payHtml = file.name
|
|
|
- this.$emit('fileData', file.response.url)
|
|
|
+ this.$emit('fileData', this.newApi ? res.data.url : file.response.url)
|
|
|
},
|
|
|
handleError() {// 文件上传失败
|
|
|
- this.$Notice.error({title: '上传失败'})
|
|
|
+ this.$notify.error({title: '上传失败'})
|
|
|
},
|
|
|
handleExceeded() {// 文件超出指定大小限制
|
|
|
- this.$Notice.warning({title: '上传文件内存应小于10M'})
|
|
|
+ this.$notify.warning({title: '上传文件内存应小于10M'})
|
|
|
},
|
|
|
formatError() {// 文件格式验证失败
|
|
|
- this.$Notice.warning({
|
|
|
+ this.$notify.warning({
|
|
|
title: '上传文件格式错误',
|
|
|
- desc: '格式支持',
|
|
|
- render: h => {
|
|
|
- return h('span', [
|
|
|
- '格式仅支持:',
|
|
|
- h('p', this.accepted)
|
|
|
- ])
|
|
|
- }
|
|
|
+ message: `格式仅支持 ${this.accepted}`
|
|
|
})
|
|
|
},
|
|
|
contractData(name) {
|
|
@@ -109,4 +107,4 @@
|
|
|
top: -28px;
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|