|
@@ -12,13 +12,8 @@
|
|
|
<!-- 图片附件 -->
|
|
|
<div v-if="imageList.length > 0" class="imageShow">
|
|
|
<template v-for="(item, index) in imageList">
|
|
|
- <el-image
|
|
|
- style="width: 100px; height: 100px"
|
|
|
- v-if="item.address"
|
|
|
- :key="currentDate + '_imageItem_' + index"
|
|
|
- :src="item.address"
|
|
|
- :preview-src-list="imageAddressList"
|
|
|
- >
|
|
|
+ <el-image style="width: 100px; height: 100px" v-if="item.address" :key="currentDate + '_imageItem_' + index"
|
|
|
+ :src="item.address" :preview-src-list="imageAddressList">
|
|
|
</el-image>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -38,7 +33,7 @@
|
|
|
<template v-for="(item, index) in otherList">
|
|
|
<div class="otherItem" :key="currentDate + '_otherItem_' + index">
|
|
|
<a :href="item.address" :download="item.fileName">{{ item.fileName }}</a>
|
|
|
- <slot></slot>
|
|
|
+ <slot></slot>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -82,6 +77,7 @@ export default {
|
|
|
const otherList = []
|
|
|
const imageAddressList = []
|
|
|
if (fileList instanceof Array) {
|
|
|
+ debugger
|
|
|
fileList.forEach((item) => {
|
|
|
const filePath = item.filePath //存放路径
|
|
|
const fileName = item.fileName //文件名称
|
|
@@ -93,12 +89,12 @@ export default {
|
|
|
})
|
|
|
imageAddressList.push(getImageUrl(filePath))
|
|
|
}
|
|
|
- //else if(this.isVideo(filePath)){
|
|
|
- // videoList.push({
|
|
|
- // fileName:fileName,
|
|
|
- // address:getFileUrl(filePath,fileName)
|
|
|
- // })
|
|
|
- // }
|
|
|
+ else if (this.isVideo(filePath)) {
|
|
|
+ videoList.push({
|
|
|
+ fileName: fileName,
|
|
|
+ address: getFileUrl(filePath, fileName)
|
|
|
+ })
|
|
|
+ }
|
|
|
//else if(this.isVoice(item)){
|
|
|
// voiceList.push({
|
|
|
// fileName:fileName,
|
|
@@ -155,7 +151,7 @@ export default {
|
|
|
// MP4 = 带有 H.264 视频编码和 AAC 音频编码的 MPEG 4 文件
|
|
|
// WebM = 带有 VP8 视频编码和 Vorbis 音频编码的 WebM 文件
|
|
|
// Ogg = 带有 Theora 视频编码和 Vorbis 音频编码的 Ogg 文件
|
|
|
- let imgArr = ['.mp4', 'ogg', 'webm']
|
|
|
+ let imgArr = ['mp4', 'ogg', 'webm']
|
|
|
return imgArr.indexOf(type) !== -1 ? true : false
|
|
|
},
|
|
|
|
|
@@ -213,6 +209,7 @@ export default {
|
|
|
width: calc(100% - 150px);
|
|
|
float: left;
|
|
|
}
|
|
|
+
|
|
|
.videoShow,
|
|
|
.imageShow,
|
|
|
.otherShow,
|
|
@@ -227,20 +224,24 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
justify-content: left;
|
|
|
align-items: center;
|
|
|
+
|
|
|
/deep/.el-image {
|
|
|
width: 25%;
|
|
|
padding-right: 10px;
|
|
|
padding-bottom: 10px;
|
|
|
+
|
|
|
img {
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.videoItem {
|
|
|
width: 33%;
|
|
|
padding-right: 10px;
|
|
|
padding-bottom: 10px;
|
|
|
}
|
|
|
+
|
|
|
.otherItem {
|
|
|
padding-right: 10px;
|
|
|
padding-bottom: 10px;
|
|
@@ -248,14 +249,17 @@ export default {
|
|
|
text-decoration: underline;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
.otherList {
|
|
|
width: 25%;
|
|
|
padding-right: 20px;
|
|
|
padding-bottom: 10px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.voiceShow {
|
|
|
flex-direction: column;
|
|
|
+
|
|
|
.voiceItem {
|
|
|
width: 100%;
|
|
|
height: 34px;
|