|
@@ -17,14 +17,15 @@
|
|
v-if="!disabled"
|
|
v-if="!disabled"
|
|
>
|
|
>
|
|
<!-- 上传按钮 -->
|
|
<!-- 上传按钮 -->
|
|
|
|
+ <el-tooltip class="item" effect="dark" :content="'大小不超过' + fileSize +'MB,格式为' + slgegse " placement="top">
|
|
<el-button size="mini" type="primary">上传</el-button>
|
|
<el-button size="mini" type="primary">上传</el-button>
|
|
|
|
+ </el-tooltip>
|
|
<!-- 上传提示 -->
|
|
<!-- 上传提示 -->
|
|
- <!-- <div class="el-upload__tip" slot="tip" v-if="showTip">
|
|
|
|
- 请上传
|
|
|
|
|
|
+ <div class="el-upload__tip" slot="tip" v-if="isShowTip">
|
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
|
的文件
|
|
的文件
|
|
- </div> -->
|
|
|
|
|
|
+ </div>
|
|
</el-upload>
|
|
</el-upload>
|
|
|
|
|
|
<!-- 文件列表 -->
|
|
<!-- 文件列表 -->
|
|
@@ -99,9 +100,13 @@ export default {
|
|
headers: {
|
|
headers: {
|
|
Authorization: "Bearer " + getToken(),
|
|
Authorization: "Bearer " + getToken(),
|
|
},
|
|
},
|
|
- fileList: []
|
|
|
|
|
|
+ fileList: [],
|
|
|
|
+ slgegse:''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ this.slgegse = this.fileType.join(',')
|
|
|
|
+ },
|
|
mounted() {
|
|
mounted() {
|
|
if (this.drag && !this.disabled) {
|
|
if (this.drag && !this.disabled) {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -190,6 +195,7 @@ export default {
|
|
handleUploadSuccess(res, file) {
|
|
handleUploadSuccess(res, file) {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.uploadList.push({ name: res.fileName, url: res.fileName })
|
|
this.uploadList.push({ name: res.fileName, url: res.fileName })
|
|
|
|
+ this.isShowTip = false
|
|
this.uploadedSuccessfully()
|
|
this.uploadedSuccessfully()
|
|
} else {
|
|
} else {
|
|
this.number--
|
|
this.number--
|
|
@@ -202,6 +208,11 @@ export default {
|
|
// 删除文件
|
|
// 删除文件
|
|
handleDelete(index) {
|
|
handleDelete(index) {
|
|
this.fileList.splice(index, 1)
|
|
this.fileList.splice(index, 1)
|
|
|
|
+ if(this.fileList.length != 0){
|
|
|
|
+ this.isShowTip = false
|
|
|
|
+ }else{
|
|
|
|
+ this.isShowTip = true
|
|
|
|
+ }
|
|
this.$emit("input", this.listToString(this.fileList))
|
|
this.$emit("input", this.listToString(this.fileList))
|
|
},
|
|
},
|
|
// 上传结束处理
|
|
// 上传结束处理
|