Pārlūkot izejas kodu

1.3.0部分需求开发

刘洋 1 gadu atpakaļ
vecāks
revīzija
a4e9c75b83

+ 1 - 1
src/assets/styles/pages.scss

@@ -853,7 +853,7 @@
 }
 
 // question-edit-dialog
-.question-edit-dialog {
+.question-edit-dialog,.question-identify-dialog {
   .el-dialog__header {
     h2 {
       display: inline-block;

+ 2 - 1
src/components/selection/PropertySelect.vue

@@ -30,7 +30,8 @@ export default {
     },
     options: { type: Array, default: () => [] },
     disabled: { type: Boolean, default: false },
-    placeholder: { type: String, default: "请选择属性名" },
+    // placeholder: { type: String, default: "请选择属性名" },
+    placeholder: { type: String, default: "请选择知识点" },
     clearable: { type: Boolean, default: true },
     courseId: {
       type: [String, Number],

+ 2 - 1
src/components/selection/PropertySubSelect.vue

@@ -31,7 +31,8 @@ export default {
     },
     options: { type: Array, default: () => [] },
     disabled: { type: Boolean, default: false },
-    placeholder: { type: String, default: "请选择属性名" },
+    // placeholder: { type: String, default: "请选择属性名" },
+    placeholder: { type: String, default: "请选择知识点" },
     clearable: { type: Boolean, default: true },
     parentId: {
       type: [String, Number],

+ 4 - 0
src/modules/paper/api.js

@@ -144,6 +144,10 @@ export const paperDetailUpdateApi = (paperId, datas) => {
     datas
   );
 };
+export const paperDetailAddApi = (datas) => {
+  return $httpWithMsg.post(`${QUESTION_API}/paperDetail/add`, datas);
+};
+
 export const paperDetailMoveApi = ({ paperId, detailId, vector }) => {
   return $httpWithMsg.put(
     `${QUESTION_API}/paperDetail/${paperId}/${detailId}/${vector}`,

+ 11 - 3
src/modules/paper/components/ModifyDetailStruct.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    title="大题信息"
+    :title="dTitle"
     :visible.sync="modalIsShow"
     width="520px"
     :modal="false"
@@ -49,7 +49,7 @@
           ></el-input-number>
         </el-form-item>
       </template>
-      <template v-if="showSelective">
+      <template v-if="showSelective && !isAdd">
         <el-form-item label="是否选做题">
           <el-radio-group
             v-model="modalForm.selective"
@@ -134,6 +134,14 @@ export default {
       default: false,
     },
   },
+  computed: {
+    isAdd() {
+      return !Object.keys(this.detail).length;
+    },
+    dTitle() {
+      return this.isAdd ? "新增大题" : "大题信息";
+    },
+  },
   data() {
     return {
       modalIsShow: false,
@@ -199,7 +207,7 @@ export default {
 
         let data = { ...this.modalForm };
         if (!data.id) data.id = randomCode();
-        this.$emit("modified", data);
+        this.$emit("modified", data, this.isAdd);
         this.cancel();
       },
       1000,

+ 25 - 7
src/modules/paper/views/EditPaper.vue

@@ -111,6 +111,9 @@
           >
             编辑题卡
           </el-button>
+          <el-button type="info" size="small" @click="addBigQuestion">
+            新增大题
+          </el-button>
           <el-button
             v-if="enableCardEdit"
             type="danger"
@@ -630,6 +633,7 @@ import {
   paperQuestionChangeApi,
   paperCardDeleteApi,
   paperPropertyExportApi,
+  paperDetailAddApi,
 } from "../api";
 import { QUESTION_API } from "@/constants/constants";
 
@@ -906,19 +910,33 @@ export default {
       this.$message.success("添加成功!");
       this.initPaper();
     },
+    addBigQuestion() {
+      this.curDetail = {};
+      this.$refs.ModifyDetailStruct.open();
+    },
     // 大题编辑
     toEditPaperDetail(detail) {
       this.curDetail = { ...detail, detailName: detail.name };
       this.$refs.ModifyDetailStruct.open();
     },
-    async detailModified(detail) {
-      detail.name = detail.detailName;
-      const res = await paperDetailUpdateApi(this.paperId, detail).catch(
-        () => {}
-      );
+    async detailModified(detail, isAdd) {
+      if (isAdd) {
+        const res = paperDetailAddApi({
+          paperId: this.paperId,
+          name: detail.detailName,
+          description: detail.description,
+        }).catch(() => {});
+        if (!res) return;
+        this.$message.success("新增成功!");
+      } else {
+        detail.name = detail.detailName;
+        const res = await paperDetailUpdateApi(this.paperId, detail).catch(
+          () => {}
+        );
 
-      if (!res) return;
-      this.$message.success("修改成功!");
+        if (!res) return;
+        this.$message.success("修改成功!");
+      }
 
       // const paperDetail = this.paper.paperDetails.find(
       //   (item) => item.id === detail.id

+ 1 - 1
src/modules/question/components/FolderQuestionManageDialog.vue

@@ -280,7 +280,7 @@ export default {
       this.selectedQuestionIds = selections.map((item) => item.id);
     },
     folderFilterSelected(folder) {
-      console.log(folder);
+      console.log("folder:", folder);
       if (!folder) return;
 
       this.curFolder = folder;

+ 2 - 1
src/modules/question/components/QuestionFolder.vue

@@ -137,7 +137,8 @@ export default {
         {
           id: 0,
           parent: null,
-          name: "根目录",
+          // name: "根目录",
+          name: "全部试题",
           children: [],
         },
       ],

+ 19 - 2
src/modules/question/components/QuestionImportDialog.vue

@@ -16,7 +16,7 @@
         ref="modalFormComp"
         :model="modalForm"
         :rules="rules"
-        label-width="120px"
+        label-width="150px"
       >
         <el-form-item label="导入类型">
           <el-radio-group v-model="importType" @change="importTypeChange">
@@ -28,10 +28,21 @@
             >
           </el-radio-group>
         </el-form-item>
-        <el-form-item
+        <el-form-item v-if="importType == 'zip'" label="是否导入到其它课程">
+          <el-radio-group v-model="modalForm.toOtherCourse">
+            <el-radio :label="true">是</el-radio>
+            <el-radio :label="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <!-- <el-form-item
           v-if="importType !== 'zip'"
           prop="courseId"
           label="课程名称"
+        > -->
+        <el-form-item
+          v-if="importType !== 'zip' || modalForm.toOtherCourse"
+          prop="courseId"
+          label="课程名称"
         >
           <course-select v-model="modalForm.courseId" @change="courseChange">
           </course-select>
@@ -122,6 +133,7 @@ const initModalForm = {
   checkTotalScore: false,
   useOriginalPaper: false,
   totalScore: 0,
+  toOtherCourse: false,
 };
 
 export default {
@@ -215,10 +227,14 @@ export default {
       },
     },
     importType(val) {
+      this.modalForm.toOtherCourse = false;
       if (val === "zip") {
         this.modalForm.courseId = null;
       }
     },
+    "modalForm.toOtherCourse"(val) {
+      !val && (this.modalForm.courseId = null);
+    },
   },
   methods: {
     visibleChange() {
@@ -291,6 +307,7 @@ export default {
       if (!res) return;
 
       // this.$message.success("导入成功!");
+      console.log("upload res", res);
       this.$emit("modified", {
         ...res.data,
         importData: this.modalForm,

+ 2 - 1
src/modules/question/components/QuestionImportEdit.vue

@@ -16,7 +16,7 @@
         <div>
           <h2>文件上传</h2>
         </div>
-        <div>
+        <div style="display: flex; align-items: center">
           <upload-button
             btn-content="重新上传文件"
             btn-icon="icon icon-import"
@@ -28,6 +28,7 @@
             @upload-success="uploaded"
           ></upload-button>
           <el-button
+            style="margin-left: 10px"
             size="small"
             type="danger"
             icon="icon icon-back-white"

+ 6 - 1
src/modules/question/components/QuestionInfoEdit.vue

@@ -66,10 +66,15 @@
         </el-select>
       </el-form-item>
 
-      <el-form-item
+      <!-- <el-form-item
         class="question-info-prop"
         prop="quesProperties"
         label="属性名"
+      > -->
+      <el-form-item
+        class="question-info-prop"
+        prop="quesProperties"
+        label="知识点"
       >
         <div class="box-flex">
           <property-select

+ 202 - 104
src/modules/question/views/QuestionManage.vue

@@ -20,9 +20,13 @@
           ></el-input>
         </el-form-item>
         <el-form-item label="属性">
-          <property-tree-select
+          <!-- <property-tree-select
             v-model="filter.questionProperty"
             :course-id="filter.courseId"
+          ></property-tree-select> -->
+          <property-tree-select
+            v-model="filter.propertyIdList"
+            :course-id="filter.courseId"
           ></property-tree-select>
         </el-form-item>
 
@@ -62,6 +66,20 @@
           >
         </div>
         <div>
+          <el-button
+            type="primary"
+            plain
+            icon="el-icon-position"
+            @click="toBatchMove"
+            >移动</el-button
+          >
+          <el-button
+            type="primary"
+            plain
+            icon="el-icon-copy-document"
+            @click="toBatchCopy"
+            >复制</el-button
+          >
           <el-button
             type="danger"
             plain
@@ -120,101 +138,110 @@
       </div>
     </div>
 
-    <div class="part-box">
-      <el-table
-        v-loading="loading"
-        element-loading-text="加载中"
-        :data="questionList"
-        @selection-change="tableSelectChange"
-      >
-        <el-table-column
-          type="selection"
-          width="50"
-          align="center"
-        ></el-table-column>
-        <el-table-column label="题干" min-width="200">
-          <div slot-scope="scope" @click="toViewQuestion(scope.row)">
-            <rich-text
-              class="row-question-body"
-              title="点击查看试题"
-              :text-json="scope.row.quesBody"
-            ></rich-text>
-          </div>
-        </el-table-column>
-        <el-table-column label="课程" width="120">
-          <template slot-scope="scope">
-            <span>{{ scope.row.course.name }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="题型" prop="sourceDetailName" width="100">
-        </el-table-column>
-        <el-table-column label="难度" prop="difficulty" width="80">
-        </el-table-column>
-        <el-table-column label="使用量" prop="usageAmount" width="80">
-        </el-table-column>
-        <el-table-column label="创建人" prop="creator" width="120">
-        </el-table-column>
-        <el-table-column label="创建时间" width="170" prop="creationTime">
-        </el-table-column>
-        <el-table-column label="操作" width="180" fixed="right">
-          <template slot-scope="scope">
-            <div class="operate_left">
-              <el-button
-                size="mini"
-                type="primary"
-                plain
-                @click="toEditQuestion(scope.row)"
-                >编辑</el-button
-              >
-              <el-dropdown>
-                <el-button type="primary" size="mini" plain>
-                  更多 <i class="el-icon-more el-icon--right"></i>
-                </el-button>
-                <el-dropdown-menu slot="dropdown" class="action-dropdown">
-                  <el-dropdown-item>
-                    <el-button
-                      size="mini"
-                      type="primary"
-                      plain
-                      @click="toMoveQuestion(scope.row)"
-                      >移动</el-button
-                    >
-                  </el-dropdown-item>
-                  <el-dropdown-item>
-                    <el-button
-                      size="mini"
-                      type="primary"
-                      plain
-                      @click="toCopyQuestion(scope.row)"
-                      >复制</el-button
-                    >
-                  </el-dropdown-item>
-                  <el-dropdown-item>
-                    <el-button
-                      size="mini"
-                      type="danger"
-                      plain
-                      @click="toDeleteQuestion(scope.row)"
-                      >删除</el-button
-                    >
-                  </el-dropdown-item>
-                </el-dropdown-menu>
-              </el-dropdown>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="part-page">
-        <el-pagination
-          :current-page="currentPage"
-          :page-size="pageSize"
-          :page-sizes="[10, 20, 50, 100, 200, 300]"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          @current-change="toPage"
-          @size-change="handleSizeChange"
+    <div class="folder-question">
+      <div class="folder-list">
+        <question-folder
+          ref="QuestionFolder"
+          is-edit
+          @selected="folderFilterSelected"
+        ></question-folder>
+      </div>
+      <div class="question-list">
+        <el-table
+          v-loading="loading"
+          element-loading-text="加载中"
+          :data="questionList"
+          @selection-change="tableSelectChange"
         >
-        </el-pagination>
+          <el-table-column
+            type="selection"
+            width="50"
+            align="center"
+          ></el-table-column>
+          <el-table-column label="题干" min-width="200">
+            <div slot-scope="scope" @click="toViewQuestion(scope.row)">
+              <rich-text
+                class="row-question-body"
+                title="点击查看试题"
+                :text-json="scope.row.quesBody"
+              ></rich-text>
+            </div>
+          </el-table-column>
+          <el-table-column label="课程" width="120">
+            <template slot-scope="scope">
+              <span>{{ scope.row.course.name }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="题型" prop="sourceDetailName" width="100">
+          </el-table-column>
+          <el-table-column label="难度" prop="difficulty" width="80">
+          </el-table-column>
+          <el-table-column label="使用量" prop="usageAmount" width="80">
+          </el-table-column>
+          <el-table-column label="创建人" prop="creator" width="120">
+          </el-table-column>
+          <el-table-column label="创建时间" width="170" prop="creationTime">
+          </el-table-column>
+          <el-table-column label="操作" width="180" fixed="right">
+            <template slot-scope="scope">
+              <div class="operate_left">
+                <el-button
+                  size="mini"
+                  type="primary"
+                  plain
+                  @click="toEditQuestion(scope.row)"
+                  >编辑</el-button
+                >
+                <el-dropdown>
+                  <el-button type="primary" size="mini" plain>
+                    更多 <i class="el-icon-more el-icon--right"></i>
+                  </el-button>
+                  <el-dropdown-menu slot="dropdown" class="action-dropdown">
+                    <el-dropdown-item>
+                      <el-button
+                        size="mini"
+                        type="primary"
+                        plain
+                        @click="toMoveQuestion(scope.row)"
+                        >移动</el-button
+                      >
+                    </el-dropdown-item>
+                    <el-dropdown-item>
+                      <el-button
+                        size="mini"
+                        type="primary"
+                        plain
+                        @click="toCopyQuestion(scope.row)"
+                        >复制</el-button
+                      >
+                    </el-dropdown-item>
+                    <el-dropdown-item>
+                      <el-button
+                        size="mini"
+                        type="danger"
+                        plain
+                        @click="toDeleteQuestion(scope.row)"
+                        >删除</el-button
+                      >
+                    </el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="part-page">
+          <el-pagination
+            :current-page="currentPage"
+            :page-size="pageSize"
+            :page-sizes="[10, 20, 50, 100, 200, 300]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            @current-change="toPage"
+            @size-change="handleSizeChange"
+          >
+          </el-pagination>
+        </div>
       </div>
     </div>
 
@@ -275,12 +302,13 @@
 
 <script>
 import {
-  questionPageListApi,
+  // questionPageListApi,
   deleteQuestionApi,
   moveQuestionApi,
   copyQuestionApi,
   checkGptQuestionEnableApi,
   aiQuestionConfirmApi,
+  classifyQuestionPageListApi,
 } from "../api";
 import QuestionStatisticsDialog from "../components/QuestionStatisticsDialog.vue";
 import QuestionSafetySetDialog from "../components/QuestionSafetySetDialog.vue";
@@ -294,6 +322,7 @@ import QuestionImportEdit from "../components/QuestionImportEdit.vue";
 import GptQuestionDialog from "../components/GptQuestionDialog.vue";
 import { mapActions } from "vuex";
 import { USER_SIGNIN } from "../../portal/store/user";
+import QuestionFolder from "@/modules/question/components/QuestionFolder.vue";
 
 export default {
   name: "QuestionMamage",
@@ -308,6 +337,7 @@ export default {
     PropertyTreeSelect,
     QuestionImportEdit,
     GptQuestionDialog,
+    QuestionFolder,
   },
   data() {
     return {
@@ -316,7 +346,14 @@ export default {
         questionType: "",
         sourceDetailId: "",
         questionBody: "",
-        questionProperty: [],
+        // questionProperty: [],
+        propertyIdList: [],
+
+        classifyId: "",
+        // courseId: "",
+        // questionType: "",
+        // sourceDetailId: "",
+        // propertyIdList: [],
       },
       curFolderAction: "",
       folderList: [],
@@ -332,6 +369,7 @@ export default {
       curMoveType: "",
       questionImportData: {},
       gptQuestionEnable: false,
+      curActionQids: [],
     };
   },
   computed: {
@@ -340,10 +378,26 @@ export default {
     },
   },
   mounted() {
+    this.$refs.QuestionFolder.selectDefaultNode();
+
     this.checkGptEnable();
     this.toPage(1);
   },
   methods: {
+    folderFilterSelected(folder) {
+      console.log("left tree choose folder:", folder);
+      if (!folder) return;
+
+      this.curFolder = folder;
+      this.filter = {
+        classifyId: folder.id,
+        courseId: "",
+        questionType: "",
+        sourceDetailId: "",
+        propertyIdList: [],
+      };
+      this.toPage(1);
+    },
     ...mapActions([USER_SIGNIN]),
     async checkGptEnable() {
       const res = await checkGptQuestionEnableApi();
@@ -358,11 +412,14 @@ export default {
       this.selectedQuestionIds = [];
       let data = {
         ...this.filter,
-        pageNumber: this.currentPage,
+        // pageNumber: this.currentPage,
+        curPage: this.currentPage,
         pageSize: this.pageSize,
       };
-      data.questionProperty = data.questionProperty.join();
-      const res = await questionPageListApi(data).catch(() => {});
+      // data.questionProperty = data.questionProperty.join();
+      data.propertyIdList = data.propertyIdList.join();
+      // const res = await questionPageListApi(data).catch(() => {});
+      const res = await classifyQuestionPageListApi(data).catch(() => {});
       this.loading = false;
       if (!res) return;
       this.questionList = res.data.content;
@@ -432,23 +489,38 @@ export default {
       this.$refs.QuestionEditDialog.open();
     },
     toMoveQuestion(row) {
-      this.curQuestion = row;
+      // this.curQuestion = row;
+      this.curActionQids = [row.id];
       this.curFolderAction = "move";
       this.$refs.QuestionFolderDialog.open();
     },
     toCopyQuestion(row) {
-      this.curQuestion = row;
+      // this.curQuestion = row;
+      this.curActionQids = [row.id];
       this.curFolderAction = "copy";
       this.$refs.QuestionFolderDialog.open();
     },
     async folderSelected(folder) {
+      if (folder.id === this.curFolder.id && this.curFolderAction === "move") {
+        this.$message.error("内容就在当前当前文件中");
+        return;
+      }
       let res = null;
+      // if (this.curFolderAction === "move") {
+      //   res = await moveQuestionApi(this.curQuestion.id, folder.id).catch(
+      //     () => {}
+      //   );
+      // } else {
+      //   res = await copyQuestionApi(this.curQuestion.id, folder.id).catch(
+      //     () => {}
+      //   );
+      // }
       if (this.curFolderAction === "move") {
-        res = await moveQuestionApi(this.curQuestion.id, folder.id).catch(
+        res = await moveQuestionApi(this.curActionQids.join(), folder.id).catch(
           () => {}
         );
       } else {
-        res = await copyQuestionApi(this.curQuestion.id, folder.id).catch(
+        res = await copyQuestionApi(this.curActionQids.join(), folder.id).catch(
           () => {}
         );
       }
@@ -477,6 +549,24 @@ export default {
 
       this.deleteQuestion([row.id]);
     },
+    toBatchMove() {
+      if (!this.selectedQuestionIds.length) {
+        this.$message.error("请选择试题!");
+        return;
+      }
+      this.curActionQids = [...this.selectedQuestionIds];
+      this.curFolderAction = "move";
+      this.$refs.QuestionFolderDialog.open();
+    },
+    toBatchCopy() {
+      if (!this.selectedQuestionIds.length) {
+        this.$message.error("请选择试题!");
+        return;
+      }
+      this.curActionQids = [...this.selectedQuestionIds];
+      this.curFolderAction = "copy";
+      this.$refs.QuestionFolderDialog.open();
+    },
     async toBatchDelete() {
       if (!this.selectedQuestionIds.length) {
         this.$message.error("请选择试题!");
@@ -503,6 +593,7 @@ export default {
         this.getList();
         return;
       }
+      console.log("questionImported data", data);
       this.questionImportData = data;
       this.$refs.QuestionImportEdit.open();
     },
@@ -531,3 +622,10 @@ export default {
   },
 };
 </script>
+<style lang="scss" scoped>
+.content {
+  .folder-question {
+    min-height: calc(100vh - 306px);
+  }
+}
+</style>

+ 1 - 1
src/modules/question/views/SourceDetailManage.vue

@@ -14,7 +14,7 @@
           </el-form-item>
           <el-form-item label="题型名称">
             <el-input
-              v-model="searchForm.name"
+              v-model.trim="searchForm.name"
               placeholder="请输入题型名称"
               maxlength="50"
             />

+ 58 - 5
src/modules/questions/views/OrgProperty.vue

@@ -259,6 +259,40 @@
           </el-table>
         </el-form-item>
       </el-form>
+      <el-form v-if="activeName === 'tab6'" size="small" label-width="120px">
+        <el-form-item label="组卷配置">
+          <el-radio-group v-model="form.properties.GEN_PAPER_QUESTION_ENABLE">
+            <el-radio label="true">开启</el-radio>
+            <el-radio label="false">关闭</el-radio>
+          </el-radio-group>
+          (开启后,则必须在指定时间段内该课程新增试题数量满足条件才允许组卷,否则提示试题数量不够不允许组卷)
+        </el-form-item>
+        <el-form-item label="试题创建时间">
+          <el-date-picker
+            v-model="form.properties.timeRange"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+            value-format="yyyy-MM-dd"
+            align="right"
+            unlink-panels
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="新增试题数量">
+          <!-- <el-input-number
+            style="width: 80px"
+            v-model="form.properties.GEN_PAPER_QUESTION_COUNT"
+            :step="1"
+            :controls="false"
+          ></el-input-number> -->
+          <el-input
+            style="width: 80px"
+            v-model="form.properties.GEN_PAPER_QUESTION_COUNT"
+          ></el-input>
+        </el-form-item>
+      </el-form>
     </div>
   </section>
 </template>
@@ -267,6 +301,7 @@
 import { mapState } from "vuex";
 import { QUESTION_API } from "@/constants/constants.js";
 import { orgAiTransactionSaveApi, orgAiTransactionListApi } from "../api";
+import { omit } from "lodash";
 
 export default {
   name: "OrgProperty",
@@ -298,6 +333,7 @@ export default {
           name: "AI命题",
           val: "tab5",
         },
+        { name: "组卷设置", val: "tab6" },
       ],
       activeName: "tab2",
       rootOrgName: "",
@@ -327,6 +363,9 @@ export default {
           // AI命题
           AI_QUESTION_REMAINDER: 0,
           USE_AI_QUESTION: "false",
+          GEN_PAPER_QUESTION_ENABLE: "true",
+          timeRange: [],
+          GEN_PAPER_QUESTION_COUNT: "",
         },
       },
       rules: {
@@ -394,10 +433,13 @@ export default {
           //   );
           // }
 
-          this.form.properties = this.$objAssign(
-            this.form.properties,
-            response.data
-          );
+          this.form.properties = this.$objAssign(this.form.properties, {
+            ...response.data,
+            timeRange: [
+              response.data.GEN_PAPER_QUESTION_START,
+              response.data.GEN_PAPER_QUESTION_END,
+            ],
+          });
         }
       });
     },
@@ -438,7 +480,18 @@ export default {
     save() {
       // this.setParams();
       let url = QUESTION_API + "/org/saveOrgProperties";
-      this.$httpWithMsg.put(url, this.form).then(() => {
+      let GEN_PAPER_QUESTION_START = this.form.properties.timeRange[0];
+      let GEN_PAPER_QUESTION_END = this.form.properties.timeRange[1];
+      let params = {
+        orgId: this.form.orgId,
+        properties: {
+          ...omit(this.form.properties, "timeRange"),
+          GEN_PAPER_QUESTION_START,
+          GEN_PAPER_QUESTION_END,
+        },
+      };
+      // this.$httpWithMsg.put(url, this.form).then(() => {
+      this.$httpWithMsg.put(url, params).then(() => {
         this.$notify({
           type: "success",
           message: "保存成功!",

+ 6 - 0
src/modules/statistics/api.js

@@ -0,0 +1,6 @@
+import { $httpWithMsg } from "../../plugins/axios";
+import { QUESTION_API } from "@/constants/constants";
+
+export const statisticsQueryApi = (data) => {
+  return $httpWithMsg.post(`${QUESTION_API}/course/page/question/count`, data);
+};

+ 46 - 3
src/modules/statistics/views/StatisticsManage.vue

@@ -45,13 +45,50 @@
       </el-form>
       <div class="part-box-action"></div>
     </div>
+    <div class="part-box">
+      <el-table ref="table" :data="tableData" resizable>
+        <el-table-column label="序号" width="60">
+          <template slot-scope="scope">
+            {{ pageSize * (currentPage - 1) + scope.$index + 1 }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="courseName" label="课程名称"> </el-table-column>
+        <el-table-column prop="courseCode" label="课程代码"> </el-table-column>
+        <el-table-column
+          prop="questionCount"
+          label="试题数量"
+        ></el-table-column>
+        <el-table-column prop="paperCount" label="试卷数量"> </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          :current-page.sync="currentPage"
+          :page-size.sync="pageSize"
+          :page-sizes="[10, 20, 50, 100, 200, 300]"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          @current-change="handleCurrentChange"
+          @size-change="handleSizeChange"
+        />
+      </div>
+    </div>
   </div>
 </template>
 <script>
-import { courseQueryApi, cardListApi } from "../../card/api";
+import { courseQueryApi } from "../../card/api";
+import { statisticsQueryApi } from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
+import { omit } from "lodash";
 export default {
   name: "StatisticsManage",
+  computed: {
+    queryParams() {
+      let startTime = this.searchForm.createTime[0];
+      let endTime = this.searchForm.createTime[1];
+      let obj = omit(this.searchForm, "createTime");
+      return { ...obj, startTime, endTime };
+    },
+  },
   data() {
     return {
       courseList: [],
@@ -71,14 +108,15 @@ export default {
   },
   created() {
     this.getCoursesList();
+    this.search();
   },
   methods: {
     async search() {
       if (this.loading) return;
       this.loading = true;
 
-      const res = await cardListApi({
-        ...this.searchForm,
+      const res = await statisticsQueryApi({
+        ...this.queryParams,
         pageNumber: this.currentPage,
         pageSize: this.pageSize,
       }).catch(() => {});
@@ -89,6 +127,11 @@ export default {
       this.tableData = res.data.content;
       this.total = res.data.totalElements;
     },
+    handleSizeChange(val) {
+      this.currentPage = 1;
+      this.pageSize = val;
+      this.search();
+    },
     handleCurrentChange(val) {
       this.currentPage = val;
       this.search();