|
@@ -338,6 +338,7 @@
|
|
|
<vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-edit" size="small" @click="toHref(scope.row)">下载</el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -432,6 +433,19 @@
|
|
|
this.projectService = new ProjectService()
|
|
|
},
|
|
|
methods: {
|
|
|
+ async toHref (row) {
|
|
|
+ console.log('rr', row)
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.setAttribute('download', row.name)
|
|
|
+ if (row.id === null || row.id === undefined || row.id === '') {
|
|
|
+ await this.ossService.getTemporaryUrl(row.raw.url).then((data) => {
|
|
|
+ link.setAttribute('href', data.data)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ link.setAttribute('href', row.url)
|
|
|
+ link.click()
|
|
|
+ }
|
|
|
+ },
|
|
|
onPreview (url) {
|
|
|
this.url = url
|
|
|
this.showViewer = true
|
|
@@ -534,6 +548,7 @@
|
|
|
console.log(this.dataListNew)
|
|
|
this.inputForm.workAttachments = []
|
|
|
this.dataListNew.forEach((item) => {
|
|
|
+ item.url = item.raw.url
|
|
|
item.attachmentFlag = 'projectRecords'
|
|
|
item.fileSize = item.size
|
|
|
item.attachmentName = item.name
|