|
@@ -83,14 +83,36 @@
|
|
<el-col :span="24" class="item">
|
|
<el-col :span="24" class="item">
|
|
<div class="label" style="height: 150px">政策封面图</div>
|
|
<div class="label" style="height: 150px">政策封面图</div>
|
|
<div class="value" style="height: 150px">
|
|
<div class="value" style="height: 150px">
|
|
- <el-image
|
|
|
|
|
|
+ <template v-for="item in detail.imgSrc">
|
|
|
|
+ <el-image
|
|
|
|
+ v-if="checkFileType(item) == 'image'"
|
|
|
|
+ ref="img"
|
|
|
|
+ :src="$imageUrl + item"
|
|
|
|
+ style="width: 120px; height: 120px; margin-right: 20px"
|
|
|
|
+ fit="cover"
|
|
|
|
+ :preview-src-list="[$imageUrl + item]"
|
|
|
|
+ />
|
|
|
|
+ <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png" />
|
|
|
|
+ <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png" />
|
|
|
|
+ <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png" />
|
|
|
|
+
|
|
|
|
+ <img
|
|
|
|
+ v-if="checkFileType(item) == 'pdf'"
|
|
|
|
+ class="file"
|
|
|
|
+ style="cursor: pointer"
|
|
|
|
+ src="@/assets/common/pdf.png"
|
|
|
|
+ @click="openPdf(item)"
|
|
|
|
+ />
|
|
|
|
|
|
|
|
+ <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg" />
|
|
|
|
+ </template>
|
|
|
|
+ <!-- <el-image
|
|
v-for="item in detail.imgSrc"
|
|
v-for="item in detail.imgSrc"
|
|
style="height: 120px; widht: 120px;margin-left: 20px"
|
|
style="height: 120px; widht: 120px;margin-left: 20px"
|
|
:src="$imageUrl + item"
|
|
:src="$imageUrl + item"
|
|
fit="fill"
|
|
fit="fill"
|
|
:preview-src-list="srcList"
|
|
:preview-src-list="srcList"
|
|
- />
|
|
|
|
|
|
+ /> -->
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -794,8 +816,8 @@ export default {
|
|
this.detail = res.data
|
|
this.detail = res.data
|
|
this.detail.flag = this.detail.flag + ''
|
|
this.detail.flag = this.detail.flag + ''
|
|
this.detail.imgSrc = this.detail.imgSrc.split(',')
|
|
this.detail.imgSrc = this.detail.imgSrc.split(',')
|
|
- this.detail.imgSrc.forEach(k=>{
|
|
|
|
- this.srcList.push(this.$imageUrl+k)
|
|
|
|
|
|
+ this.detail.imgSrc.forEach(k => {
|
|
|
|
+ this.srcList.push(this.$imageUrl + k)
|
|
})
|
|
})
|
|
// this.srcList = [this.$imageUrl + this.detail.imgSrc]
|
|
// this.srcList = [this.$imageUrl + this.detail.imgSrc]
|
|
if (this.$parent.isShow == 5 && this.detail.imgSrc) {
|
|
if (this.$parent.isShow == 5 && this.detail.imgSrc) {
|
|
@@ -827,6 +849,30 @@ export default {
|
|
this.clistLoading = false
|
|
this.clistLoading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 检查文件类型
|
|
|
|
+ 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)
|
|
|
|
+ },
|
|
getCrList() {
|
|
getCrList() {
|
|
const customerParams = {
|
|
const customerParams = {
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
@@ -1124,6 +1170,9 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
+.file {
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+}
|
|
.el-col {
|
|
.el-col {
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|