公告多附件下载

This commit is contained in:
aoli.qu 2022-02-26 15:18:04 +08:00
parent 36dc03d0c8
commit fa54b01e97
1 changed files with 15 additions and 7 deletions

View File

@ -19,10 +19,13 @@
<div v-html="model.content"></div> <div v-html="model.content"></div>
</div> </div>
</div> </div>
<div class="table-operator" v-if="path">
<a-button type="primary" icon="arrow-down" @click="download" class="down"> <div class="down-class" v-show="fileList.length > 0">
附件下载 <a-divider orientation="left">附件下载</a-divider>
</a-button> <a-upload
:file-list="fileList"
:showUploadList="{showDownloadIcon: true, showRemoveIcon: false}">
</a-upload>
</div> </div>
</div> </div>
</a-card> </a-card>
@ -80,6 +83,7 @@ export default {
readCount: 0, readCount: 0,
unreadCount: 0, unreadCount: 0,
noticeRange: 1, noticeRange: 1,
fileList: [],
// //
columns1: [ columns1: [
{ {
@ -138,12 +142,12 @@ export default {
close () { close () {
this.$router.push({ path: '/notice/list', query: { noticeRange: this.noticeRange } }) this.$router.push({ path: '/notice/list', query: { noticeRange: this.noticeRange } })
}, },
getDetail (id) { async getDetail (id) {
noticeGet({ id: id }).then(res => { await noticeGet({ id: id }).then(res => {
this.model = res.data this.model = res.data
const fileArr = JSON.parse(res.data.file) const fileArr = JSON.parse(res.data.file)
if (fileArr.length > 0) { if (fileArr.length > 0) {
this.path = fileArr[0].url this.fileList = fileArr
} }
}) })
}, },
@ -182,4 +186,8 @@ export default {
.article-body { .article-body {
margin-top: 15px; margin-top: 15px;
} }
.down-class {
width: 50%;
margin-top: 20px;
}
</style> </style>