Răsfoiți Sursa

Merge remote-tracking branch 'origin/dev_v5.0.1' into dev_v5.0.1

deason 1 an în urmă
părinte
comite
07fefe347d
27 a modificat fișierele cu 479 adăugiri și 186 ștergeri
  1. 1 1
      src/components/ckeditor.vue
  2. 3 0
      src/modules/basic/view/data_previllege.vue
  3. 5 1
      src/modules/basic/view/data_previllege_add_course.vue
  4. 5 1
      src/modules/basic/view/data_previllege_add_exam.vue
  5. 6 2
      src/modules/basic/view/data_previllege_add_org.vue
  6. 3 1
      src/modules/basic/view/user.vue
  7. 5 3
      src/modules/marking/views/MarkPaperCheck.vue
  8. 45 21
      src/modules/marking/views/MarkSettingWork.vue
  9. 59 39
      src/modules/marking/views/MarkWork.vue
  10. 8 3
      src/modules/marking/views/MarkWorkOverview.vue
  11. 5 3
      src/modules/marking/views/Marker.vue
  12. 7 4
      src/modules/marking/views/export_task_list.vue
  13. 1 1
      src/modules/oe/views/examPaperDetail.vue
  14. 2 2
      src/modules/oe/views/examScheduling.vue
  15. 2 1
      src/modules/oe/views/export_task_list.vue
  16. 1 1
      src/modules/questions/component/ckeditor.vue
  17. 3 1
      src/modules/questions/styles/Common.css
  18. 171 38
      src/modules/questions/views/AddPaperSelect.vue
  19. 3 3
      src/modules/questions/views/EditOtherQuestion.vue
  20. 4 1
      src/modules/questions/views/EditPaper.vue
  21. 1 0
      src/modules/questions/views/EditSelectQuestion.vue
  22. 63 41
      src/modules/questions/views/ExtractPaperInfo.vue
  23. 32 4
      src/modules/questions/views/ExtractPaperTemplate.vue
  24. 13 8
      src/modules/questions/views/GenPaper.vue
  25. 13 2
      src/modules/questions/views/GenPaperDetail.vue
  26. 8 3
      src/modules/questions/views/ImportPaper.vue
  27. 10 1
      src/modules/questions/views/Question.vue

+ 1 - 1
src/components/ckeditor.vue

@@ -57,7 +57,7 @@ export default {
   mounted() {
     var removePluginStr = "bidi,image";
     var removeButtonStr =
-      "Styles,Format,ShowBlocks,Iframe,PageBreak,Smiley,Flash,Language,JustifyBlock,JustifyRight,JustifyCenter,JustifyLeft,CreateDiv,CopyFormatting,ImageButton,Button,HiddenField,Select,Textarea,TextField,Radio,Checkbox,Form,BGColor,SelectAll,Replace,Find,Templates,Print,Preview,NewPage,Save,Underline,Subscript,Superscript,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,Italic,Bold,NumberedList,BulletedList,Indent,Outdent,Blockquote,About,RemoveFormat,Strike";
+      "Table,Styles,Format,ShowBlocks,Iframe,PageBreak,Smiley,Flash,Language,JustifyBlock,JustifyRight,JustifyCenter,JustifyLeft,CreateDiv,CopyFormatting,ImageButton,Button,HiddenField,Select,Textarea,TextField,Radio,Checkbox,Form,BGColor,SelectAll,Replace,Find,Templates,Print,Preview,NewPage,Save,Underline,Subscript,Superscript,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,Italic,Bold,NumberedList,BulletedList,Indent,Outdent,Blockquote,About,RemoveFormat,Strike";
     if (!this.extrabuttons || this.extrabuttons.indexOf("Font") == -1) {
       removeButtonStr = removeButtonStr + ",Font";
     }

+ 3 - 0
src/modules/basic/view/data_previllege.vue

@@ -236,16 +236,19 @@
     <DataPrevillegeAddExamDialog
       ref="addExamDialog"
       :user-id="userId"
+      :root-org-id="$route.query.rootOrgId"
       @reload="init"
     />
     <DataPrevillegeAddCourseDialog
       ref="addCourseDialog"
       :user-id="userId"
+      :root-org-id="$route.query.rootOrgId"
       @reload="init"
     />
     <DataPrevillegeAddOrgDialog
       ref="addOrgDialog"
       :user-id="userId"
+      :root-org-id="$route.query.rootOrgId"
       @reload="init"
     />
   </div>

+ 5 - 1
src/modules/basic/view/data_previllege_add_course.vue

@@ -91,6 +91,7 @@ export default {
   name: "DataPrevillegeAddCourseDialog",
   props: {
     userId: { type: String, default: "" },
+    rootOrgId: { type: String, default: "" },
   },
   data() {
     return {
@@ -111,7 +112,10 @@ export default {
   },
   methods: {
     async search() {
-      var param = new URLSearchParams(this.form);
+      var param = new URLSearchParams({
+        ...this.form,
+        rootOrgId: this.rootOrgId,
+      });
       var url =
         CORE_API +
         "/course/coursePage/" +

+ 5 - 1
src/modules/basic/view/data_previllege_add_exam.vue

@@ -91,6 +91,7 @@ export default {
   name: "DataPrevillegeAddExamDialog",
   props: {
     userId: { type: String, default: "" },
+    rootOrgId: { type: String, default: "" },
   },
   data() {
     return {
@@ -111,7 +112,10 @@ export default {
   },
   methods: {
     async search() {
-      var param = new URLSearchParams(this.form);
+      var param = new URLSearchParams({
+        ...this.form,
+        rootOrgId: this.rootOrgId,
+      });
       var url =
         EXAM_WORK_API +
         "/exam/queryPage/" +

+ 6 - 2
src/modules/basic/view/data_previllege_add_org.vue

@@ -92,12 +92,13 @@ export default {
   name: "DataPrevillegeAddOrgDialog",
   props: {
     userId: { type: String, default: "" },
+    rootOrgId: { type: String, default: "" },
   },
   data() {
     return {
       visible: false,
       form: {
-        parentId: this.$store.state.user.rootOrgId,
+        // parentId: this.$store.state.user.rootOrgId,
         name: "",
         code: "",
       },
@@ -113,7 +114,10 @@ export default {
   },
   methods: {
     async search() {
-      var param = new URLSearchParams(this.form);
+      var param = new URLSearchParams({
+        ...this.form,
+        parentId: this.rootOrgId,
+      });
       var url =
         CORE_API +
         "/org/subOrgPage/" +

+ 3 - 1
src/modules/basic/view/user.vue

@@ -477,7 +477,9 @@
                       icon="el-icon-edit"
                       @click="
                         () =>
-                          $router.push(`./user/data_previllege/${scope.row.id}`)
+                          $router.push(
+                            `./user/data_previllege/${scope.row.id}?rootOrgId=${scope.row.rootOrgId}`
+                          )
                       "
                       >数据权限
                     </el-button>

+ 5 - 3
src/modules/marking/views/MarkPaperCheck.vue

@@ -14,6 +14,8 @@
                 v-model="formSearch.workId"
                 clearable
                 filterable
+                :remote-method="getMarkWorks"
+                remote
                 class="input"
                 placeholder="请选择"
                 style="width: 150px"
@@ -466,11 +468,11 @@ export default {
         identityNumber: "",
       });
     },
-    getMarkWorks() {
+    getMarkWorks(name = "") {
       this.$http
-        .get(MARKING_LOGIC_API + "/markWorks?status=1")
+        .get(MARKING_LOGIC_API + "/markWorks?status=1" + `&name=${name}`)
         .then((response) => {
-          this.markWorkList = response.data;
+          this.markWorkList = response.data?.content || [];
           if (this.$route.query && this.$route.query.workId) {
             this.formSearch.workId = parseInt(this.$route.query.workId);
           }

+ 45 - 21
src/modules/marking/views/MarkSettingWork.vue

@@ -17,6 +17,11 @@
                 @keyup.native="searchMarkWork"
               ></el-input>
             </el-form-item>
+            <el-form-item>
+              <el-button size="small" type="primary" @click="search"
+                >查询</el-button
+              >
+            </el-form-item>
           </el-form>
           <el-table
             v-loading="loading"
@@ -111,16 +116,33 @@ export default {
     this.initMarkWork();
   },
   methods: {
+    search() {
+      this.currentPage = 1;
+      this.initMarkWork();
+    },
     initMarkWork() {
       this.loading = true;
       this.$http
-        .get(MARKING_LOGIC_API + "/markWorks?userId=" + this.user.userId)
+        .get(
+          MARKING_LOGIC_API +
+            "/markWorks?userId=" +
+            this.user.userId +
+            `&pageNumber=${this.currentPage - 1}&pageSize=${
+              this.pageSize
+            }&name=${this.formSearch.name}`
+        )
         .then((response) => {
-          this.totalTableData = response.data;
-          this.total = response.data.length;
-          this.filterMarkWork();
-          this.paging();
+          this.tableData = response.data?.content || [];
+          // this.total = response.data.length;
+          this.total = response.data?.totalElements;
+          // this.filterMarkWork();
+          // this.paging();
           this.loading = false;
+          // this.totalTableData = response.data;
+          // this.total = response.data.length;
+          // this.filterMarkWork();
+          // this.paging();
+          // this.loading = false;
         });
     },
     searchMarkWork() {
@@ -140,29 +162,31 @@ export default {
     },
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.filterMarkWork();
-      this.paging();
+      this.initMarkWork();
+      // this.filterMarkWork();
+      // this.paging();
       //this.searchMarkWork()
     },
     handleSizeChange(val) {
       this.pageSize = val;
-      this.filterMarkWork();
-      this.paging();
+      this.initMarkWork();
+      // this.filterMarkWork();
+      // this.paging();
       //this.searchMarkWork()
     },
     paging() {
-      var start = (this.currentPage - 1) * this.pageSize;
-      var end =
-        this.currentPage * this.pageSize < this.total
-          ? this.currentPage * this.pageSize
-          : this.total;
-      var tempData = [];
-      console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
-      for (let i = start; i < end; i++) {
-        tempData.push(this.tableData[i]);
-      }
-      console.log(tempData);
-      this.tableData = tempData;
+      // var start = (this.currentPage - 1) * this.pageSize;
+      // var end =
+      //   this.currentPage * this.pageSize < this.total
+      //     ? this.currentPage * this.pageSize
+      //     : this.total;
+      // var tempData = [];
+      // console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
+      // for (let i = start; i < end; i++) {
+      //   tempData.push(this.tableData[i]);
+      // }
+      // console.log(tempData);
+      // this.tableData = tempData;
     },
     marking(row) {
       var userId = this.user.userId;

+ 59 - 39
src/modules/marking/views/MarkWork.vue

@@ -14,19 +14,19 @@
               <el-input
                 v-model="formSearch.name"
                 placeholder="评卷工作名称"
-                @keyup.native="searchMarkWork"
               ></el-input>
             </el-form-item>
             <el-form-item>
-              <span>
-                <el-button
-                  size="small"
-                  type="primary"
-                  icon="el-icon-plus"
-                  @click="addMarkWorkModal"
-                  >新增</el-button
-                >
-              </span>
+              <el-button size="small" type="primary" @click="search"
+                >查询</el-button
+              >
+              <el-button
+                size="small"
+                type="primary"
+                icon="el-icon-plus"
+                @click="addMarkWorkModal"
+                >新增</el-button
+              >
             </el-form-item>
           </el-form>
           <div class="block-seperator"></div>
@@ -182,6 +182,7 @@
           </div>
 
           <el-dialog
+            v-if="markWorkDialog"
             v-loading="loading"
             :title="examTitle"
             element-loading-text="拼命加载中"
@@ -335,11 +336,13 @@ export default {
     ...mapState({ user: (state) => state.user }),
   },
   watch: {
-    "formMarkWork.examType"() {
-      this.formMarkWork.callType = "WHOLE_SET";
+    "formMarkWork.examType"(val) {
+      if (val !== "ONLINE") {
+        this.formMarkWork.callType = "WHOLE_SET";
+      }
     },
     "formMarkWork.callType"() {
-      if (this.formMarkWork.examType) {
+      if (this.formMarkWork.examType && !this.markWorkId) {
         this.examTypeChange();
       }
     },
@@ -439,19 +442,32 @@ export default {
           //this.loading = false;
         });
     },
+    search() {
+      this.currentPage = 1;
+      this.initMarkWorkData();
+    },
     initMarkWorkData() {
       var orgId = this.user.rootOrgId;
       this.loading = true;
       this.$http
-        .get(MARKING_LOGIC_API + "/markWorks?orgId=" + orgId)
+        .get(
+          MARKING_LOGIC_API +
+            "/markWorks?orgId=" +
+            orgId +
+            `&pageNumber=${this.currentPage - 1}&pageSize=${
+              this.pageSize
+            }&name=${this.formSearch.name}`
+        )
         .then((response) => {
           console.log(response);
-          this.totalTableData = response.data;
-          this.total = response.data.length;
-          this.filterMarkWork();
-          this.paging();
+          // this.totalTableData = response.data;
+          this.tableData = response.data?.content || [];
+          // this.total = response.data.length;
+          this.total = response.data?.totalElements;
+          // this.filterMarkWork();
+          // this.paging();
           this.loading = false;
-          this.getWorkStatus();
+          // this.getWorkStatus();
         });
     },
     getWorkStatus() {
@@ -502,17 +518,17 @@ export default {
       this.total = tempData.length;
     },
     paging() {
-      var start = (this.currentPage - 1) * this.pageSize;
-      var end =
-        this.currentPage * this.pageSize < this.total
-          ? this.currentPage * this.pageSize
-          : this.total;
-      var tempData = [];
-      console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
-      for (let i = start; i < end; i++) {
-        tempData.push(this.tableData[i]);
-      }
-      this.tableData = tempData;
+      // var start = (this.currentPage - 1) * this.pageSize;
+      // var end =
+      //   this.currentPage * this.pageSize < this.total
+      //     ? this.currentPage * this.pageSize
+      //     : this.total;
+      // var tempData = [];
+      // console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
+      // for (let i = start; i < end; i++) {
+      //   tempData.push(this.tableData[i]);
+      // }
+      // this.tableData = tempData;
     },
     openModal() {
       console.log("open");
@@ -749,11 +765,13 @@ export default {
     resetForm() {
       if (this.markWorkId) {
         //编辑
-        this.formMarkWork = Object.assign(this.formMarkWork, {
-          remark: "",
-          name: "",
-          callType: "WHOLE_SET",
-        });
+        // this.formMarkWork = Object.assign(this.formMarkWork, {
+        //   remark: "",
+        //   name: "",
+        //   callType: "WHOLE_SET",
+        // });
+        this.formMarkWork.name = "";
+        this.formMarkWork.remark = "";
         this.$refs["formMarkWork"].clearValidate();
       } else {
         //新增
@@ -768,14 +786,16 @@ export default {
     },
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.filterMarkWork();
-      this.paging();
+      this.initMarkWorkData();
+      // this.filterMarkWork();
+      // this.paging();
       //this.searchMarkWork()
     },
     handleSizeChange(val) {
       this.pageSize = val;
-      this.filterMarkWork();
-      this.paging();
+      this.initMarkWorkData();
+      // this.filterMarkWork();
+      // this.paging();
     },
   },
 };

+ 8 - 3
src/modules/marking/views/MarkWorkOverview.vue

@@ -14,6 +14,8 @@
                 v-model="markWorkSearchForm.markId"
                 clearable
                 filterable
+                :remote-method="getMarkWorks"
+                remote
                 class="input"
                 placeholder="请选择"
                 @change="searchMarkWork"
@@ -431,16 +433,19 @@ export default {
       this.tableData = [];
       this.total = 0;
     },
-    getMarkWorks() {
+    getMarkWorks(name = "") {
       this.$http
-        .get(MARKING_LOGIC_API + "/markWorks?status=1")
+        .get(MARKING_LOGIC_API + "/markWorks?status=1" + `&name=${name}`)
         .then((response) => {
-          this.markWorkList = response.data;
+          this.markWorkList = response.data?.content || [];
           if (this.$route.query && this.$route.query.markId) {
             this.markWorkSearchForm.markId = parseInt(this.$route.query.markId);
           }
         });
     },
+    getMarkWorksByName(name) {
+      this.getMarkWorks(name);
+    },
     getCourses() {
       this.$http
         .get(

+ 5 - 3
src/modules/marking/views/Marker.vue

@@ -14,6 +14,8 @@
                 v-model="formSearch.workId"
                 clearable
                 filterable
+                :remote-method="getMarkWorks"
+                remote
                 class="input"
                 placeholder="请选择"
                 @clear="clearData"
@@ -284,11 +286,11 @@ export default {
       });
     },
     //获取创建成功的markWork列表
-    getMarkWorks() {
+    getMarkWorks(name = "") {
       this.$http
-        .get(MARKING_LOGIC_API + "/markWorks?status=1")
+        .get(MARKING_LOGIC_API + "/markWorks?status=1" + `&name=${name}`)
         .then((response) => {
-          this.markWorkList = response.data;
+          this.markWorkList = response.data?.content || [];
           if (this.$route.query && this.$route.query.workId) {
             this.formSearch.workId = parseInt(this.$route.query.workId);
           }

+ 7 - 4
src/modules/marking/views/export_task_list.vue

@@ -10,6 +10,8 @@
           v-model="formSearch.workId"
           clearable
           filterable
+          :remote-method="getMarkWorks"
+          remote
           class="input"
           placeholder="请选择"
           size="small"
@@ -186,11 +188,11 @@ export default {
     this.getMarkWorks();
   },
   methods: {
-    getMarkWorks() {
+    getMarkWorks(name = "") {
       this.$http
-        .get(MARKING_LOGIC_API + "/markWorks?status=1")
+        .get(MARKING_LOGIC_API + "/markWorks?status=1" + `&name=${name}`)
         .then((response) => {
-          this.markWorkList = response.data;
+          this.markWorkList = response.data?.content || [];
           if (this.$route.query && this.$route.query.workId) {
             this.formSearch.workId = parseInt(this.$route.query.workId);
           }
@@ -258,7 +260,8 @@ export default {
       this.formSearch.status = null;
     },
     resetSearchForm() {
-      this.formSearch.examId = "";
+      // this.formSearch.examId = "";
+      this.formSearch.workId = "";
       this.formSearch.type = null;
       this.formSearch.status = null;
       this.doSearch(1);

+ 1 - 1
src/modules/oe/views/examPaperDetail.vue

@@ -5,7 +5,7 @@
       <table id="studentInfoTable" border>
         <thead>
           <tr>
-            <th>考试ID</th>
+            <th>考试记录ID</th>
             <th>学号</th>
             <th>姓名</th>
             <th>课程</th>

+ 2 - 2
src/modules/oe/views/examScheduling.vue

@@ -126,7 +126,7 @@
             <el-table-column
               label="学习中心"
               prop="orgName"
-              width="120"
+              min-width="120"
             ></el-table-column>
             <el-table-column
               label="课程"
@@ -171,7 +171,7 @@
             <el-table-column
               label="专业"
               prop="specialtyName"
-              width="90"
+              min-width="90"
             ></el-table-column>
 
             <el-table-column

+ 2 - 1
src/modules/oe/views/export_task_list.vue

@@ -36,8 +36,9 @@
           @clear="clearTypeValue"
         >
           <el-option label="考试明细" value="EXAM_DETAIL"></el-option>
-          <el-option label="成绩统计" value="SCORE_STATISTIC"></el-option>
+          <el-option label="成绩明细" value="SCORE_STATISTIC"></el-option>
           <el-option label="考试进度" value="EXAM_SCHEDULING"></el-option>
+          <el-option label="监考已审" value="AUDIT"></el-option>
         </el-select>
       </el-form-item>
 

+ 1 - 1
src/modules/questions/component/ckeditor.vue

@@ -82,7 +82,7 @@ export default {
       ],
       removePlugins: "bidi,colorbutton,image",
       removeButtons:
-        "Font,FontSize,Styles,Format,ShowBlocks,Iframe,PageBreak,Smiley,Flash,Language,JustifyBlock,JustifyRight,JustifyCenter,JustifyLeft,CreateDiv,CopyFormatting,ImageButton,Button,HiddenField,Select,Textarea,TextField,Radio,Checkbox,Form,BGColor,SelectAll,Replace,Find,Templates,Print,Preview,NewPage,Save,Subscript,Superscript,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,NumberedList,BulletedList,Indent,Outdent,Blockquote,About,RemoveFormat,Strike",
+        "Table,Font,FontSize,Styles,Format,ShowBlocks,Iframe,PageBreak,Smiley,Flash,Language,JustifyBlock,JustifyRight,JustifyCenter,JustifyLeft,CreateDiv,CopyFormatting,ImageButton,Button,HiddenField,Select,Textarea,TextField,Radio,Checkbox,Form,BGColor,SelectAll,Replace,Find,Templates,Print,Preview,NewPage,Save,Subscript,Superscript,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,NumberedList,BulletedList,Indent,Outdent,Blockquote,About,RemoveFormat,Strike",
     };
     if (this.display !== "inline") {
       window.CKEDITOR.replace(this.id, config);

+ 3 - 1
src/modules/questions/styles/Common.css

@@ -6,7 +6,9 @@
 .search_width_80px {
   width: 80px;
 }
-
+.search_width_130px {
+  width: 130px;
+}
 .form_width {
   width: 200px;
 }

+ 171 - 38
src/modules/questions/views/AddPaperSelect.vue

@@ -51,7 +51,7 @@
             </el-select>
             <p style="display: inline-block; margin-left: 40px">
               难度:<span style="color: #409eff; font-weight: bold">{{
-                curStruct?.difficulty
+                difficultyDegree
               }}</span>
             </p>
           </el-form-item>
@@ -94,7 +94,7 @@
                   <el-option label="卷库来源" value="GENERATE"></el-option>
                 </el-select>
                 <span
-                  v-if="checked && !multipleSelection.length"
+                  v-if="checked && !tempPapers.length"
                   class="red"
                   style="font-size: 12px; font-weight: bold; margin-left: 10px"
                   >请选择数据</span
@@ -102,6 +102,7 @@
               </el-form-item>
               <el-table
                 ref="table2"
+                v-loading="tableLoading2"
                 :data="tableData2"
                 border
                 @selection-change="handleSelectionChange"
@@ -121,6 +122,46 @@
                 >
                 </el-table-column>
               </el-table>
+              <div class="page pull-right">
+                <el-pagination
+                  :current-page="curSelect"
+                  :page-size="pageSize"
+                  layout="total, prev, pager, next, jumper"
+                  :total="totalSelect"
+                  @current-change="selectCurrentChange"
+                >
+                </el-pagination>
+              </div>
+              <div style="clear: both; margin-top: 5px"></div>
+
+              <el-form
+                :inline="true"
+                label-position="right"
+                label-width="100px"
+              >
+                <el-form-item label="选中列表" class="form-item"></el-form-item>
+              </el-form>
+              <el-table :data="tempPapers" border>
+                <el-table-column label="名称" width="200">
+                  <template slot-scope="scope">
+                    <div>
+                      <span>{{ scope.row.name }}</span>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                    <div>
+                      <el-button
+                        type="danger"
+                        size="mini"
+                        @click="removeSelected(scope.row.id)"
+                        >移除</el-button
+                      >
+                    </div>
+                  </template>
+                </el-table-column>
+              </el-table>
             </div>
             <div style="width: 60%; padding-left: 20px">
               <div style="color: #606266; font-size: 14px; line-height: 32px">
@@ -186,6 +227,7 @@
 </template>
 <script>
 import qs from "qs";
+import { cloneDeep } from "lodash";
 import { mapState } from "vuex";
 import { QUESTION_API } from "@/constants/constants";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
@@ -194,9 +236,14 @@ export default {
   components: { LinkTitlesCustom },
   data() {
     return {
+      tempPapers: [],
+      tempPaperIds: [],
+      curSelect: 1,
+      totalSelect: 10,
+      pageSize: 10,
       hasError: false,
       form: {
-        paperStructType: "BLUEPRINT",
+        paperStructType: "EXACT",
         name: "",
         paperStructId: "",
         paperType: "IMPORT",
@@ -205,6 +252,7 @@ export default {
       paperIdsArr: [],
       options1: [],
       tableData1: [],
+      difficultyDegree: "",
       tableColumns1: [
         { label: "题型", prop: "detailName", minWidth: "100" },
         { label: "总分", prop: "totalScore", minWidth: "80" },
@@ -230,8 +278,10 @@ export default {
       lastRequestKey: "",
       tableLoading3: false,
       tableLoading1: false,
+      tableLoading2: false,
       checked: false,
       initSelectedRows: [],
+      isEditInitPage: false,
     };
   },
   computed: {
@@ -259,6 +309,7 @@ export default {
   watch: {
     "form.paperStructId"() {
       this.structChange();
+      this.changePaperType(true);
     },
     // "form.paperStructType"() {
     //   this.form.paperStructId = "";
@@ -274,14 +325,19 @@ export default {
     let res = await this.getTplData();
     if (res) {
       this.getStruct();
-      this.getTable2(true);
+      // this.getTable2(true);
     }
   },
   methods: {
+    selectCurrentChange(val) {
+      this.curSelect = val;
+      this.getTable2();
+    },
     paperStructTypeChange() {
       this.form.paperStructId = "";
       this.getStruct();
       this.tableData1 = [];
+      this.difficultyDegree = "";
       this.$refs.table2.clearSelection();
     },
     async getTplData() {
@@ -298,10 +354,14 @@ export default {
             }
           );
           const tplData = data.data;
-          this.paperIdsArr = tplData.paperIds || [];
+          this.tempPaperIds = tplData.paperIds || [];
+          this.tempPapers = tplData.papers || [];
+          this.isEditInitPage = true;
           Object.assign(this.form, tplData || {}, {
             paperIds: (tplData.paperIds || []).join(","),
           });
+          this.getTable2();
+          this.getTable3();
           return true;
         } catch (e) {
           return false;
@@ -311,21 +371,23 @@ export default {
       }
     },
     back() {
-      if (this.$route.params?.id) {
-        this.$router.push("/questions/extract_paper_template");
-      } else {
-        this.$router.push("/questions/gen_paper/0");
-      }
+      // if (this.$route.params?.id) {
+      this.$router.push("/questions/extract_paper_template");
+      // } else {
+      //   this.$router.push("/questions/gen_paper/0");
+      // }
     },
     save() {
       this.checked = true;
+      let paperIds = this.tempPaperIds.join(",");
       this.$refs.form.validate((valid) => {
         if (valid) {
-          if (this.multipleSelection.length && !this.hasError) {
+          if (this.tempPaperIds.length && !this.hasError) {
             let params = {
               courseId: this.$route.query.courseId,
               ...this.form,
               rootOrgId: this.user.rootOrgId,
+              paperIds,
             };
             if (this.$route.params.id) {
               params.id = this.$route.params.id;
@@ -334,7 +396,17 @@ export default {
               .post("/api/ecs_ques/randompaper/save", qs.stringify(params))
               .then(() => {
                 this.$message.success("保存成功");
-                this.$router.back();
+                // this.$router.back();
+                this.$router.push("/questions/extract_paper_template");
+              })
+              .catch((err) => {
+                if (
+                  err.response &&
+                  err.response.data &&
+                  err.response.data.desc
+                ) {
+                  this.$message.error(err.response.data.desc);
+                }
               });
           }
         } else {
@@ -358,6 +430,7 @@ export default {
         })
         .then((res) => {
           this.tableData1 = res.data.structQuestionInfo || [];
+          this.difficultyDegree = res.data.difficultyDegree;
           this.tableLoading1 = false;
         });
     },
@@ -375,39 +448,92 @@ export default {
         this.loading = false;
       });
     },
-    getTable2(bool) {
+    getTable2() {
+      this.tableLoading2 = true;
       let apiUrl =
         this.form.paperType === "IMPORT"
-          ? "/api/ecs_ques/importPaper/huoge/1/10000"
-          : "/api/ecs_ques/genPaper/huoge/1/10000";
+          ? "/api/ecs_ques/importPaper/huoge"
+          : "/api/ecs_ques/genPaper/huoge";
       this.$http
-        .get(apiUrl, {
-          params: { courseNo: this.$route.query.courseNo, ids: "" },
-        })
+        .get(
+          apiUrl +
+            `/${this.curSelect}/${this.pageSize}?courseNo=${this.$route.query.courseNo}&ids=${this.tempPaperIds}`,
+          {
+            // params: {
+            //   courseNo: this.$route.query.courseNo,
+            //   ids: this.tempPaperIds,
+            // },
+          }
+        )
         .then((res) => {
           this.tableData2 = res.data.content || [];
-          if (bool) {
-            this.tableData2.forEach((item) => {
-              if (this.paperIdsArr.includes(item.id)) {
-                this.initSelectedRows.push(item);
-              }
-            });
-            setTimeout(() => {
-              this.initSelectedRows.forEach((item) => {
-                this.$refs.table2.toggleRowSelection(item, true);
-              });
-            }, 0);
-          }
+          this.totalSelect = res.data.totalElements;
+          // this.curSelect = res.data.number + 1;
+          // if (bool) {
+          //   this.tableData2.forEach((item) => {
+          //     if (this.paperIdsArr.includes(item.id)) {
+          //       this.initSelectedRows.push(item);
+          //     }
+          //   });
+          //   setTimeout(() => {
+          //     this.initSelectedRows.forEach((item) => {
+          //       this.$refs.table2.toggleRowSelection(item, true);
+          //     });
+          //   }, 0);
+          // }
+          this.tableLoading2 = false;
         });
     },
-    changePaperType() {
-      this.tableData2 = [];
-      this.multipleSelection = [];
+    removeSelected(id) {
+      for (let [index, paper] of this.tempPapers.entries()) {
+        if (id == paper.id) {
+          this.tempPapers.splice(index, 1);
+          this.tableData2.push(paper);
+          break;
+        }
+      }
+      for (var i = 0; i < this.tempPaperIds.length; i++) {
+        if (this.tempPaperIds[i] == id) {
+          this.tempPaperIds.splice(i, 1);
+          break;
+        }
+      }
       this.getTable2();
+      this.getTable3();
+    },
+    changePaperType() {
+      console.log("changePaperType");
+      if (!this.isEditInitPage) {
+        this.tempPapers = [];
+        this.tempPaperIds = [];
+        this.tableData2 = [];
+        this.tableData3 = [];
+        this.multipleSelection = [];
+        this.curSelect = 1;
+        this.getTable2();
+      } else {
+        this.isEditInitPage = false;
+      }
+
+      // if (bool === true) {
+      //   // this.handleSelectionChange([]);
+      //   this.tempPapers = [];
+      //   this.tempPaperIds = [];
+      //   // this.$refs.table2.clearSelection();
+      //   this.getTable3();
+      // } else {
+      //   this.tableData2 = [];
+      //   this.tempPapers = [];
+      //   this.tempPaperIds = [];
+      //   this.multipleSelection = [];
+      //   this.curSelect = 1;
+      //   this.getTable2();
+      // }
     },
     getTable3() {
-      let paperIds = this.multipleSelection.map((item) => item.id);
-      if (!paperIds.length) {
+      // let paperIds = this.multipleSelection.map((item) => item.id);
+      // if (!paperIds.length) {
+      if (!this.tempPaperIds.length) {
         this.tableData3 = [];
         this.tableLoading3 = false;
         return false;
@@ -419,7 +545,7 @@ export default {
         .post(
           "/api/ecs_ques/randompaper/struct/question/view/info",
           qs.stringify({
-            paperIds: paperIds.join(","),
+            paperIds: this.tempPaperIds.join(","),
             structId: this.form.paperStructId,
           }),
           {
@@ -435,8 +561,15 @@ export default {
         });
     },
     handleSelectionChange(val) {
-      this.multipleSelection = val;
-      this.getTable3();
+      // this.multipleSelection = val;
+      if (val.length) {
+        val.forEach((element) => {
+          this.tempPapers.push(cloneDeep(element));
+          this.tempPaperIds.push(element.id);
+        });
+        this.getTable2();
+        this.getTable3();
+      }
     },
     hasNumError(row) {
       return (

+ 3 - 3
src/modules/questions/views/EditOtherQuestion.vue

@@ -348,15 +348,15 @@ export default {
           if (this.questionId) {
             this.fullscreenLoading = true;
             //修改逻辑
-            this.$http
+            this.$httpWithMsg
               .put(QUESTION_API + "/question", this.quesModel)
               .then(() => {
                 this.$notify({
                   message: "保存成功",
                   type: "success",
                 });
-                this.fullscreenLoading = false;
-              });
+              })
+              .finally(() => (this.fullscreenLoading = false));
           } else {
             //新增逻辑
             this.quesModel.courseNo = this.courseNo;

+ 4 - 1
src/modules/questions/views/EditPaper.vue

@@ -1921,7 +1921,10 @@ export default {
         type: "warning",
       }).then(() => {
         this.loading = true;
-        this.$http.delete(QUESTION_API + "/paper/" + id).then(
+        let param = new URLSearchParams({
+          paperIds: id,
+        });
+        this.$http.post(QUESTION_API + "/paper", param).then(
           () => {
             this.$notify({
               message: "删除成功",

+ 1 - 0
src/modules/questions/views/EditSelectQuestion.vue

@@ -372,6 +372,7 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.setRightAnswer();
+          this.quesModel.quesAnswer = this.answer;
           if (this.questionId) {
             this.editQuestion();
           } else {

+ 63 - 41
src/modules/questions/views/ExtractPaperInfo.vue

@@ -299,7 +299,7 @@
                     class="label"
                   >
                     难度:<span style="color: #409eff; font-weight: bold">{{
-                      curStructInfo.difficulty
+                      randomTplInfo.difficultyDegree
                     }}</span>
                   </p>
                 </el-form-item>
@@ -382,7 +382,7 @@ export default {
       },
       extractConfig2: {
         randomPaperId: "", //抽题模板id
-        playTime: 1,
+        playTime: 2,
       },
       curId: "",
       randomTplInfo: {
@@ -398,6 +398,7 @@ export default {
           { label: "中", prop: "mediumInfo", minWidth: "80" },
           { label: "易", prop: "easyInfo", minWidth: "80" },
         ],
+        difficultyDegree: "",
       },
       curStructInfo: {
         difficulty: "",
@@ -425,6 +426,7 @@ export default {
       courseAll: [],
       isInsert: false,
       tplList: [],
+      curCourseId: "",
     };
   },
   computed: {
@@ -453,8 +455,47 @@ export default {
         this.getCurCallType();
       }
     },
-    "extractConfig2.randomPaperId"(val) {
-      let item = this.tplList.find((v) => v.id == val);
+    "extractConfig2.randomPaperId"() {
+      this.getData();
+    },
+    "extractConfig.courseCode"(val) {
+      if (!val) {
+        this.extractConfig2.randomPaperId = "";
+      }
+      let id = "";
+      for (let course of this.courseList) {
+        if (course.courseCode == val) {
+          id = course.courseId;
+          break;
+        }
+      }
+      this.getTplList("", id);
+    },
+  },
+  //初始化
+  async created() {
+    let extractConfigId = this.$route.params.extractConfigId;
+    //1.查询考试集合
+    this.getExams("");
+    if (extractConfigId) {
+      this.isInsert = true;
+      //规则ID存在,表示是修改操作
+      this.getExtractConfig(extractConfigId);
+    }
+  },
+  methods: {
+    getData() {
+      if (!this.tplList.length || !this.extractConfig2.randomPaperId) {
+        this.randomTplInfo.paperStructOptions = [];
+        this.randomTplInfo.paperStructType = "";
+        this.randomTplInfo.paperIds = [];
+        this.randomTplInfo.tableData = [];
+        this.randomTplInfo.difficultyDegree = "";
+        return;
+      }
+      let item = this.tplList.find(
+        (v) => v.id == this.extractConfig2.randomPaperId
+      );
       this.randomTplInfo.paperStructType = item ? item.paperStructType : "";
 
       let apiUrl = "/api/ecs_ques/paperStruct/1/10000";
@@ -477,20 +518,6 @@ export default {
           this.curStructInfo.difficulty = structItem
             ? structItem.difficulty
             : "";
-
-          // this.$http
-          //   .post(
-          //     "/api/ecs_ques/randompaper/struct/question/view/info",
-          //     qs.stringify({
-          //       paperIds: this.randomTplInfo.paperIds.join(","),
-          //       structId: this.curStructInfo.paperStructId,
-          //     }),
-          //     {
-          //       headers: {
-          //         "content-type": "application/x-www-form-urlencoded",
-          //       },
-          //     }
-          //   )
           this.$http
             .post("/api/ecs_ques/randompaper/struct/question/info", null, {
               params: { structId: this.curStructInfo.paperStructId },
@@ -498,42 +525,34 @@ export default {
             })
             .then((res) => {
               this.randomTplInfo.tableData = res.data.structQuestionInfo || [];
+              this.randomTplInfo.difficultyDegree = res.data.difficultyDegree;
             });
         });
       }
     },
-  },
-  //初始化
-  async created() {
-    await this.getTplList();
-    let extractConfigId = this.$route.params.extractConfigId;
-    //1.查询考试集合
-    this.getExams("");
-    if (extractConfigId) {
-      this.isInsert = true;
-      //规则ID存在,表示是修改操作
-      this.getExtractConfig(extractConfigId);
-    }
-  },
-  methods: {
-    async getTplList() {
-      let courseId = this.$route.query.courseId;
+    async getTplList(id, cId) {
+      let courseId = cId || this.$route.query.courseId;
+      let params = {
+        pageNumber: 1,
+        pageSize: 10000,
+        enable: true,
+        courseId,
+      };
+      !!id && (params.id = id);
       try {
         let res = await this.$http.post(
           QUESTION_API + "/randompaper/page",
           null,
           {
-            params: {
-              pageNumber: 1,
-              pageSize: 10000,
-              enable: true,
-              courseId,
-            },
+            params,
           }
         );
         this.tplList = res.data.content || [];
+        this.getData();
       } catch (e) {
-        this.$message.error("获取抽题模板失败");
+        // this.$message.error("获取抽题模板失败");
+        this.tplList = [];
+        this.getData();
       }
     },
     getCurCallType() {
@@ -605,6 +624,7 @@ export default {
         for (let course of this.courseList) {
           if (this.extractConfig.courseCode == course.courseCode) {
             id = course.courseId;
+            this.curCourseId = id;
             break;
           }
         }
@@ -1030,6 +1050,8 @@ export default {
           this.extractConfig2.playTime = response.data.playTime || "";
           this.curId = response.data.curId || "";
 
+          this.getTplList(response.data.randomPaperId || "");
+
           //查询该考试下的课程
           this.$http
             .get(

+ 32 - 4
src/modules/questions/views/ExtractPaperTemplate.vue

@@ -7,11 +7,15 @@
           clearable
           placeholder="请选择课程"
           size="small"
+          filterable
+          :remote-method="getAllCourses"
+          remote
+          @focus="(e) => getAllCourses(e.target.value)"
         >
           <el-option
             v-for="item in allCourseList"
             :key="item.id"
-            :label="item.name"
+            :label="`${item.name}(${item.code})`"
             :value="item.id"
           ></el-option>
         </el-select>
@@ -36,6 +40,9 @@
         </el-select>
       </el-form-item>
       <el-button type="primary" @click="search(1)">查询</el-button>
+      <el-button type="primary" @click="toAddPaperSelect"
+        ><i class="el-icon-plus"></i>随机抽卷模板</el-button
+      >
     </el-form>
 
     <el-table :data="tableData" style="margin-top: 20px">
@@ -114,7 +121,7 @@ export default {
     };
   },
   created() {
-    this.getAllCourses();
+    this.getAllCourses("");
     this.search();
   },
   methods: {
@@ -145,12 +152,15 @@ export default {
         `/questions/add_paper_select/${row.id}?courseNo=${row.courseCode}&courseName=${row.courseName}&courseId=${row.courseId}`
       );
     },
-    getAllCourses() {
+    getAllCourses(query) {
+      if (query) {
+        query = query.trim();
+      }
       this.$http
         .get("/api/ecs_core/course/query", {
           params: {
             enable: true,
-            query: "",
+            name: query,
           },
         })
         .then((response) => {
@@ -179,6 +189,24 @@ export default {
           this.total = res.data.totalElements;
         });
     },
+    toAddPaperSelect() {
+      var courseId = this.searchParams.courseId;
+      if (!courseId) {
+        this.$notify({
+          title: "警告",
+          message: "请选择课程",
+          type: "warning",
+        });
+        return false;
+      }
+      let course = this.allCourseList.find((item) => item.id == courseId);
+      let courseName = course.name;
+      let courseNo = course.code;
+      this.$router.push({
+        path: "/questions/add_paper_select",
+        query: { courseNo, courseName, courseId },
+      });
+    },
   },
 };
 </script>

+ 13 - 8
src/modules/questions/views/GenPaper.vue

@@ -127,13 +127,13 @@
             </div>
           </el-col>
         </el-row>
-        <el-row>
+        <!-- <el-row>
           <el-col :span="12">
             <el-button size="small" type="primary" @click="toAddPaperSelect(0)"
               ><i class="el-icon-plus"></i>随机抽卷模板</el-button
             >
           </el-col>
-        </el-row>
+        </el-row> -->
         <div
           style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0"
         ></div>
@@ -379,10 +379,10 @@
               <el-checkbox-group v-model="exportModel.exportContentList">
                 <el-checkbox label="PAPER">试卷</el-checkbox>
                 <el-checkbox label="ANSWER">答案</el-checkbox>
-                <el-checkbox label="COMPUTERTEST_PACKAGE"
+                <!-- <el-checkbox label="COMPUTERTEST_PACKAGE"
                   >机考数据包</el-checkbox
-                >
-                <el-checkbox label="THEMIS_PACKAGE">在线考试数据包</el-checkbox>
+                > -->
+                <el-checkbox label="THEMIS_PACKAGE">数据包</el-checkbox>
                 <!-- <el-checkbox
                   v-if="isShowPrintExamPackage"
                   label="PRINT_EXAM_PACKAGE"
@@ -864,7 +864,10 @@ export default {
         type: "warning",
       }).then(() => {
         this.loading = true;
-        this.$http.delete(QUESTION_API + "/paper/" + row.id).then(
+        let param = new URLSearchParams({
+          paperIds: row.id,
+        });
+        this.$http.post(QUESTION_API + "/paper", param).then(
           () => {
             this.$notify({
               message: "删除成功",
@@ -946,13 +949,15 @@ export default {
       });
     },
     batchDeleteGenPaper() {
-      var paperIds = this.paperIds;
       if (this.selectedPaperIds.length != 0) {
         this.$confirm("确认删除试卷吗?", "提示", {
           type: "warning",
         }).then(() => {
           this.loading = true;
-          this.$http.delete(QUESTION_API + "/paper/" + paperIds).then(
+          let param = new URLSearchParams({
+            paperIds: this.paperIds,
+          });
+          this.$http.post(QUESTION_API + "/paper", param).then(
             () => {
               this.$notify({
                 message: "删除成功",

+ 13 - 2
src/modules/questions/views/GenPaperDetail.vue

@@ -871,6 +871,13 @@ export default {
     },
     searchPaper() {
       this.loading = true;
+      let fillCount = false;
+      if (this.genType == "SIMPLE") {
+        fillCount = true;
+      } else {
+        fillCount = false;
+      }
+
       if (this.paperType == "IMPORT") {
         this.$http
           .get(
@@ -882,7 +889,9 @@ export default {
               "?courseNo=" +
               this.genPaper.courseNo +
               "&ids=" +
-              this.tempPaperIds
+              this.tempPaperIds +
+              "&fillCount=" +
+              fillCount
           )
           .then((response) => {
             console.log("response:", response);
@@ -902,7 +911,9 @@ export default {
               "?courseNo=" +
               this.genPaper.courseNo +
               "&ids=" +
-              this.tempPaperIds
+              this.tempPaperIds +
+              "&fillCount=" +
+              fillCount
           )
           .then((response) => {
             this.selectPapers = response.data.content;

+ 8 - 3
src/modules/questions/views/ImportPaper.vue

@@ -535,7 +535,10 @@ export default {
         type: "warning",
       }).then(() => {
         this.loading = true;
-        this.$http.delete(QUESTION_API + "/paper/" + row.id).then(
+        let param = new URLSearchParams({
+          paperIds: row.id,
+        });
+        this.$http.post(QUESTION_API + "/paper", param).then(
           () => {
             this.$notify({
               message: "删除成功",
@@ -560,12 +563,14 @@ export default {
       });
     },
     batchDeletePaper() {
-      var paperIds = this.paperIds;
       this.$confirm("确认删除试卷吗?", "提示", {
         type: "warning",
       }).then(() => {
         this.loading = true;
-        this.$http.delete(QUESTION_API + "/paper/" + paperIds).then(
+        let param = new URLSearchParams({
+          paperIds: this.paperIds,
+        });
+        this.$http.post(QUESTION_API + "/paper", param).then(
           () => {
             this.$notify({
               message: "删除成功",

+ 10 - 1
src/modules/questions/views/Question.vue

@@ -457,6 +457,13 @@ export default {
       this.searchQues();
     },
     searchQues() {
+      if (!this.formSearch.courseNo) {
+        this.$notify({
+          message: "请选择课程",
+          type: "warning",
+        });
+        return;
+      }
       this.tableData = [];
       var url =
         QUESTION_API + "/question/" + this.currentPage + "/" + this.pageSize;
@@ -736,7 +743,9 @@ export default {
           secondPropertyId: "",
         };
       }
-      this.searchQues();
+      if (this.formSearch.courseNo) {
+        this.searchQues();
+      }
     },
   },
 };