From b7804faedc7feec50c3b0261ea2d6b5db6842bfb Mon Sep 17 00:00:00 2001
From: cgd_mac <349008059@qq.com>
Date: Sat, 26 Feb 2022 17:57:45 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/practice/report.js | 22 +++++++++++++++++++-
src/views/mycollection/index.vue | 35 ++++++++++++++++++++++++++++++++
src/views/myreport/index.vue | 34 ++++++++++++++++++++++++++++++-
3 files changed, 89 insertions(+), 2 deletions(-)
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 @@