diff --git a/src/views/Report/ReportDetail.vue b/src/views/Report/ReportDetail.vue
index 1d894bc..807a384 100644
--- a/src/views/Report/ReportDetail.vue
+++ b/src/views/Report/ReportDetail.vue
@@ -55,10 +55,16 @@
@@ -126,6 +132,9 @@ export default {
name: 'ReportDetail',
data() {
return {
+ showText:false,
+ pointNum:0,
+ file:{},
isAdmin: false, //是否是管理员
report: {},
formatDate2,
@@ -248,13 +257,25 @@ export default {
}
},
// 预览
- previewRow() {
+ previewRow(id) {
// this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}`
// this.row = JSON.parse(this.$route.query.row)
- this.$api.report.reportGetReportHtmlId({id: this.row.id}).then(({data}) => {
+ this.$api.report.reportGetReportHtmlId({id: id}).then(({data}) => {
this.content = data.content
})
},
+ handleFile(row){
+ this.file=row
+ let lastName=row.fileName.split('.')
+ let list=['xls','xlsx']
+ if(list.indexOf(lastName[lastName.length-1])>-1){
+ this.showText=true
+ }else{
+ this.showText=false
+ this.previewRow(this.file.fileId)
+
+ }
+ },
// 下载
downloadRow(row) {
// this.$confirm('此操作将下载所选数据文件, 是否继续?', '提示', {
@@ -262,7 +283,7 @@ export default {
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
- this.$api.report.reportDownload({fileId: row.fileId, repostId: row.id}).then(res => {
+ this.$api.report.reportDownload({fileId: this.file.fileId, repostId: row.id}).then(res => {
downloadFile(res)
})
// })
@@ -273,7 +294,7 @@ export default {
this.row = res.data
this.isAdmin = this.$store.getters.userInfo.usid==this.row.createUserId
// 需要给分数/2
- this.previewRow()
+ this.handleFile(this.row.fileList[0])
})
},
},
@@ -362,17 +383,35 @@ export default {
.preview-box {
// 定位使水印不溢出元素
+ display: flex;
position: relative;
// 居中
width: calc(100% - 13px - 14px);
margin-left: 13px;
-
+ .preview-list{
+ width: 200px;
+ margin-top: 10px;
+ max-height: 500px;
+ overflow: auto;
+ .fileName{
+ width: 100%;
+ height: 28px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ word-break: keep-all;
+ white-space: nowrap;
+ cursor: pointer;
+ color: #434343;
+ padding: 0px 10px;
+ line-height: 28px;
+ }
+ }
.preview-content {
//margin: 0 14px 0 13px;
max-height: 500px;
padding-bottom: 11px;
overflow: auto;
-
+ width: calc(100% - 200px);
img {
max-width: 100% !important;
}
@@ -480,4 +519,7 @@ export default {
.showLimit ::v-deep .el-textarea .el-input__count{
width: 98%;
}
+.bgColor{
+ background-color: #F2F6FC;
+}
diff --git a/src/views/Report/ReportList.vue b/src/views/Report/ReportList.vue
index 5abce49..7eae331 100644
--- a/src/views/Report/ReportList.vue
+++ b/src/views/Report/ReportList.vue
@@ -122,6 +122,8 @@
+
+
预览
下载
申请权限
@@ -168,7 +170,7 @@