【修改】收藏功能
This commit is contained in:
@@ -116,6 +116,22 @@ export default {
|
|||||||
params: data
|
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) {
|
reportList (data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
<vxe-column show-overflow show-header-overflow field="uploader" title="上传人"></vxe-column>
|
<vxe-column show-overflow show-header-overflow field="uploader" title="上传人"></vxe-column>
|
||||||
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
|
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<!-- <el-button type="text" v-if="row.collect" @click="collectReport(row,'y')">收藏</el-button>-->
|
<el-button type="text" @click="collectReport(row.id)">{{ row.collect==0?'收藏':'取消收藏' }}</el-button>
|
||||||
<!-- <el-button type="text" v-if="!row.collect" @click="collectReport(row,'n')">取消收藏</el-button>-->
|
<!-- <el-button type="text" v-if="!row.collect" @click="collectReport(row,'n')">取消收藏</el-button>-->
|
||||||
<el-button type="text" v-if="row.power == 1 ||row.power == 2" @click="goReportDetail(row)">预览</el-button>
|
<el-button type="text" v-if="row.power == 1 ||row.power == 2" @click="goReportDetail(row)">预览</el-button>
|
||||||
<el-button type="text" v-if="row.power == 3 || row.power == 2 " @click="downloadRow(row)">下载</el-button>
|
<el-button type="text" v-if="row.power == 3 || row.power == 2 " @click="downloadRow(row)">下载</el-button>
|
||||||
@@ -352,18 +352,6 @@ export default {
|
|||||||
this.treeData = res.data
|
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() {
|
search() {
|
||||||
this.q.pageNo = 1
|
this.q.pageNo = 1
|
||||||
this.reportList()
|
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() {
|
reportDateList() {
|
||||||
this.$api.report.reportDateList().then(({data}) => {
|
this.$api.report.reportDateList().then(({data}) => {
|
||||||
@@ -448,12 +413,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.total = 0
|
this.total = 0
|
||||||
this.tableData = []
|
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()
|
this.reportList()
|
||||||
},
|
},
|
||||||
// 下载
|
// 下载
|
||||||
@@ -468,12 +427,11 @@ export default {
|
|||||||
})
|
})
|
||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
collectReport(row,type){
|
collectReport(id){
|
||||||
if(type=='y'){
|
this.$api.report.reportCollect({reportId:id}).then(res=>{
|
||||||
// 调用收藏
|
this.$message.success("操作成功")
|
||||||
}else{
|
this.reportList()
|
||||||
|
})
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 跳转到详情
|
// 跳转到详情
|
||||||
goReportDetail(row) {
|
goReportDetail(row) {
|
||||||
|
|||||||
@@ -122,8 +122,8 @@
|
|||||||
<vxe-column show-overflow show-header-overflow field="uploader" title="上传人"></vxe-column>
|
<vxe-column show-overflow show-header-overflow field="uploader" title="上传人"></vxe-column>
|
||||||
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
|
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button type="text" v-if="row.collect" @click="collectReport(row,'y')">收藏</el-button>
|
<el-button type="text" v-if="row.collect" @click="collectReport(row.id)">收藏</el-button>
|
||||||
<el-button type="text" v-if="!row.collect" @click="collectReport(row,'n')">取消收藏</el-button>
|
<el-button type="text" v-if="!row.collect" @click="collectReport(row.id)">取消收藏</el-button>
|
||||||
<el-button type="text" v-if="row.power == 1 ||row.power == 2" @click="goReportDetail(row)">预览</el-button>
|
<el-button type="text" v-if="row.power == 1 ||row.power == 2" @click="goReportDetail(row)">预览</el-button>
|
||||||
<el-button type="text" v-if="row.power == 3 || row.power == 2 " @click="downloadRow(row)">下载</el-button>
|
<el-button type="text" v-if="row.power == 3 || row.power == 2 " @click="downloadRow(row)">下载</el-button>
|
||||||
<el-button type="text" v-if="row.power !== 2 && !isAdmin" @click="permissionApp(row)">申请权限</el-button>
|
<el-button type="text" v-if="row.power !== 2 && !isAdmin" @click="permissionApp(row)">申请权限</el-button>
|
||||||
@@ -351,25 +351,13 @@ export default {
|
|||||||
this.treeData = res.data
|
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() {
|
search() {
|
||||||
this.q.pageNo = 1
|
this.q.pageNo = 1
|
||||||
this.reportList()
|
this.reportList()
|
||||||
},
|
},
|
||||||
// 列表
|
// 列表
|
||||||
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.tableData = data.records
|
||||||
this.total = data.total
|
this.total = data.total
|
||||||
this.q.pageNo = data.current
|
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() {
|
reportDateList() {
|
||||||
this.$api.report.reportDateList().then(({data}) => {
|
this.$api.report.reportDateList().then(({data}) => {
|
||||||
@@ -467,12 +432,11 @@ export default {
|
|||||||
})
|
})
|
||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
collectReport(row,type){
|
collectReport(id){
|
||||||
if(type=='y'){
|
this.$api.report.reportCollect({reportId:id}).then(res=>{
|
||||||
// 调用收藏
|
this.$message.success("操作成功")
|
||||||
}else{
|
this.reportList()
|
||||||
|
})
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 跳转到详情
|
// 跳转到详情
|
||||||
goReportDetail(row) {
|
goReportDetail(row) {
|
||||||
|
|||||||
Reference in New Issue
Block a user