Selaa lähdekoodia

Merge branch 'dev_1.2.0' of http://git.qmth.com.cn/union-question/union-question-web into dev_1.2.0

zhangjie 2 vuotta sitten
vanhempi
commit
a1a8182df6

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "start": "vue-cli-service serve --port 7002",
+    "start": "vue-cli-service serve --port 7000",
     "serve": "vue-cli-service serve",
     "build:dev": "vue-cli-service build",
     "build:test": "vue-cli-service build",

+ 4 - 4
src/modules/questions/routes/routes.js

@@ -80,7 +80,7 @@ export default [
         component: InsertPaperStructure,
       },
       {
-        path: "insert_paper_structure_info/:id/:name/:detailId/:courseNo", //精确试卷结构添加题型结构
+        path: "insert_paper_structure_info/:id/:name/:detailId/:courseId", //精确试卷结构添加题型结构
         component: InsertPaperStructureInfo,
       },
       {
@@ -159,11 +159,11 @@ export default [
         component: InsertPaperTitle,
       },
       {
-        path: "edit_other_question/:paperId/:paperDetailId/:questionType/:courseNo/:courseName",
+        path: "edit_other_question/:paperId/:paperDetailId/:questionType/:courseId",
         component: EditOtherQuestion,
       },
       {
-        path: "edit_select_question/:paperId/:paperDetailId/:questionType/:courseNo/:courseName",
+        path: "edit_select_question/:paperId/:paperDetailId/:questionType/:courseId",
         component: EditSelectQuestion,
       },
       {
@@ -186,7 +186,7 @@ export default [
     component: EditPaperPendingTrial,
   },
   {
-    path: "/select_question/:id/:courseNo/:courseName/:paperDetailId/:parentView", //试卷选题
+    path: "/select_question/:id/:courseId/:paperDetailId/:parentView", //试卷选题
     component: SelectQuestion,
   },
   {

+ 10 - 10
src/modules/questions/views/BluePaperStructure.vue

@@ -13,7 +13,7 @@
         </el-form-item>
         <el-form-item label="制定课程">
           <el-select
-            v-model="formSearch.courseNo"
+            v-model="formSearch.courseId"
             filterable
             :remote-method="getCourses"
             remote
@@ -23,9 +23,9 @@
           >
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -136,7 +136,7 @@ export default {
     return {
       formSearch: {
         name: "",
-        courseNo: "",
+        courseId: null,
         type: "BLUEPRINT",
         courseName: "",
       },
@@ -166,8 +166,8 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
-        courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
+        var courseId = course.id;
+        courseList.push({ courseId: courseId, courseInfo: courseInfo });
       }
       return courseList;
     },
@@ -264,16 +264,16 @@ export default {
         return val + "(难)";
       }
     },
-    getCourseName(courseNo) {
+    getCourseName(courseId) {
       for (let course of this.courseList) {
-        if (course.code == courseNo) {
+        if (course.courseId == courseId) {
           this.formSearch.courseName = course.name;
         }
       }
     },
     //修改
     editStruct(row) {
-      this.getCourseName(this.formSearch.courseNo);
+      this.getCourseName(this.formSearch.courseId);
       sessionStorage.setItem(
         "blue_paper_stucture",
         JSON.stringify(this.formSearch)
@@ -347,7 +347,7 @@ export default {
         sessionStorage.removeItem("blue_paper_stucture_currentPage");
         this.formSearch = {
           name: "",
-          courseNo: "",
+          courseId: null,
           type: "BLUEPRINT",
           courseName: "",
         };

+ 9 - 15
src/modules/questions/views/EditOtherQuestion.vue

@@ -289,12 +289,11 @@ export default {
       fullscreenLoading: false,
       questionTypes: QUESTION_TYPES,
       courseName: "",
-      courseNo: "",
+      courseId: "",
       paperDetailId: "",
       paperId: "",
       quesModel: {
-        courseName: "",
-        courseNo: "",
+        courseId: "",
         quesAnswer: "",
         quesBody: "",
         questionType: "",
@@ -365,7 +364,7 @@ export default {
     this.paperId = this.$route.params.paperId;
     this.paperDetailId = this.$route.params.paperDetailId;
     this.courseName = this.$route.params.courseName;
-    this.courseNo = this.$route.params.courseNo;
+    this.courseId = this.$route.params.courseId;
     let questionType = this.$route.params.questionType;
     if (questionType) {
       this.quesModel.questionType = questionType;
@@ -375,13 +374,9 @@ export default {
       this.quesModel["id"] = this.questionId;
       this.getQues(this.questionId);
     }
-    if (this.courseNo) {
+    if (this.courseId) {
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(this.courseNo)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + this.courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });
@@ -478,8 +473,7 @@ export default {
               });
           } else {
             //新增逻辑
-            this.quesModel.courseNo = this.courseNo;
-            this.quesModel.courseName = this.courseName;
+            this.quesModel.courseId = this.courseId;
             this.fullscreenLoading = true;
             this.$http
               .post(
@@ -539,10 +533,10 @@ export default {
     },
     //查询所有课程属性名
     initCourseProperty() {
-      var code = this.quesModel.course.code;
-      if (!code) return;
+      var courseId = this.quesModel.course.courseId;
+      if (!courseId) return;
       this.$http
-        .get(QUESTION_API + "/courseProperty/code/" + code)
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });

+ 6 - 13
src/modules/questions/views/EditPaper.vue

@@ -1141,7 +1141,7 @@
       <PaperBlue
         v-if="blueDialog"
         :paper-id="paperId"
-        :course-code="paper.course.code"
+        :course-id="paper.course.id"
       ></PaperBlue>
     </el-dialog>
     <!-- 审核记录 -->
@@ -1715,16 +1715,13 @@ export default {
     },
     selectQues(id) {
       this.paperDetailId = id;
-      var courseCode = this.paper.course.code;
-      var courseName = this.paper.course.name;
+      var courseId = this.paper.course.id;
       this.$router.push({
         path:
           "/select_question/" +
           this.paper.id +
           "/" +
-          courseCode +
-          "/" +
-          encodeURIComponent(courseName) +
+          courseId +
           "/" +
           this.paperDetailId +
           "/" +
@@ -1773,7 +1770,7 @@ export default {
         .then((response) => {
           this.paper = response.data;
           //查询所有课程属性名
-          this.initCourseProperty(this.paper.course.code);
+          this.initCourseProperty(this.paper.course.id);
           //将所有小题分为公开和非公开
           if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
             let dindx = 0;
@@ -1823,13 +1820,9 @@ export default {
         });
     },
     //查询所有课程属性名
-    initCourseProperty(courseCode) {
+    initCourseProperty(courseId) {
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(courseCode)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });

+ 5 - 12
src/modules/questions/views/EditPaperPendingTrial.vue

@@ -1816,16 +1816,13 @@ export default {
     },
     selectQues(id) {
       this.paperDetailId = id;
-      var courseCode = this.paper.course.code;
-      var courseName = this.paper.course.name;
+      var courseId = this.paper.course.id;
       this.$router.push({
         path:
           "/select_question/" +
           this.paper.id +
           "/" +
-          courseCode +
-          "/" +
-          encodeURIComponent(courseName) +
+          courseId +
           "/" +
           this.paperDetailId +
           "/" +
@@ -1874,7 +1871,7 @@ export default {
         .then((response) => {
           this.paper = response.data;
           //查询所有课程属性名
-          this.initCourseProperty(this.paper.course.code);
+          this.initCourseProperty(this.paper.course.id);
           //将所有小题分为公开和非公开
           if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
             let dindx = 0;
@@ -1924,13 +1921,9 @@ export default {
         });
     },
     //查询所有课程属性名
-    initCourseProperty(courseCode) {
+    initCourseProperty(courseId) {
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(courseCode)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });

+ 6 - 15
src/modules/questions/views/EditSelectQuestion.vue

@@ -264,8 +264,7 @@ export default {
         quesOptions: [],
         quesAnswer: "",
         questionType: "",
-        courseName: "",
-        courseNo: "",
+        courseId: "",
         difficultyDegree: 0.5,
         publicity: true,
         answerType: "",
@@ -334,18 +333,14 @@ export default {
     }
     this.paperId = this.$route.params.paperId;
     this.paperDetailId = this.$route.params.paperDetailId;
-    this.courseNo = this.$route.params.courseNo;
+    this.courseId = this.$route.params.courseId;
     let questionType = this.$route.params.questionType;
     if (questionType) {
       this.quesModel.questionType = questionType;
     }
-    if (this.courseNo) {
+    if (this.courseId) {
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(this.courseNo)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + this.courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });
@@ -568,13 +563,9 @@ export default {
     },
     //查询所有课程属性名
     initCourseProperty() {
-      var code = this.quesModel.course.code;
+      var courseId = this.quesModel.courseId;
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(code)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });

+ 15 - 15
src/modules/questions/views/GenPaper.vue

@@ -6,7 +6,7 @@
       <el-form class="part-filter-form" :inline="true" :model="formSearch">
         <el-form-item label="课程名称">
           <el-select
-            v-model="formSearch.courseNo"
+            v-model="formSearch.courseId"
             filterable
             :remote-method="getCourses"
             remote
@@ -16,9 +16,9 @@
           >
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             >
             </el-option>
           </el-select>
@@ -384,7 +384,7 @@ export default {
       isClear: 0,
       courseLoading: false,
       formSearch: {
-        courseNo: "",
+        courseId: "",
         courseName: "",
         creator: "",
         lastModifyName: "",
@@ -446,10 +446,10 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
+        var courseId = course.id;
         var courseName = course.name;
         courseList.push({
-          courseNo: courseNo,
+          courseId: courseId,
           courseInfo: courseInfo,
           courseName: courseName,
         });
@@ -590,7 +590,7 @@ export default {
     },
     resetForm() {
       this.formSearch = {
-        courseNo: "",
+        courseId: "",
         courseName: "",
         level: "",
         name: "",
@@ -614,21 +614,21 @@ export default {
       this.loading = false;
     },
     genPaperDetail() {
-      var courseNo = this.formSearch.courseNo;
-      if (!courseNo) {
+      var courseId = this.formSearch.courseId;
+      if (!courseId) {
         this.$notify({
           title: "警告",
           message: "请选择课程",
           type: "warning",
         });
       } else {
-        var course = this.getCourseObj(courseNo);
+        var course = this.getCourseObj(courseId);
         this.formSearch.courseName = course.name;
         sessionStorage.setItem("gen_paper", JSON.stringify(this.formSearch));
         sessionStorage.setItem("gen_paper_currentPage", this.currentPage);
         this.$router.push({
           name: "gen_paper_detail",
-          params: { courseNo: courseNo },
+          params: { courseId: courseId },
         });
       }
     },
@@ -641,16 +641,16 @@ export default {
       this.currentPage = 1;
       this.searchGenPaper();
     },
-    getCourseObj(courseNo) {
+    getCourseObj(courseId) {
       for (let course of this.courseList) {
-        if (course.code == courseNo) {
+        if (course.id == courseId) {
           return course;
         }
       }
       return "";
     },
     editGenPaper(row) {
-      var course = this.getCourseObj(this.formSearch.courseNo);
+      var course = this.getCourseObj(this.formSearch.courseId);
       if (course) {
         this.formSearch.courseName = course.name;
       }
@@ -847,7 +847,7 @@ export default {
       if (this.isClear == 0 || !this.isClear) {
         this.removeItem();
         this.formSearch = {
-          courseNo: "",
+          courseId: "",
           courseName: "",
           level: "",
           name: "",

+ 21 - 46
src/modules/questions/views/GenPaperDetail.vue

@@ -714,6 +714,7 @@ export default {
       frozenPaperSet: new Set(),
       genPaper: {
         frozenPaperIds: [],
+        courseId: "",
         courseNo: "",
         courseName: "",
         level: "",
@@ -772,17 +773,12 @@ export default {
     },
   },
   created() {
-    this.genPaper.courseNo = this.$route.params.courseNo;
-    var url =
-      QUESTION_API +
-      "/course/byCode?" +
-      "rootOrgId=" +
-      this.user.rootOrgId +
-      "&code=" +
-      encodeURIComponent(this.genPaper.courseNo);
+    this.genPaper.courseId = this.$route.params.courseId;
+    var url = QUESTION_API + "/course/" + this.genPaper.courseId;
     this.$httpWithMsg
       .get(url)
       .then((response) => {
+        this.genPaper.courseNo = response.data.code;
         this.genPaper.courseName = response.data.name;
         this.genPaper.level = response.data.level;
       })
@@ -844,8 +840,8 @@ export default {
               this.curSelect +
               "/" +
               this.pageSize +
-              "?courseNo=" +
-              this.genPaper.courseNo +
+              "?courseId=" +
+              this.genPaper.courseId +
               "&ids=" +
               this.tempPaperIds
           )
@@ -864,8 +860,8 @@ export default {
               this.curSelect +
               "/" +
               this.pageSize +
-              "?courseNo=" +
-              this.genPaper.courseNo +
+              "?courseId=" +
+              this.genPaper.courseId +
               "&ids=" +
               this.tempPaperIds
           )
@@ -886,14 +882,13 @@ export default {
       this.searchPaperDetailStructs();
     },
     searchPaperStructs() {
-      var courseNo = this.genPaper.courseNo;
-      var url =
-        QUESTION_API + "/paperStruct?courseNo=" + encodeURIComponent(courseNo);
+      var courseId = this.genPaper.courseId;
+      var url = QUESTION_API + "/paperStruct?courseId=" + courseId;
       this.loading = true;
       this.$http.get(url).then((response) => {
         this.paperStructs = response.data;
         for (let paperStructObj of this.paperStructs) {
-          if (paperStructObj.paperStrucType == "BLUEPRINT") {
+          if (paperStructObj.type == "BLUEPRINT") {
             for (let couProperty of this.coursePropertyList) {
               if (couProperty.id == paperStructObj.coursePropertyId) {
                 this.blueStructs.push(paperStructObj);
@@ -1041,30 +1036,14 @@ export default {
         this.frozenPaperSet.forEach((element) => {
           this.genPaper.frozenPaperIds.push(element);
         });
-        this.$http.post(url, this.genPaper).then(
-          (res) => {
-            this.$notify({
-              message: "组卷成功",
-              type: "success",
-            });
-            this.fullscreenLoading = false;
-            // if (this.genPaper.genNumber == 1) {
-            //   let paperId = response.data.paper.id;
-            //   this.$router.push({
-            //     path: "/edit_paper/" + paperId + "/gen_paper",
-            //   });
-            // } else {
+        this.$httpWithMsg
+          .post(url, this.genPaper)
+          .then((res) => {
             this.back(res.data.status);
-            // }
-          },
-          (error) => {
-            this.$notify({
-              message: error.response.data.msg,
-              type: "error",
-            });
+          })
+          .finally(() => {
             this.fullscreenLoading = false;
-          }
-        );
+          });
       }
     },
     selectCurrentChange(val) {
@@ -1077,12 +1056,12 @@ export default {
     back(status) {
       if ("PASS" == status) {
         this.$notify({
-          message: "上传成功",
+          message: "组卷成功",
           type: "success",
         });
         this.$router.push({ path: "/questions/gen_paper/1" });
       } else {
-        this.$confirm("已开启审核功能.是否跳转到待审列表?", "上传成功", {
+        this.$confirm("已开启审核功能.是否跳转到待审列表?", "组卷成功", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning",
@@ -1226,13 +1205,9 @@ export default {
     },
     //查询课程下开启的课程属性
     getCoursePropertyList() {
-      var courseNo = this.genPaper.courseNo;
+      var courseId = this.genPaper.courseId;
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(courseNo)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
           this.searchPaperStructs();

+ 15 - 15
src/modules/questions/views/InsertBluePaperStructure.vue

@@ -42,7 +42,7 @@
         </el-form-item>
         <el-form-item label="制定课程">
           <el-select
-            v-model="blueStruct.courseNo"
+            v-model="blueStruct.courseId"
             :disabled="showcoursePropertyId"
             filterable
             :remote-method="getCourses"
@@ -54,9 +54,9 @@
           >
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             >
             </el-option>
           </el-select>
@@ -213,7 +213,7 @@ export default {
       blueStruct: {
         name: "",
         totalScore: 0, //结构总分
-        courseNo: "", //课程
+        courseId: null, //课程
         courseName: "",
         coursePropertyId: "", //课程属性
         coursePropertyName: "", //课程属性名称
@@ -265,8 +265,8 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
-        courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
+        var courseId = course.id;
+        courseList.push({ courseId: courseId, courseInfo: courseInfo });
       }
       return courseList;
     },
@@ -321,8 +321,8 @@ export default {
         this.$http
           .get(
             QUESTION_API +
-              "/courseProperty/enable?courseCode=" +
-              encodeURIComponent(this.blueStruct.courseNo)
+              "/courseProperty/enable?courseId=" +
+              this.blueStruct.courseId
           )
           .then((response) => {
             this.coursePropertyList = response.data;
@@ -341,7 +341,7 @@ export default {
     },
     getProperties() {
       for (var course of this.courseList) {
-        if (this.blueStruct.courseNo == course.code) {
+        if (this.blueStruct.courseId == course.courseId) {
           var courseId = course.id;
           this.$http
             .get(QUESTION_API + "/courseProperty/all/" + courseId)
@@ -357,8 +357,8 @@ export default {
       this.$http
         .get(
           QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(this.blueStruct.courseNo)
+            "/courseProperty/enable?courseId=" +
+            this.blueStruct.courseId
         )
         .then((response) => {
           this.coursePropertyList = response.data;
@@ -576,9 +576,9 @@ export default {
         }
       }
     },
-    getCourseName(courseNo) {
+    getCourseName(courseId) {
       for (let course of this.courseList) {
-        if (course.code == courseNo) {
+        if (course.courseId == courseId) {
           this.blueStruct.courseName = course.name;
         }
       }
@@ -592,7 +592,7 @@ export default {
         });
         return false;
       }
-      this.getCourseName(this.blueStruct.courseNo);
+      this.getCourseName(this.blueStruct.courseId);
       sessionStorage.setItem("blueStruct", JSON.stringify(this.blueStruct));
       this.$router.push({
         path:
@@ -626,7 +626,7 @@ export default {
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;
-          if (this.blueStruct.courseNo) {
+          if (this.blueStruct.courseId) {
             this.getCoursePropertyList();
           }
         });

+ 8 - 8
src/modules/questions/views/InsertBluePaperStructureInfo.vue

@@ -330,8 +330,8 @@ export default {
       message: "",
       question: {
         questionType: "",
-        courseNo: "",
-        coursePropertyName: "",
+        courseId: null,
+        coursePropertyId: "",
         publicity: "",
         firstPropertyId: "",
         secondPropertyId: "",
@@ -454,8 +454,8 @@ export default {
         QUESTION_API +
         "/paperStruct/quesNames?quesType=" +
         this.paperDetailStruct.questionType +
-        "&courseNo=" +
-        this.blueStruct.courseNo;
+        "&courseId=" +
+        this.blueStruct.courseId;
       this.$http.get(url).then((response) => {
         this.quesNameList = response.data;
       });
@@ -467,8 +467,8 @@ export default {
           QUESTION_API +
           "/paperStruct/quesNames?quesType=" +
           quesType +
-          "&courseNo=" +
-          this.blueStruct.courseNo;
+          "&courseId=" +
+          this.blueStruct.courseId;
         this.$http.get(url).then((response) => {
           this.quesNameList = response.data;
         });
@@ -740,8 +740,8 @@ export default {
     //鼠标悬浮事件
     showActiveIn(publicity, difficulty, row) {
       this.question.questionType = this.paperDetailStruct.questionType;
-      this.question.courseNo = this.blueStruct.courseNo;
-      this.question.coursePropertyName = this.blueStruct.coursePropertyName;
+      this.question.courseId = this.blueStruct.courseId;
+      this.question.coursePropertyId = this.blueStruct.coursePropertyId;
       this.question.quesNames = this.paperDetailStruct.quesNames.join(",");
       console.log("this.question:", this.question);
       if (publicity == 0) {

+ 17 - 28
src/modules/questions/views/InsertPaperStructure.vue

@@ -43,25 +43,24 @@
             v-model.number="paperStruct.totalScore"
             placeholder="总分"
             :precision="1"
-            :min="0.1"
+            :min="0"
           ></el-input-number>
         </el-form-item>
         <el-form-item label="制定课程">
           <el-select
-            v-model="paperStruct.courseNo"
+            v-model="paperStruct.courseId"
             filterable
             :remote-method="getCourses"
             remote
             clearable
             placeholder="请选择"
           >
-            <el-option key="ALL" label="请选择" value="ALL"></el-option>
             <el-option key="" label="公用" value=""></el-option>
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             >
             </el-option>
           </el-select>
@@ -206,7 +205,7 @@ export default {
         name: "",
         totalScore: "",
         paperDetailStructs: [],
-        courseNo: "ALL",
+        courseId: null,
         courseName: "",
         type: "EXACT", //试卷结构类型
         genPaperType: "COMMON", //组卷类型
@@ -252,8 +251,8 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
-        courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
+        var courseId = course.id;
+        courseList.push({ courseId: courseId, courseInfo: courseInfo });
       }
       return courseList;
     },
@@ -311,7 +310,7 @@ export default {
       if (!this.checkPaperStruct()) {
         return false;
       }
-      if (this.paperStruct.courseNo == "ALL") {
+      if (!this.paperStruct.courseId) {
         this.$notify({
           message: "请选择课程",
           type: "error",
@@ -323,7 +322,7 @@ export default {
       console.log(this.paperStructId);
       if (this.paperStructId != "add") {
         //假如没ID就是新增
-        this.$http
+        this.$httpWithMsg
           .put(url, this.paperStruct)
           .then(() => {
             this.$notify({
@@ -334,16 +333,11 @@ export default {
             this.removeItem();
             this.back();
           })
-          .catch(() => {
-            this.$notify({
-              type: "error",
-              message: "试卷结构名称重复,请重新命名",
-            });
-
+          .finally(() => {
             this.loading = false;
           });
       } else {
-        this.$http
+        this.$httpWithMsg
           .post(url, this.paperStruct)
           .then(() => {
             this.$notify({
@@ -354,12 +348,8 @@ export default {
             this.removeItem();
             this.back();
           })
-          .catch(() => {
+          .finally(() => {
             this.loading = false;
-            this.$notify({
-              type: "error",
-              message: "试卷结构名称重复,请重新命名",
-            });
           });
       }
     },
@@ -493,18 +483,17 @@ export default {
       }
       this.paperDetailStructDialog = true;
     },
-    getCourseName(courseNo) {
+    getCourseName(courseId) {
       for (let course of this.courseList) {
-        if (course.code == courseNo) {
+        if (course.courseId == courseId) {
           this.paperStruct.courseName = course.name;
         }
       }
     },
     //添加小题
     insertTopicStruct(row) {
-      let courseNo =
-        this.paperStruct.courseNo === "" ? "all" : this.paperStruct.courseNo;
-      this.getCourseName(this.paperStruct.courseNo);
+      let courseId = this.paperStruct.courseId;
+      this.getCourseName(this.paperStruct.courseId);
       sessionStorage.setItem("paperStruct", JSON.stringify(this.paperStruct));
       this.$router.push({
         path:
@@ -515,7 +504,7 @@ export default {
           "/" +
           row.id +
           "/" +
-          courseNo,
+          courseId,
       });
     },
     //返回

+ 6 - 6
src/modules/questions/views/InsertPaperStructureInfo.vue

@@ -28,7 +28,7 @@
           <el-input-number
             v-model="paperUnitForm.score"
             :precision="1"
-            :min="0.1"
+            :min="0"
             @change="muli"
           ></el-input-number>
         </el-form-item>
@@ -209,7 +209,7 @@
                 v-model.number="paperUnitForm2.score"
                 placeholder="请输入每题分值"
                 :precision="1"
-                :min="0.1"
+                :min="0"
                 @change="muli2"
               ></el-input-number>
             </el-form-item>
@@ -673,7 +673,7 @@ export default {
     };
     return {
       quesTypes: [],
-      courseNo: "",
+      courseId: null,
       quesNameList: [],
       paperUnitForm: {
         id: "",
@@ -776,7 +776,7 @@ export default {
     this.paperStructId = this.$route.params.id;
     this.detailName = this.$route.params.name;
     this.detailId = this.$route.params.detailId;
-    this.courseNo = this.$route.params.courseNo;
+    this.courseId = this.$route.params.courseId;
     this.searchForm();
   },
   mounted() {
@@ -790,10 +790,10 @@ export default {
       if (quesType && quesType.length > 0) {
         var quesTypeObj = {};
         var url = QUESTION_API + "/paperStruct/quesNames";
-        if (this.courseNo !== "all") {
+        if (this.courseId) {
           quesTypeObj = {
             quesType: quesType,
-            courseNo: this.courseNo,
+            courseId: this.courseId,
           };
         } else {
           quesTypeObj = {

+ 17 - 27
src/modules/questions/views/InsertPaperTitle.vue

@@ -10,7 +10,7 @@
       >
         <el-form-item label="课程名称(代码)">
           <el-select
-            v-model="paperTitleForm.courseNo"
+            v-model="paperTitleForm.courseId"
             class="dialog-input-width"
             filterable
             clearable
@@ -22,9 +22,9 @@
           >
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             >
             </el-option>
           </el-select>
@@ -130,8 +130,7 @@ export default {
   data() {
     return {
       paperTitleForm: {
-        courseNo: "",
-        courseName: "",
+        courseId: "",
         paperId: "",
         paperDetailId: "",
         value: "",
@@ -158,21 +157,15 @@ export default {
   },
   computed: {
     paperTitelDisable() {
-      if (this.paperTitleForm.courseNo) {
+      if (this.paperTitleForm.courseId) {
         return true;
       } else {
         return false;
       }
     },
     paperDetailDisable() {
-      console.log(
-        "this.paperTitleForm.courseNo:",
-        this.paperTitleForm.courseNo
-      );
-      console.log("this.paperTitleForm.paperId:", this.paperTitleForm.paperId);
-      console.log("this.detailsData.length:", this.detailsData.length);
       if (
-        this.paperTitleForm.courseNo &&
+        this.paperTitleForm.courseId &&
         this.paperTitleForm.paperId &&
         this.detailsData.length > 0
       ) {
@@ -183,7 +176,7 @@ export default {
     },
     nextDisabled() {
       if (
-        this.paperTitleForm.courseNo &&
+        this.paperTitleForm.courseId &&
         this.paperTitleForm.paperId &&
         this.paperTitleForm.paperDetailId &&
         this.paperTitleForm.value
@@ -198,8 +191,8 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
-        courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
+        var courseId = course.id;
+        courseList.push({ courseId: courseId, courseInfo: courseInfo });
       }
       return courseList;
     },
@@ -260,8 +253,8 @@ export default {
       this.$http
         .get(
           QUESTION_API +
-            "/importPaper/1/500/?courseNo=" +
-            this.paperTitleForm.courseNo
+            "/importPaper/1/500/?courseId=" +
+            this.paperTitleForm.courseId
         )
         .then((response) => {
           this.tableData = response.data.content;
@@ -298,7 +291,7 @@ export default {
       this.$refs[formData].validate((valid) => {
         if (valid) {
           for (let course of this.courseList) {
-            if (course.code == this.paperTitleForm.courseNo) {
+            if (course.courseId == this.paperTitleForm.courseId) {
               this.paperTitleForm.courseName = course.name;
             }
           }
@@ -307,7 +300,7 @@ export default {
             .post(
               QUESTION_API +
                 "/importPaper/saveBlankPaper/" +
-                this.paperTitleForm.courseNo +
+                this.paperTitleForm.courseId +
                 "/" +
                 this.paperForm.name
             )
@@ -316,8 +309,8 @@ export default {
               this.$http
                 .get(
                   QUESTION_API +
-                    "/importPaper/1/500/?courseNo=" +
-                    this.paperTitleForm.courseNo
+                    "/importPaper/1/500/?courseId=" +
+                    this.paperTitleForm.courseId
                 )
                 .then((response) => {
                   this.tableData = response.data.content;
@@ -351,11 +344,10 @@ export default {
           break;
       }
       for (let course of this.courseList) {
-        if (course.code == this.paperTitleForm.courseNo) {
+        if (course.courseId == this.paperTitleForm.courseId) {
           this.paperTitleForm.courseName = course.name;
         }
       }
-      console.log(path);
       this.$router.push({
         path:
           path +
@@ -366,9 +358,7 @@ export default {
           "/" +
           this.paperTitleForm.value +
           "/" +
-          encodeURIComponent(this.paperTitleForm.courseNo) +
-          "/" +
-          encodeURIComponent(this.paperTitleForm.courseName),
+          encodeURIComponent(this.paperTitleForm.courseId),
       });
     },
   },

+ 6 - 10
src/modules/questions/views/PaperBlue.vue

@@ -60,12 +60,12 @@ import { mapState } from "vuex";
 export default {
   props: {
     paperId: {
-      type: String,
-      default: "",
+      type: Number,
+      default: null,
     },
-    courseCode: {
-      type: String,
-      default: "",
+    courseId: {
+      type: Number,
+      default: null,
     },
   },
   data() {
@@ -131,11 +131,7 @@ export default {
 
     init() {
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(this.courseCode)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + this.courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });

+ 11 - 11
src/modules/questions/views/PaperStructure.vue

@@ -19,7 +19,7 @@
         </el-form-item>
         <el-form-item label="制定课程">
           <el-select
-            v-model="formSearch.courseNo"
+            v-model="formSearch.courseId"
             filterable
             :remote-method="getCourses"
             remote
@@ -29,9 +29,9 @@
             <el-option key label="公用" value></el-option>
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -153,7 +153,7 @@ export default {
       formSearch: {
         name: "",
         creator: "",
-        courseNo: "ALL",
+        courseId: null,
         type: "EXACT",
         courseName: "",
       },
@@ -184,8 +184,8 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
-        courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
+        var courseId = course.id;
+        courseList.push({ courseId: courseId, courseInfo: courseInfo });
       }
       return courseList;
     },
@@ -206,7 +206,7 @@ export default {
       this.formSearch = {
         name: "",
         creator: "",
-        courseNo: "ALL",
+        courseId: null,
         type: "EXACT",
       };
     },
@@ -236,15 +236,15 @@ export default {
       });
       this.selectedList = selectedList;
     },
-    getCourseName(courseNo) {
+    getCourseName(courseId) {
       for (let course of this.courseList) {
-        if (course.code == courseNo) {
+        if (course.courseId == courseId) {
           this.formSearch.courseName = course.name;
         }
       }
     },
     editPaperStruct(row) {
-      this.getCourseName(this.formSearch.courseNo);
+      this.getCourseName(this.formSearch.courseId);
       sessionStorage.setItem("paper_stucture", JSON.stringify(this.formSearch));
       sessionStorage.setItem("paper_stucture_currentPage", this.currentPage);
       sessionStorage.setItem("paperStruct", JSON.stringify(row));
@@ -362,7 +362,7 @@ export default {
         this.formSearch = {
           name: "",
           creator: "",
-          courseNo: "ALL",
+          courseId: null,
           type: "EXACT",
           courseName: "",
         };

+ 24 - 28
src/modules/questions/views/Question.vue

@@ -6,7 +6,7 @@
       <el-form class="part-filter-form" :inline="true" :model="formSearch">
         <el-form-item label="课程名称">
           <el-select
-            v-model="formSearch.courseNo"
+            v-model="formSearch.courseId"
             filterable
             :remote-method="getCourses"
             remote
@@ -17,9 +17,9 @@
           >
             <el-option
               v-for="item in courseInfoSelect"
-              :key="item.courseNo"
+              :key="item.courseId"
               :label="item.courseInfo"
-              :value="item.courseNo"
+              :value="item.courseId"
             >
             </el-option>
           </el-select>
@@ -225,11 +225,10 @@ export default {
     return {
       formSearch: {
         questionType: "",
-        courseNo: "",
+        courseId: null,
         courseLevel: "",
-        courseName: "",
         publicity: "",
-        coursePropertyName: "",
+        coursePropertyId: "",
         firstPropertyId: "",
         secondPropertyId: "",
       },
@@ -263,8 +262,8 @@ export default {
       var courseList = [];
       for (let course of this.courseList) {
         var courseInfo = course.name + "(" + course.code + ")";
-        var courseNo = course.code;
-        courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
+        var courseId = course.id;
+        courseList.push({ courseId: courseId, courseInfo: courseInfo });
       }
       return courseList;
     },
@@ -291,7 +290,7 @@ export default {
       return true;
     },
     updatePorperty() {
-      if (this.formSearch.courseNo) {
+      if (this.formSearch.courseId) {
         return false;
       }
       return true;
@@ -343,11 +342,10 @@ export default {
     resetForm() {
       this.formSearch = {
         questionType: "",
-        courseNo: "",
+        courseId: null,
         courseLevel: "",
-        courseName: "",
         publicity: "",
-        coursePropertyName: "",
+        coursePropertyId: null,
         firstPropertyId: "",
         secondPropertyId: "",
       };
@@ -393,16 +391,16 @@ export default {
       this.currentPage = 1;
       this.searchQues();
     },
-    getCourseName(courseNo) {
+    getCourseName(courseId) {
       for (let course of this.courseList) {
-        if (course.code == courseNo) {
+        if (course.courseId == courseId) {
           this.formSearch.courseName = course.name;
         }
       }
     },
     //修改
     updateRow(row) {
-      this.getCourseName(this.formSearch.courseNo);
+      this.getCourseName(this.formSearch.courseId);
       //选择题:单选、多选
       if (
         row.questionType === "SINGLE_ANSWER_QUESTION" ||
@@ -472,12 +470,12 @@ export default {
         .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
-          if (this.formSearch.courseNo) {
+          if (this.formSearch.courseId) {
             this.$http
               .get(
                 QUESTION_API +
-                  "/courseProperty/enable?courseCode=" +
-                  encodeURIComponent(this.formSearch.courseNo)
+                  "/courseProperty/enable?courseId=" +
+                  this.formSearch.courseId
               )
               .then((response) => {
                 this.coursePropertyList = response.data;
@@ -493,7 +491,7 @@ export default {
     resetSearchForm() {
       this.formSearch = {
         questionType: "",
-        courseNo: "",
+        courseId: "",
       };
     },
     /*处理选择题答案显示,处理套题下选择题答案显示*/
@@ -546,12 +544,12 @@ export default {
       this.formSearch.coursePropertyName = "";
       this.formSearch.firstPropertyId = "";
       this.formSearch.secondPropertyId = "";
-      if (this.formSearch.courseNo) {
+      if (this.formSearch.courseId) {
         this.$http
           .get(
             QUESTION_API +
-              "/courseProperty/enable?courseCode=" +
-              encodeURIComponent(this.formSearch.courseNo)
+              "/courseProperty/enable?courseId=" +
+              this.formSearch.courseId
           )
           .then((response) => {
             this.coursePropertyList = response.data;
@@ -622,11 +620,10 @@ export default {
         sessionStorage.removeItem("question_currentPage");
         this.formSearch = {
           questionType: "",
-          courseNo: "",
+          courseId: "",
           courseLevel: "",
-          courseName: "",
           publicity: "",
-          coursePropertyName: "",
+          coursePropertyId: "",
           firstPropertyId: "",
           secondPropertyId: "",
         };
@@ -642,11 +639,10 @@ export default {
       } else {
         this.formSearch = {
           questionType: "",
-          courseNo: "",
+          courseId: "",
           courseLevel: "",
-          courseName: "",
           publicity: "",
-          coursePropertyName: "",
+          coursePropertyId: "",
           firstPropertyId: "",
           secondPropertyId: "",
         };

+ 3 - 7
src/modules/questions/views/ViewPaper.vue

@@ -621,7 +621,7 @@ export default {
         .then((response) => {
           this.paper = response.data;
           //查询所有课程属性名
-          this.initCourseProperty(this.paper.course.code);
+          this.initCourseProperty(this.paper.course.id);
           //将所有小题分为公开和非公开
           if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
             for (let paperDetil of this.paper.paperDetails) {
@@ -664,13 +664,9 @@ export default {
         });
     },
     //查询所有课程属性名
-    initCourseProperty(courseCode) {
+    initCourseProperty(courseId) {
       this.$http
-        .get(
-          QUESTION_API +
-            "/courseProperty/enable?courseCode=" +
-            encodeURIComponent(+courseCode)
-        )
+        .get(QUESTION_API + "/courseProperty/enable?courseId=" + courseId)
         .then((response) => {
           this.coursePropertyList = response.data;
         });