|
@@ -57,7 +57,45 @@
|
|
<el-col :xs="24" :sm="24" :lg="24" class="item">
|
|
<el-col :xs="24" :sm="24" :lg="24" class="item">
|
|
<div class="label" style="height: auto">审核上传</div>
|
|
<div class="label" style="height: auto">审核上传</div>
|
|
<div class="value" style="height: auto">
|
|
<div class="value" style="height: auto">
|
|
- <ImageUpload class="mg-b" :file-list="formData.files" />
|
|
|
|
|
|
+ <ImageUpload v-if="module !=='detail'" class="mg-b" :file-list="formData.files" />
|
|
|
|
+ <template v-else>
|
|
|
|
+ <div
|
|
|
|
+ v-for="item in formData.files"
|
|
|
|
+ :key="item.url"
|
|
|
|
+ style="display: flex;
|
|
|
|
+ width: 120px;
|
|
|
|
+ height: 120px;align-items: center;
|
|
|
|
+ justify-content: center;"
|
|
|
|
+ >
|
|
|
|
+ <el-image
|
|
|
|
+ v-if="checkFileType(item.url) == 'image'"
|
|
|
|
+ ref="img"
|
|
|
|
+ :src="$imageUrl + item.url"
|
|
|
|
+ fit="cover"
|
|
|
|
+ :preview-src-list="[$imageUrl + item.url]"
|
|
|
|
+ class="elImageClose"
|
|
|
|
+ />
|
|
|
|
+ <div
|
|
|
|
+ style="display: flex;
|
|
|
|
+ width: 120px;
|
|
|
|
+ height: 120px;align-items: center;
|
|
|
|
+ justify-content: center;"
|
|
|
|
+ @click="openPdf(item.url)"
|
|
|
|
+ >
|
|
|
|
+ <img v-if="checkFileType(item.url) == 'word'" class="file" src="@/assets/common/word.png">
|
|
|
|
+ <img v-if="checkFileType(item.url) == 'excel'" class="file" src="@/assets/common/excel.png">
|
|
|
|
+ <img v-if="checkFileType(item.url) == 'ppt'" class="file" src="@/assets/common/ppt.png">
|
|
|
|
+ <img
|
|
|
|
+ v-if="checkFileType(item.url) == 'pdf'"
|
|
|
|
+ class="file"
|
|
|
|
+ style="cursor: pointer"
|
|
|
|
+ src="@/assets/common/pdf.png"
|
|
|
|
+ >
|
|
|
|
+
|
|
|
|
+ <img v-if="checkFileType(item.url) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
<div style="margin-left: 20px">注:可上传文件、附件</div>
|
|
<div style="margin-left: 20px">注:可上传文件、附件</div>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -117,7 +155,31 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- onSbumit() {}
|
|
|
|
|
|
+ onSbumit() {},
|
|
|
|
+ // 检查文件类型
|
|
|
|
+ checkFileType(url) {
|
|
|
|
+ if (!url) return ''
|
|
|
|
+ const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
|
|
|
|
+
|
|
|
|
+ if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
|
|
|
|
+ return 'image'
|
|
|
|
+ } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
|
|
|
|
+ return 'word'
|
|
|
|
+ } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
|
|
|
|
+ return 'excel'
|
|
|
|
+ } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
|
|
|
|
+ return 'ppt'
|
|
|
|
+ } else if (['pdf'].includes(fileSuffix)) {
|
|
|
|
+ return 'pdf'
|
|
|
|
+ } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
|
|
|
|
+ return 'file'
|
|
|
|
+ } else {
|
|
|
|
+ return ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ openPdf(pdfUrl) {
|
|
|
|
+ window.open(this.$imageUrl + pdfUrl)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|