30769
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
<h2>{{ item.name }}</h2>
|
<h2>{{ item.name }}</h2>
|
||||||
<p>{{ item.fileSizeStr }}</p>
|
<p>{{ item.fileSizeStr }}</p>
|
||||||
</div>
|
</div>
|
||||||
<img src="https://cdn.cunwuyun.cn/dvcp/announce/folder.png" />
|
<img :src="mapIcon(item.name)" />
|
||||||
</div>
|
</div>
|
||||||
<div class="msg-wrapper msg-link" v-if="item.msgType === '4'">
|
<div class="msg-wrapper msg-link" v-if="item.msgType === '4'">
|
||||||
<h2>{{ item.linkTitle }}</h2>
|
<h2>{{ item.linkTitle }}</h2>
|
||||||
@@ -68,6 +68,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
mapIcon (fileName) {
|
||||||
|
if (['.zip', '.rar'].indexOf(this.getExtension(fileName)) !== -1) {
|
||||||
|
return 'https://cdn.cunwuyun.cn/dvcp/announce/zip.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (['.doc', '.docx'].indexOf(this.getExtension(fileName)) !== -1) {
|
||||||
|
return 'https://cdn.cunwuyun.cn/dvcp/announce/world.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (['.xls', '.xlsx'].indexOf(this.getExtension(fileName)) !== -1) {
|
||||||
|
return 'https://cdn.cunwuyun.cn/dvcp/announce/xls.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (['.txt'].indexOf(this.getExtension(fileName)) !== -1) {
|
||||||
|
return 'https://cdn.cunwuyun.cn/dvcp/announce/txt.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (['.pdf'].indexOf(this.getExtension(fileName)) !== -1) {
|
||||||
|
return 'https://cdn.cunwuyun.cn/dvcp/announce/pdf.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (['.ppt', '.pptx'].indexOf(this.getExtension(fileName)) !== -1) {
|
||||||
|
return 'https://cdn.cunwuyun.cn/dvcp/announce/ppt.png'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getExtension(name) {
|
||||||
|
return name.substring(name.lastIndexOf('.'))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user