|
@@ -22,8 +22,8 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import SeeFile from '@/components/file-block/components/SeeFile'
|
|
import SeeFile from '@/components/file-block/components/SeeFile'
|
|
|
-
|
|
|
|
|
import removeFile from '@/utils/removeFile'
|
|
import removeFile from '@/utils/removeFile'
|
|
|
|
|
+import { log } from '@antv/g2plot/lib/utils';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'index',
|
|
name: 'index',
|
|
|
data () {
|
|
data () {
|
|
@@ -67,6 +67,8 @@ export default {
|
|
|
this.seeFile = item
|
|
this.seeFile = item
|
|
|
this.$refs.seeFile.dialogVisible = true
|
|
this.$refs.seeFile.dialogVisible = true
|
|
|
this.$emit('seeSuccess',item)
|
|
this.$emit('seeSuccess',item)
|
|
|
|
|
+ } else if (item.fileType == 'PDF') {
|
|
|
|
|
+ window.open(item.url,'_self')
|
|
|
} else {
|
|
} else {
|
|
|
this.$notify({
|
|
this.$notify({
|
|
|
title:'提示',
|
|
title:'提示',
|
|
@@ -75,10 +77,25 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- downLoad(item) {
|
|
|
|
|
|
|
+ async downLoad(item) {
|
|
|
this.$emit('updateDownLoadRecord',item)
|
|
this.$emit('updateDownLoadRecord',item)
|
|
|
this.$emit('seeSuccess',item)
|
|
this.$emit('seeSuccess',item)
|
|
|
- window.open(item.url,'_self')
|
|
|
|
|
|
|
+ if (item.fileType == 'PDF') {
|
|
|
|
|
+ this.$axios.get(item.url,{
|
|
|
|
|
+ responseType:'blob'
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ let a = document.createElement('a')
|
|
|
|
|
+ let url = window.URL.createObjectURL(res.data)
|
|
|
|
|
+ a.href = url
|
|
|
|
|
+ a.download = item.document
|
|
|
|
|
+ document.body.appendChild(a)
|
|
|
|
|
+ a.click()
|
|
|
|
|
+ document.body.removeChild(a)
|
|
|
|
|
+ window.URL.revokeObjectURL(a)
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ window.open(item.url,'_self')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|