Ver código fonte

feat: 试题管理流水查看

zhangjie 7 meses atrás
pai
commit
ee187d63c4

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

@@ -1240,13 +1240,15 @@
 // question-preview-dialog
 .question-preview-dialog {
   &.el-dialog {
-    width: 1000px;
+    max-width: 1000px;
+    width: 100%;
     height: 100%;
     overflow: hidden;
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     margin-bottom: 0;
+    margin-top: 0 !important;
   }
   .el-dialog__header,
   .el-dialog__footer {

+ 1 - 1
src/modules/paper/components/PaperStructInfo.vue

@@ -1,9 +1,9 @@
 <template>
   <el-dialog
     title="试卷结构分析"
-    width="100%"
     :visible.sync="modalIsShow"
     :modal="true"
+    fullscreen
     append-to-body
     custom-class="side-dialog"
     @open="getData"

+ 54 - 16
src/modules/paper/views/BuildPaper.vue

@@ -43,7 +43,11 @@
           label-width="120px"
         >
           <el-form-item label="组卷模式">
-            <el-radio-group v-model="genModelType" style="padding-left: 15px">
+            <el-radio-group
+              v-model="genModelType"
+              style="padding-left: 15px"
+              @change="modelTypeChange"
+            >
               <el-radio
                 v-for="item in modelTypes"
                 :key="item.code"
@@ -59,27 +63,40 @@
               placeholder="试卷名称"
             ></el-input>
           </el-form-item>
-          <el-form-item
-            v-if="!IS_MANUAL_MODE"
-            prop="paperCount"
-            label="组卷套数"
-          >
-            <el-input-number
-              v-model="modalForm.paperCount"
-              :min="1"
-              :max="20"
-              :step="1"
-              step-strictly
-              controls-position="right"
-            ></el-input-number>
-          </el-form-item>
+          <template v-if="!IS_MANUAL_MODE">
+            <el-form-item prop="paperCount" label="组卷套数">
+              <el-input-number
+                v-model="modalForm.paperCount"
+                :min="1"
+                :max="20"
+                :step="1"
+                step-strictly
+                controls-position="right"
+              ></el-input-number>
+            </el-form-item>
+            <el-form-item label="创建时间">
+              <el-date-picker
+                v-model="createTime"
+                type="datetimerange"
+                :picker-options="pickerOptions"
+                range-separator="至"
+                start-placeholder="开始时间"
+                end-placeholder="结束时间"
+                value-format="timestamp"
+                align="right"
+                unlink-panels
+                @change="dateChange"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </template>
           <el-form-item v-if="IS_AUTO_MODE" label="选择试卷结构">
             <!-- <el-button type="success" size="small" @click="toSelectStruct"
               >选择试卷结构</el-button
             > -->
             <div
               @click="toSelectStruct"
-              style="color: #6d5ff6; cursor: pointer"
+              style="display: inline-block; color: #6d5ff6; cursor: pointer"
             >
               <i
                 class="el-icon-circle-plus"
@@ -191,6 +208,7 @@ import AutoBuildPaperStructManage from "../components/AutoBuildPaperStructManage
 
 import { buildPaperApi, autoBuildPaperStructSaveApi } from "../api";
 import { deepCopy, randomCode } from "@/plugins/utils";
+import pickerOptions from "@/constants/datePickerOptions";
 
 const initModalForm = {
   courseId: "",
@@ -203,6 +221,8 @@ const initModalForm = {
   maxLimit: 0,
   topicOnly: false,
   timeLimit: 1,
+  createStartTime: undefined,
+  createEndTime: undefined,
 };
 
 export default {
@@ -216,6 +236,8 @@ export default {
   data() {
     return {
       loading: false,
+      pickerOptions,
+      createTime: [],
       modalForm: {
         ...initModalForm,
       },
@@ -287,6 +309,22 @@ export default {
       });
       this.$refs.BuildPaperDetail.setDetails(details);
     },
+    modelTypeChange() {
+      if (this.genModelType === "manual") {
+        this.createTime = [];
+        this.modalForm.createStartTime = undefined;
+        this.modalForm.createEndTime = undefined;
+      }
+    },
+    dateChange() {
+      if (this.createTime) {
+        this.modalForm.createStartTime = this.createTime[0];
+        this.modalForm.createEndTime = this.createTime[1];
+      } else {
+        this.modalForm.createStartTime = undefined;
+        this.modalForm.createEndTime = undefined;
+      }
+    },
     async confirm() {
       let valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;

+ 19 - 4
src/modules/question/components/AuditQuestionApply.vue

@@ -80,7 +80,9 @@
     <!-- QuestionPreviewDialog -->
     <question-preview-dialog
       ref="QuestionPreviewDialog"
-      :data="curQuestion"
+      :list-info="listInfo"
+      :fetchPage="toPage"
+      show-switch
     ></question-preview-dialog>
   </div>
 </template>
@@ -99,17 +101,29 @@ export default {
       currentPage: 1,
       pageSize: 10,
       total: 0,
+      totalPages: 0,
       loading: false,
       curQuestion: {},
+      curQuestionIndex: 0,
     };
   },
+  computed: {
+    listInfo() {
+      return {
+        dataList: this.dataList,
+        curIndex: this.curQuestionIndex,
+        pageNumber: this.currentPage,
+        totalPages: this.totalPages,
+      };
+    },
+  },
   mounted() {
     this.toPage(1);
   },
   methods: {
-    toPage(page) {
+    async toPage(page) {
       this.currentPage = page;
-      this.getList();
+      await this.getList();
     },
     async getList() {
       this.loading = true;
@@ -122,13 +136,14 @@ export default {
       if (!res) return;
       this.dataList = res.data.content;
       this.total = res.data.totalElements;
+      this.totalPages = res.data.totalPages;
     },
     handleSizeChange(val) {
       this.pageSize = val;
       this.toPage(1);
     },
     toDetail(row) {
-      this.curQuestion = row;
+      this.curQuestionIndex = this.dataList.findIndex((q) => q.id === row.id);
       this.$refs.QuestionPreviewDialog.open();
     },
     async toWithdraw(row) {

+ 19 - 4
src/modules/question/components/AuditQuestionAudited.vue

@@ -73,7 +73,9 @@
     <!-- QuestionPreviewDialog -->
     <question-preview-dialog
       ref="QuestionPreviewDialog"
-      :data="curQuestion"
+      :list-info="listInfo"
+      :fetchPage="toPage"
+      show-switch
     ></question-preview-dialog>
   </div>
 </template>
@@ -92,17 +94,29 @@ export default {
       currentPage: 1,
       pageSize: 10,
       total: 0,
+      totalPages: 0,
       loading: false,
       curQuestion: {},
+      curQuestionIndex: 0,
     };
   },
+  computed: {
+    listInfo() {
+      return {
+        dataList: this.dataList,
+        curIndex: this.curQuestionIndex,
+        pageNumber: this.currentPage,
+        totalPages: this.totalPages,
+      };
+    },
+  },
   mounted() {
     this.toPage(1);
   },
   methods: {
-    toPage(page) {
+    async toPage(page) {
       this.currentPage = page;
-      this.getList();
+      await this.getList();
     },
     async getList() {
       this.loading = true;
@@ -115,13 +129,14 @@ export default {
       if (!res) return;
       this.dataList = res.data.content;
       this.total = res.data.totalElements;
+      this.totalPages = res.data.totalPages;
     },
     handleSizeChange(val) {
       this.pageSize = val;
       this.toPage(1);
     },
     toDetail(row) {
-      this.curQuestion = row;
+      this.curQuestionIndex = this.dataList.findIndex((q) => q.id === row.id);
       this.$refs.QuestionPreviewDialog.open();
     },
   },

+ 19 - 4
src/modules/question/components/AuditQuestionUnsubmit.vue

@@ -82,7 +82,9 @@
     <!-- QuestionPreviewDialog -->
     <question-preview-dialog
       ref="QuestionPreviewDialog"
-      :data="curQuestion"
+      :list-info="listInfo"
+      :fetchPage="toPage"
+      show-switch
     ></question-preview-dialog>
   </div>
 </template>
@@ -102,17 +104,29 @@ export default {
       currentPage: 1,
       pageSize: 10,
       total: 0,
+      totalPages: 0,
       loading: false,
       curQuestion: {},
+      curQuestionIndex: 0,
     };
   },
+  computed: {
+    listInfo() {
+      return {
+        dataList: this.dataList,
+        curIndex: this.curQuestionIndex,
+        pageNumber: this.currentPage,
+        totalPages: this.totalPages,
+      };
+    },
+  },
   mounted() {
     this.toPage(1);
   },
   methods: {
-    toPage(page) {
+    async toPage(page) {
       this.currentPage = page;
-      this.getList();
+      await this.getList();
     },
     async getList() {
       this.loading = true;
@@ -125,13 +139,14 @@ export default {
       if (!res) return;
       this.dataList = res.data.content;
       this.total = res.data.totalElements;
+      this.totalPages = res.data.totalPages;
     },
     handleSizeChange(val) {
       this.pageSize = val;
       this.toPage(1);
     },
     toViewQuestion(row) {
-      this.curQuestion = row;
+      this.curQuestionIndex = this.dataList.findIndex((q) => q.id === row.id);
       this.$refs.QuestionPreviewDialog.open();
     },
     toEdit(row) {

+ 11 - 8
src/modules/question/components/QuestionPreviewDialog.vue

@@ -3,7 +3,6 @@
     custom-class="question-preview-dialog edit-paper"
     :visible.sync="modalIsShow"
     title="试题预览"
-    top="0"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
@@ -119,15 +118,19 @@
     <div class="box-justify" slot="footer">
       <div>
         <template v-if="showSwitch">
-          <el-button :disabled="loading" size="mini" @click="toPrev"
-            >上一题</el-button
-          >
-          <el-button :disabled="loading" size="mini" @click="toNext"
-            >下一题</el-button
-          >
+          <el-button
+            icon="el-icon-caret-left"
+            :disabled="loading"
+            @click="toPrev"
+          ></el-button>
+          <el-button
+            icon="el-icon-caret-right"
+            :disabled="loading"
+            @click="toNext"
+          ></el-button>
         </template>
       </div>
-      <el-button size="mini" @click="cancel">关闭</el-button>
+      <el-button @click="cancel">关闭</el-button>
     </div>
   </el-dialog>
 </template>

+ 0 - 2
src/modules/question/components/QuestionPreviewLoopDialog.vue

@@ -3,8 +3,6 @@
     custom-class="question-preview-dialog edit-paper"
     :visible.sync="modalIsShow"
     title="试题预览"
-    width="1000px"
-    top="20px"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body

+ 33 - 18
src/modules/questions/views/CheckDuplicateList.vue

@@ -205,10 +205,12 @@
     </div>
 
     <!-- 试题预览 -->
-    <question-preview
-      ref="QuestionPreview"
-      :ques-model="quesModel"
-    ></question-preview>
+    <question-preview-dialog
+      ref="QuestionPreviewDialog"
+      :list-info="listInfo"
+      :fetchPage="handleCurrentChange"
+      show-switch
+    ></question-preview-dialog>
 
     <!-- <el-dialog title="提示" :visible.sync="deleteDialogVisible" append-to-body>
       <span>{{ deleteInfo }}</span>
@@ -223,10 +225,10 @@
 <script>
 import { QUESTION_API } from "@/constants/constants";
 import { mapState } from "vuex";
-import QuestionPreview from "./QuestionPreview";
+import QuestionPreviewDialog from "../../question/components/QuestionPreviewDialog.vue";
 
 export default {
-  components: { QuestionPreview },
+  components: { QuestionPreviewDialog },
   data() {
     return {
       selectedQuesIds: [],
@@ -242,6 +244,7 @@ export default {
       currentPage: 1,
       pageSize: 10,
       total: 10,
+      totalPages: 0,
       quesModel: {},
       questionTypes: [],
       quesDialog: false,
@@ -251,6 +254,7 @@ export default {
       singleRightAnswer: "", //接收单选答案
       multipleRightAnswer: [], //接收多选答案
       isClear: 0,
+      curQuestionIndex: 0,
     };
   },
   computed: {
@@ -277,6 +281,14 @@ export default {
     noBatchSelected() {
       return this.selectedQuesIds.length === 0;
     },
+    listInfo() {
+      return {
+        dataList: this.tableData,
+        curIndex: this.curQuestionIndex,
+        pageNumber: this.currentPage,
+        totalPages: this.totalPages,
+      };
+    },
   },
   watch: {
     $route: "initVue",
@@ -379,7 +391,7 @@ export default {
       this.currentPage = 1;
       this.searchQues();
     },
-    searchQues() {
+    async searchQues() {
       var pageNo = this.currentPage || 1;
       this.currentPage = 1;
       this.tableData = [];
@@ -390,17 +402,21 @@ export default {
         "/" +
         this.pageSize;
       this.loading = true;
-      this.$http.get(url, { params: this.formSearch }).then((response) => {
-        this.tableData = response.data.content;
-        this.currentPage = response.data.number;
-        this.total = response.data.totalElements;
-        this.loading = false;
-      });
+      const res = await this.$http
+        .get(url, { params: this.formSearch })
+        .catch(() => {});
+      this.loading = false;
+      if (!res) return;
+
+      this.tableData = res.data.content;
+      this.currentPage = res.data.number;
+      this.total = res.data.totalElements;
+      this.totalPages = res.data.totalPages;
     },
     //分页
-    handleCurrentChange(val) {
+    async handleCurrentChange(val) {
       this.currentPage = val;
-      this.searchQues();
+      await this.searchQues();
     },
     handleSizeChange(val) {
       this.pageSize = val;
@@ -428,9 +444,8 @@ export default {
     },
     //预览
     prevViewQues(row) {
-      this.quesModel = row;
-      this.disposeSelectAnswer();
-      this.$refs.QuestionPreview.open();
+      this.curQuestionIndex = this.tableData.findIndex((q) => q.id === row.id);
+      this.$refs.QuestionPreviewDialog.open();
     },
     //查询所有课程
     getCourses(query) {

+ 2 - 0
src/modules/questions/views/OrgProperty.vue

@@ -598,6 +598,8 @@ export default {
           GEN_PAPER_QUESTION_END,
         },
       };
+      // 调试
+      // params.properties.CHECK_LIMIT_CHAR_COUNT = undefined;
       let res = await this.$httpWithMsg.put(url, params).catch(() => {});
       if (!res) return;
       if (this.tab4Entered) {