修改下载接口

This commit is contained in:
qq787203167
2022-02-23 18:28:54 +08:00
parent 7863a76603
commit 29bf1f8b28
3 changed files with 29 additions and 19 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
>
<span slot="operation" slot-scope="record">
<a class="text" v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)">{{ol.text}}</a>
@click="OperationClick(ol,record)">{{ ol.text instanceof Array ? ol.text[record.collectFlag || 0] : ol.text}}</a>
</span>
<span slot="detailClick" slot-scope="text,record">
<a class="text" @click="detailClick(record)">{{text}}</a>
@@ -26,44 +26,44 @@
<span class="text-field-right">{{ol.value ? ol.value : '--'}}</span>
</div>
</div>
<div class="TextInformation" v-if="val == '文本信息'">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<div class="TextInformation" v-if="val == '文本信息'">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<span class="TextInformationContentLeft">
{{ol.db_field_txt}}
</span>
<span class="TextInformationContentcontent">
<span class="TextInformationContentcontent">
{{ol.value ? ol.value.fileName : '--'}}
</span>
<span class="TextInformationContentright">
<span class="TextInformationContentright" v-show="ol.value" @click="download(ol.value)">
<a-icon type="vertical-align-bottom"/>
下载
</span>
</div>
</div>
<div class="TextInformation" v-else-if="val == '关联信息'">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
</div>
<div class="TextInformation" v-else-if="val == '关联信息'">
<div class="TextInformationContent" v-for="(ol,index1) in item[val]" style="width: 100%">
<span class="TextInformationContentLeft">
{{ol.db_field_txt}}
</span>
<span class="TextInformationContentcontent">
<span class="TextInformationContentcontent">
{{ol.value ? ol.value.fileName : '--'}}
</span>
<span class="TextInformationContentright">
<span class="TextInformationContentright" v-show="ol.value" @click="download(ol.value)">
<a-icon type="vertical-align-bottom"/>
下载
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</a-card>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
export default {
name: 'docIndex',
@@ -87,6 +87,9 @@
this.detailList = []
}
})
},
download(item) {
downloadFile('/sys/common/download', item.fileName, { id: item.id })
}
}
}
@@ -65,11 +65,11 @@
return {
OperationList: [
{
text: '收藏',
text: ['收藏','取消收藏'],
ClickEvent: 'Collection'
},
{
text: '订阅',
text: ['订阅','取消订阅'],
ClickEvent: 'subscribe'
},
{
@@ -169,15 +169,22 @@
},
//收藏按钮
Collection(val) {
let _this = this
this.$confirm({
content: '确认收藏?',
content: val.collectFlag == 0 || !val.collectFlag ? '确认收藏?':'确定取消收藏',
onOk() {
getAction('document/bussDocumentLibraryEO/addCollect', { id: val.id }).then((res) => {
let url = ''
if (val.collectFlag == 0 || !val.collectFlag){
url = 'document/bussDocumentLibraryEO/addCollect'
}else{
url = 'document/bussDocumentLibraryEO/cancelCollect'
}
getAction(url, { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
_this.$message.success(res.message)
eventBUs.$emit('searchReset')
} else {
this.$message.warning(res.message)
_this.$message.warning(res.message)
}
})
}