|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
<div class="upload-file">
|
|
|
<el-dialog title="文件上传" :visible.sync="showEventLogUpload" v-if="showEventLogUpload" width="770px"
|
|
|
- style="height: 700px;"
|
|
|
- @close="cancelEventLogUploadShow()">
|
|
|
+ style="height: 700px;">
|
|
|
<el-upload
|
|
|
multiple
|
|
|
:action="uploadFileUrl"
|
|
@@ -23,7 +22,7 @@
|
|
|
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
|
|
请上传
|
|
|
<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>
|
|
|
</el-upload>
|
|
@@ -49,7 +48,8 @@
|
|
|
<script>
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
import {
|
|
|
- eventLogUpload
|
|
|
+ eventLogUpload,
|
|
|
+ getEventDetail
|
|
|
} from '@/api/forest'
|
|
|
|
|
|
export default {
|
|
@@ -67,11 +67,11 @@ export default {
|
|
|
type: Number,
|
|
|
default: 5
|
|
|
},
|
|
|
- // 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
- fileType: {
|
|
|
- type: Array,
|
|
|
- default: () => ['png', 'jpg', 'jpeg', 'doc', 'xls', 'ppt', 'txt', 'pdf']
|
|
|
- },
|
|
|
+ // // 文件类型, 例如['png', 'jpg', 'jpeg']
|
|
|
+ // fileType: {
|
|
|
+ // type: Array,
|
|
|
+ // default: () => []
|
|
|
+ // },
|
|
|
// 是否显示提示
|
|
|
isShowTip: {
|
|
|
type: Boolean,
|
|
@@ -118,7 +118,7 @@ export default {
|
|
|
computed: {
|
|
|
// 是否显示提示
|
|
|
showTip() {
|
|
|
- return this.isShowTip && (this.fileType || this.fileSize)
|
|
|
+ return this.isShowTip
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -135,6 +135,8 @@ export default {
|
|
|
if(res.code==200){
|
|
|
this.$message.success(`上传成功!`);
|
|
|
this.showEventLogUpload = false
|
|
|
+ this.cancelEventLogUploadShow();
|
|
|
+ this.$parent.refreshEventDialog(this.eventCode)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -144,7 +146,6 @@ export default {
|
|
|
this.showEventLogUpload = true
|
|
|
},
|
|
|
cancelEventLogUploadShow() {
|
|
|
- alert(111)
|
|
|
//关闭页面
|
|
|
this.fileList = []
|
|
|
this.uploadList = []
|
|
@@ -152,7 +153,7 @@ export default {
|
|
|
// 上传前校检格式和大小
|
|
|
handleBeforeUpload(file) {
|
|
|
// 校检文件类型
|
|
|
- if (this.fileType) {
|
|
|
+ if (false) {
|
|
|
let fileExtension = ''
|
|
|
if (file.name.lastIndexOf('.') > -1) {
|
|
|
fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1)
|