|
|
@ -29,7 +29,7 @@
|
|
|
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
|
|
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
|
|
|
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
|
|
|
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
|
|
|
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
|
|
|
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
|
|
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
|
|
|
<span class="el-icon-document"> {{ file.name }} </span>
|
|
|
|
</el-link>
|
|
|
|
</el-link>
|
|
|
|
<div class="ele-upload-list__item-content-action">
|
|
|
|
<div class="ele-upload-list__item-content-action">
|
|
|
|
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
|
|
|
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
|
|
@ -60,7 +60,7 @@ export default {
|
|
|
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
|
fileType: {
|
|
|
|
fileType: {
|
|
|
|
type: Array,
|
|
|
|
type: Array,
|
|
|
|
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
|
|
|
|
default: () => ["doc", "docx", "pdf"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 是否显示提示
|
|
|
|
// 是否显示提示
|
|
|
|
isShowTip: {
|
|
|
|
isShowTip: {
|
|
|
@ -147,7 +147,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.originalFilename, url: res.fileName });
|
|
|
|
this.uploadedSuccessfully();
|
|
|
|
this.uploadedSuccessfully();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.number--;
|
|
|
|
this.number--;
|
|
|
@ -160,7 +160,7 @@ export default {
|
|
|
|
// 删除文件
|
|
|
|
// 删除文件
|
|
|
|
handleDelete(index) {
|
|
|
|
handleDelete(index) {
|
|
|
|
this.fileList.splice(index, 1);
|
|
|
|
this.fileList.splice(index, 1);
|
|
|
|
this.$emit("input", this.listToString(this.fileList));
|
|
|
|
this.$emit("input", this.fileList);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 上传结束处理
|
|
|
|
// 上传结束处理
|
|
|
|
uploadedSuccessfully() {
|
|
|
|
uploadedSuccessfully() {
|
|
|
@ -168,7 +168,7 @@ export default {
|
|
|
|
this.fileList = this.fileList.concat(this.uploadList);
|
|
|
|
this.fileList = this.fileList.concat(this.uploadList);
|
|
|
|
this.uploadList = [];
|
|
|
|
this.uploadList = [];
|
|
|
|
this.number = 0;
|
|
|
|
this.number = 0;
|
|
|
|
this.$emit("input", this.listToString(this.fileList));
|
|
|
|
this.$emit("input", this.fileList);
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|