소스 검색

feat:答题记录/我的答题记录添加用户模糊搜索和导出功能

caoliqin 23 시간 전
부모
커밋
c7334e8231
3개의 변경된 파일64개의 추가작업 그리고 33개의 파일을 삭제
  1. 9 0
      src/api/course/courseAnswerlogs.js
  2. 27 16
      src/views/course/courseAnswerlogs/index.vue
  3. 28 17
      src/views/course/courseAnswerlogs/myCourseAnswerlogs.vue

+ 9 - 0
src/api/course/courseAnswerlogs.js

@@ -60,3 +60,12 @@ export function exportLogs(query) {
     params: query
   })
 }
+
+// 导出我的答题日志
+export function exportMyLogs(query) {
+  return request({
+    url: '/course/courseAnswerLog/myExport',
+    method: 'get',
+    params: query
+  })
+}

+ 27 - 16
src/views/course/courseAnswerlogs/index.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
+      <el-form-item label="用户" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入用户昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="项目" prop="courseId">
         <el-select filterable  v-model="queryParams.project" placeholder="请选择项目"  clearable size="small">
           <el-option
@@ -32,7 +41,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="销售名称" prop="companyUserName">
-        <el-select v-model="queryParams.companyUserId" remote placeholder="请选择" filterable clearable  style="width: 100%;" @keyup.enter.native="handleQuery">
+        <el-select v-model="queryParams.companyUserId" remote placeholder="请输入" filterable clearable  style="width: 100%;" @keyup.enter.native="handleQuery">
           <el-option
             v-for="dict in companyUserList"
             :key="`${dict.nickName} - ${dict.userName}`"
@@ -72,20 +81,20 @@
       </el-form-item>
     </el-form>
 
-<!--    <el-row :gutter="10" class="mb8">-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          :loading="exportLoading"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['course:courseAnswerLog:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
-<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
-<!--    </el-row>-->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:courseAnswerLog:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
 
     <el-table border v-loading="loading" :data="logsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
@@ -170,6 +179,7 @@ export default {
         isRight: null,
         sTime:null,
         eTime:null,
+        userName: null,
       },
       //选择时间
       createTime:null,
@@ -260,6 +270,7 @@ export default {
         companyId: null,
         sTime:null,
         eTime:null,
+        userName: null,
       };
       this.resetForm("form");
     },
@@ -335,7 +346,7 @@ export default {
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有答题日志数据项?', "警告", {
+      this.$confirm('是否确认导出当前答题日志数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"

+ 28 - 17
src/views/course/courseAnswerlogs/myCourseAnswerlogs.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
+      <el-form-item label="用户" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入用户昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="项目" prop="courseId">
         <el-select filterable  v-model="queryParams.project" placeholder="请选择项目"  clearable size="small">
           <el-option
@@ -52,20 +61,20 @@
       </el-form-item>
     </el-form>
 
-<!--    <el-row :gutter="10" class="mb8">-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          :loading="exportLoading"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['course:courseAnswerLog:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
-<!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
-<!--    </el-row>-->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:courseAnswerLog:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
 
     <el-table border v-loading="loading" :data="logsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
@@ -95,7 +104,7 @@
 </template>
 
 <script>
-import { myListLogs, getLogs, delLogs, addLogs, updateLogs, exportLogs } from "@/api/course/courseAnswerlogs";
+import { myListLogs, getLogs, delLogs, addLogs, updateLogs, exportMyLogs } from "@/api/course/courseAnswerlogs";
 import { courseList, videoList } from '@/api/course/courseRedPacketLog'
 import {allListTagGroup} from "@/api/qw/tagGroup";
 import {listTag} from "@/api/qw/tag";
@@ -150,6 +159,7 @@ export default {
         isRight: null,
         sTime:null,
         eTime:null,
+        userName: null,
       },
       //选择时间
       createTime:null,
@@ -237,6 +247,7 @@ export default {
         companyId: null,
         sTime:null,
         eTime:null,
+        userName: null,
       };
       this.resetForm("form");
     },
@@ -312,13 +323,13 @@ export default {
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有答题日志数据项?', "警告", {
+      this.$confirm('是否确认导出当前答题日志数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
           this.exportLoading = true;
-          return exportLogs(queryParams);
+          return exportMyLogs(queryParams);
         }).then(response => {
           this.download(response.msg);
           this.exportLoading = false;