diff --git a/src/api/modules/report.js b/src/api/modules/report.js
index 881423b..a2dab2d 100644
--- a/src/api/modules/report.js
+++ b/src/api/modules/report.js
@@ -116,6 +116,22 @@ export default {
params: data
})
},
+ // 收藏报告
+ reportCollect(data) {
+ return request({
+ url: '/api/reportLogBook/collectOrCancelCollect',
+ method: 'get',
+ params:data
+ })
+ },
+ // 收藏列表
+ collectList(data) {
+ return request({
+ url: '/api/report/myCollectPage',
+ method: 'post',
+ data
+ })
+ },
// 报告列表
reportList (data) {
return request({
diff --git a/src/views/Report/ReportList.vue b/src/views/Report/ReportList.vue
index b3698e0..c0aeac6 100644
--- a/src/views/Report/ReportList.vue
+++ b/src/views/Report/ReportList.vue
@@ -123,7 +123,7 @@
-
+ {{ row.collect==0?'收藏':'取消收藏' }}
预览
下载
@@ -352,18 +352,6 @@ export default {
this.treeData = res.data
})
},
-
- // 标签列表
- labelList() {
- this.$api.report.labelList().then(({data}) => {
- this.tagData[1].name = data.labelOne.name
- this.tagData[2].name = data.labelTwo.name
- this.tagData[3].name = data.labelThree.name
- this.tagData[1].tags = data.labelOne.childList
- this.tagData[2].tags = data.labelTwo.childList
- this.tagData[3].tags = data.labelThree.childList
- })
- },
search() {
this.q.pageNo = 1
this.reportList()
@@ -381,30 +369,7 @@ export default {
}
})
},
- // 监听全选按钮
- handleCheckAllChange(val, type) {
- switch (type) {
- case 1:
- this.q.labelOneId = val ? this.tagData[type].tags.map(item => item.id) : []
- break
- case 2:
- this.q.labelTwoId = val ? this.tagData[type].tags.map(item => item.id) : []
- break
- case 3:
- this.q.labelThreeId = val ? this.tagData[type].tags.map(item => item.id) : []
- break
- }
- this.tagData[type].isIndeterminate = !val
- },
- // 监听group checkbox
- handleCheckedTagsChange(val, type) {
- this.tagData[type].checkAll = (val.length === this.tagData[type].tags.length)
- this.tagData[type].isIndeterminate = val.length < this.tagData[type].tags.length
- },
- // 切换展开隐藏
- switchTagShow(type) {
- this.tagData[type].tagShow = !this.tagData[type].tagShow
- },
+
// 日期列表
reportDateList() {
this.$api.report.reportDateList().then(({data}) => {
@@ -448,12 +413,6 @@ export default {
}
this.total = 0
this.tableData = []
- this.tagData[1].checkAll = false
- this.tagData[1].isIndeterminate = true
- this.tagData[2].checkAll = false
- this.tagData[2].isIndeterminate = true
- this.tagData[3].checkAll = false
- this.tagData[3].isIndeterminate = true
this.reportList()
},
// 下载
@@ -468,12 +427,11 @@ export default {
})
// })
},
- collectReport(row,type){
- if(type=='y'){
- // 调用收藏
- }else{
-
- }
+ collectReport(id){
+ this.$api.report.reportCollect({reportId:id}).then(res=>{
+ this.$message.success("操作成功")
+ this.reportList()
+ })
},
// 跳转到详情
goReportDetail(row) {
diff --git a/src/views/userCenter/collect/index.vue b/src/views/userCenter/collect/index.vue
index fa8c0f7..d0d07e1 100644
--- a/src/views/userCenter/collect/index.vue
+++ b/src/views/userCenter/collect/index.vue
@@ -122,8 +122,8 @@
- 收藏
- 取消收藏
+ 收藏
+ 取消收藏
预览
下载
申请权限
@@ -351,25 +351,13 @@ export default {
this.treeData = res.data
})
},
-
- // 标签列表
- labelList() {
- this.$api.report.labelList().then(({data}) => {
- this.tagData[1].name = data.labelOne.name
- this.tagData[2].name = data.labelTwo.name
- this.tagData[3].name = data.labelThree.name
- this.tagData[1].tags = data.labelOne.childList
- this.tagData[2].tags = data.labelTwo.childList
- this.tagData[3].tags = data.labelThree.childList
- })
- },
search() {
this.q.pageNo = 1
this.reportList()
},
// 列表
reportList() {
- this.$api.report.reportList({...this.q, labelId: this.checkedKeys}).then(({data}) => {
+ this.$api.report.collectList({...this.q, labelId: this.checkedKeys}).then(({data}) => {
this.tableData = data.records
this.total = data.total
this.q.pageNo = data.current
@@ -380,30 +368,7 @@ export default {
}
})
},
- // 监听全选按钮
- handleCheckAllChange(val, type) {
- switch (type) {
- case 1:
- this.q.labelOneId = val ? this.tagData[type].tags.map(item => item.id) : []
- break
- case 2:
- this.q.labelTwoId = val ? this.tagData[type].tags.map(item => item.id) : []
- break
- case 3:
- this.q.labelThreeId = val ? this.tagData[type].tags.map(item => item.id) : []
- break
- }
- this.tagData[type].isIndeterminate = !val
- },
- // 监听group checkbox
- handleCheckedTagsChange(val, type) {
- this.tagData[type].checkAll = (val.length === this.tagData[type].tags.length)
- this.tagData[type].isIndeterminate = val.length < this.tagData[type].tags.length
- },
- // 切换展开隐藏
- switchTagShow(type) {
- this.tagData[type].tagShow = !this.tagData[type].tagShow
- },
+
// 日期列表
reportDateList() {
this.$api.report.reportDateList().then(({data}) => {
@@ -467,12 +432,11 @@ export default {
})
// })
},
- collectReport(row,type){
- if(type=='y'){
- // 调用收藏
- }else{
-
- }
+ collectReport(id){
+ this.$api.report.reportCollect({reportId:id}).then(res=>{
+ this.$message.success("操作成功")
+ this.reportList()
+ })
},
// 跳转到详情
goReportDetail(row) {