diff --git a/src/api/practice/report.js b/src/api/practice/report.js index 954d41e..ad41b6e 100644 --- a/src/api/practice/report.js +++ b/src/api/practice/report.js @@ -2,7 +2,9 @@ import request from '@/utils/request' const answerApi = { answerViewReport: 'answer/viewReport', // 查看报告 - answerViewResolution: 'answer/viewResolution' // 查看解析 + answerViewResolution: 'answer/viewResolution', // 查看解析 + collection: 'practice/collection', // 收藏 + collectionCancel: 'practice/cancel/collection' // 取消收藏 } export function answerViewReport (params) { @@ -13,6 +15,24 @@ export function answerViewReport (params) { }) } +export function reqCollection (params) { + return request({ + url: answerApi.collection, + method: 'post', + params: params, + data: params + }) +} + +export function reqCollectionCancel (params) { + return request({ + url: answerApi.collectionCancel, + method: 'get', + params: params, + data: params + }) +} + export function answerViewResolution (params) { return request({ url: answerApi.answerViewResolution, diff --git a/src/views/mycollection/index.vue b/src/views/mycollection/index.vue index f2ec8d2..4d0105a 100644 --- a/src/views/mycollection/index.vue +++ b/src/views/mycollection/index.vue @@ -15,6 +15,16 @@ @@ -44,6 +54,16 @@ @@ -115,6 +135,7 @@ import { practiceRecordPageList, practiceWrongPageList } from '@/api/practice/practice' +import { reqCollectionCancel } from '@/api/practice/report' export default { components: { DbQuestionInfoItem, 'a-pagination': Pagination }, @@ -152,6 +173,20 @@ export default { this.getPracticerecordPageList() this.getPracticewrongPageList() }, + handlerDelete (data, type) { + const _this = this + this.$confirm({ + title: '安全培训', + content: '确定删除吗?', + onOk () { + reqCollectionCancel({ questionId: data.questionId, type: type }).then(res => { + _this.$message.success('删除成功!') + _this.initData() + }) + }, + onCancel () {} + }) + }, goBack () { this.$router.go(-1) }, diff --git a/src/views/myreport/index.vue b/src/views/myreport/index.vue index 87f9402..4ef5ed0 100644 --- a/src/views/myreport/index.vue +++ b/src/views/myreport/index.vue @@ -35,6 +35,19 @@ @@ -47,7 +60,12 @@