From 2b8e63517eb9470f31c4ea585b6bf5ed5267c978 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sun, 21 Mar 2021 13:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=AE=B0=E5=BD=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_client/src/api/examtest.js | 7 +++++ test_client/src/views/analyse/examtest.vue | 31 +++++++++++++++++++--- test_server/examtest/views.py | 2 +- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/test_client/src/api/examtest.js b/test_client/src/api/examtest.js index 14a94db..a415702 100644 --- a/test_client/src/api/examtest.js +++ b/test_client/src/api/examtest.js @@ -140,4 +140,11 @@ export function exportwTest(id,data) { method: 'post', data: data }) +} + +export function deleteExamtest(id) { + return request({ + url: `/examtest/examtest/${id}/`, + method: 'delete', + }) } \ No newline at end of file diff --git a/test_client/src/views/analyse/examtest.vue b/test_client/src/views/analyse/examtest.vue index 983119a..deef5da 100644 --- a/test_client/src/views/analyse/examtest.vue +++ b/test_client/src/views/analyse/examtest.vue @@ -54,7 +54,7 @@ icon="el-icon-refresh-left" @click="resetFilter" >刷新重置 - 导出Excel + 导出Excel
@@ -111,6 +111,12 @@ size="small" @click="handleExport2(scope)" >重新生成 + 删除 @@ -125,7 +131,7 @@ diff --git a/test_server/examtest/views.py b/test_server/examtest/views.py index 7a291ae..8e24748 100644 --- a/test_server/examtest/views.py +++ b/test_server/examtest/views.py @@ -342,7 +342,7 @@ class ExamTestViewSet(ModelViewSet): """ 考试记录列表和详情 """ - perms_map = [{'get': 'examtest_view'},{'post': '*'}] + perms_map = [{'get': 'examtest_view'},{'post': '*'}, {'delete':'examtest_delete'}] pagination_class = CommonPagination queryset = ExamTest.objects.filter(is_delete=0).all() serializer_class = ExamTestListSerializer