Ver código fonte

feat: 一堆问题

zhangjie 6 meses atrás
pai
commit
6ec3ad439c

+ 34 - 75
src/assets/styles/element-ui-costom.scss

@@ -21,57 +21,7 @@
     }
   }
 }
-.side-dialog {
-  // position: absolute;
-  // margin: 0 !important;
-  // top: 0;
-  // right: 0;
-  // height: 100%;
-  // box-shadow: -20px 20px 20px 0px rgba(212, 220, 243, 0.3);
-  // .el-dialog__header {
-  //   position: absolute;
-  //   top: 0;
-  //   left: 0;
-  //   right: 0;
-  //   padding: 20px;
-  //   &::after {
-  //     content: "";
-  //     position: absolute;
-  //     left: 20px;
-  //     right: 20px;
-  //     bottom: 0;
-  //     border-bottom: 1px solid $--color-border;
-  //   }
-  // }
-  // .el-dialog__body {
-  //   position: absolute;
-  //   left: 0;
-  //   right: 0;
-  //   top: 70px;
-  //   bottom: 80px;
-  //   padding: 20px;
-  //   overflow: auto;
-  // }
-  // .el-dialog__footer {
-  //   position: absolute;
-  //   bottom: 0;
-  //   left: 0;
-  //   right: 0;
-  //   padding: 20px;
-  // }
-  // // other
-  // .el-form {
-  //   &-item {
-  //     margin-bottom: 16px;
-  //     &__label {
-  //       margin: 0;
-  //     }
-  //     &__error {
-  //       padding-top: 2px;
-  //     }
-  //   }
-  // }
-}
+
 .action-dropdown {
   background-color: $--color-text-primary;
   padding: 0 19px;
@@ -265,27 +215,29 @@
   .thead {
     color: $--color-text-secondary;
   }
-  .el-table__body-wrapper,.el-table__fixed-body-wrapper{
-    .cell{
-      .el-button{
-        &.normal{
-          color:#262626;
-          &:hover{
-            color:rgba(38,38,38,.8);
+  .el-table__body-wrapper,
+  .el-table__fixed-body-wrapper {
+    .cell {
+      .el-button {
+        &.normal {
+          color: #262626;
+          &:hover {
+            color: rgba(38, 38, 38, 0.8);
           }
         }
-        &.danger{
-          color:#f56c6c;
-          &:hover{
-            color:#f78989;
+        &.danger {
+          color: #f56c6c;
+          &:hover {
+            color: #f78989;
           }
         }
       }
     }
-    tbody{
-      td:last-child{
-        .el-button--text:not(:first-child),.el-dropdown{
-          margin-left:15px;
+    tbody {
+      td:last-child {
+        .el-button--text:not(:first-child),
+        .el-dropdown {
+          margin-left: 15px;
         }
       }
     }
@@ -354,14 +306,21 @@
   height: auto;
   padding: 3px 10px;
 }
-.el-menu{
-  border-color:transparent;
+.el-menu {
+  border-color: transparent;
 }
-.el-table--small{
-  font-size:14px;
+.el-table--small {
+  font-size: 14px;
+}
+.el-button.is-back {
+  padding: 7px;
+  margin-right: 8px;
+  vertical-align: middle;
+}
+// .el-notification
+.el-notification {
+  .el-notification__content {
+    word-break: break-all;
+    margin: 0;
+  }
 }
-.el-button.is-back{
-  padding:7px;
-  margin-right:8px;
-  vertical-align: middle
-}

+ 3 - 0
src/components/vEditor/components/TtsDialog.vue

@@ -79,6 +79,9 @@ export default {
       this.blob = null;
     },
     closed() {
+      if (this.status === "PLAY") {
+        this.ttsVoice?.audioPlayer?.stop();
+      }
       this.ttsVoice?.reset();
     },
     cancel() {

+ 1 - 1
src/modules/paper/api.js

@@ -68,7 +68,7 @@ export const paperDetailApi = (paperId) => {
   return $httpWithMsg.get(`${QUESTION_API}/paper/${paperId}`, {});
 };
 export const paperEditLogsApi = (data) => {
-  return $httpWithMsg.post(`${QUESTION_API}/log/page`, {}, { params: data });
+  return $httpWithMsg.post(`${QUESTION_API}/log/page`, data);
 };
 export const paperSaveApi = (paper) => {
   return $httpWithMsg.post(`${QUESTION_API}/paper`, paper);

+ 7 - 0
src/modules/paper/components/BuildPaperAuto.vue

@@ -76,6 +76,7 @@
           :filter-data="{
             courseId,
             sourceDetailId: detail.sourceDetailId,
+            ...paperSetting,
           }"
           :data-source="detail"
           @count-change="(val) => structCountChange(val, detail)"
@@ -116,6 +117,12 @@ export default {
         return [];
       },
     },
+    paperSetting: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
   },
   data() {
     return {

+ 15 - 0
src/modules/paper/components/BuildPaperSimple.vue

@@ -71,12 +71,26 @@ export default {
       type: [String, Number],
       default: "",
     },
+    paperSetting: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
   },
   data() {
     return {
       baseDataList: [],
     };
   },
+  watch: {
+    paperSetting: {
+      deep: true,
+      handler() {
+        this.getBaseData();
+      },
+    },
+  },
   mounted() {
     this.getBaseData();
   },
@@ -84,6 +98,7 @@ export default {
     async getBaseData() {
       const res = await paperSimpleCountDistributeApi({
         courseId: this.courseId,
+        ...this.paperSetting,
       });
       this.baseDataList = res.data.map((item) => {
         return {

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

@@ -23,7 +23,7 @@
               {{ scope.row.createTime | timestampFilter }}
             </template>
           </el-table-column>
-          <el-table-column label="修改人" prop="loginName" width="120">
+          <el-table-column label="修改人" prop="loginName" width="200">
             <template slot-scope="scope">
               {{ scope.row.realName }}({{ scope.row.loginName }})
             </template>

+ 35 - 32
src/modules/paper/components/QuestionGroupStruct.vue

@@ -90,40 +90,43 @@
               <span class="inline-middle">/ {{ scope.row.questionCount }}</span>
             </template>
           </el-table-column>
-          <el-table-column
-            v-for="(dinfo, dindex) in difficultDistributeInfo"
-            v-else
-            :key="dindex"
-            :label="dinfo"
-            width="150"
-          >
-            <template
-              v-if="
-                scope.row.difficultDistributeInfo &&
-                scope.row.difficultDistributeInfo.length &&
-                !(scope.row.isClassify && useProperty)
-              "
-              slot-scope="scope"
+          <template v-else>
+            <el-table-column
+              v-for="(dinfo, dindex) in difficultDistributeInfo"
+              :key="dindex"
+              :label="dinfo"
+              width="150"
             >
-              <el-input-number
-                v-model="scope.row.difficultDistributeInfo[dindex].selectCount"
-                size="mini"
-                :step="1"
-                :min="0"
-                :max="scope.row.difficultDistributeInfo[dindex].questionCount"
-                :controls="false"
-                :precision="0"
-                step-strictly
-                @change="selectCountChange"
-              ></el-input-number>
-              <span class="inline-middle"
-                >/
-                {{
-                  scope.row.difficultDistributeInfo[dindex].questionCount
-                }}</span
+              <template
+                v-if="
+                  scope.row.difficultDistributeInfo &&
+                  scope.row.difficultDistributeInfo.length &&
+                  !(scope.row.isClassify && useProperty)
+                "
+                slot-scope="scope"
               >
-            </template>
-          </el-table-column>
+                <el-input-number
+                  v-model="
+                    scope.row.difficultDistributeInfo[dindex].selectCount
+                  "
+                  size="mini"
+                  :step="1"
+                  :min="0"
+                  :max="scope.row.difficultDistributeInfo[dindex].questionCount"
+                  :controls="false"
+                  :precision="0"
+                  step-strictly
+                  @change="selectCountChange"
+                ></el-input-number>
+                <span class="inline-middle"
+                  >/
+                  {{
+                    scope.row.difficultDistributeInfo[dindex].questionCount
+                  }}</span
+                >
+              </template>
+            </el-table-column>
+          </template>
         </el-table>
       </div>
     </div>

+ 8 - 1
src/modules/paper/views/BuildPaper.vue

@@ -74,7 +74,7 @@
                 controls-position="right"
               ></el-input-number>
             </el-form-item>
-            <el-form-item label="创建时间">
+            <el-form-item label="试题创建时间">
               <el-date-picker
                 v-model="createTime"
                 type="daterange"
@@ -186,6 +186,7 @@
           :is="buildCompName"
           ref="BuildPaperDetail"
           :course-id="modalForm.courseId"
+          :paper-setting="paperSetting"
         ></component>
       </div>
 
@@ -290,6 +291,12 @@ export default {
     IS_AUTO_MODE() {
       return this.genModelType === "auto";
     },
+    paperSetting() {
+      return {
+        startTime: this.modalForm.startTime,
+        endTime: this.modalForm.endTime,
+      };
+    },
   },
   created() {
     let genPaperInfo = sessionStorage.getItem("gen_paper");

+ 14 - 61
src/modules/paper/views/EditPaper.vue

@@ -119,34 +119,20 @@
       <div class="edit-header-bottom box-justify">
         <div>
           <el-button
-            plain
             size="small"
             icon="el-icon-circle-plus"
             @click="addBigQuestion"
           >
             新增大题
           </el-button>
-          <el-button plain size="small" @click="toViewStructInfo">
+          <el-button size="small" @click="toViewStructInfo">
             试卷结构分析
           </el-button>
-          <!-- <el-button plain size="small" @click="toViewBaseInfo">
-            基础构成
-          </el-button>
-          <el-button plain size="small" @click="toViewQuestypeInfo">
-            题型分布
-          </el-button>
-          <el-button plain size="small" @click="toViewBlueInfo">
-            蓝图分布
-          </el-button> -->
-          <!-- <el-button plain size="small" @click="toViewAuditInfo">
-            审核记录
-          </el-button> -->
           <el-button
             v-if="
               enableCardEdit &&
               authButtons.includes('exam_paper_manager-edit_card')
             "
-            plain
             size="small"
             @click="toEditCard"
           >
@@ -160,7 +146,6 @@
             "
             type="danger"
             size="small"
-            plain
             class="maintain"
             @click="toDeletCard"
           >
@@ -169,59 +154,27 @@
         </div>
         <div>
           <el-button size="small" @click="toViewLog">试卷修改记录</el-button>
-          <tool-tip-btn
-            name="shenhejilu"
-            content="审核记录"
-            @click="toViewAuditInfo"
-          ></tool-tip-btn>
-          <tool-tip-btn
-            name="yulan"
-            content="生成试卷"
-            @click="previewPDF2"
-          ></tool-tip-btn>
-          <tool-tip-btn
+          <el-button name="shenhejilu" @click="toViewAuditInfo"
+            >审核记录</el-button
+          >
+          <el-button name="yulan" @click="previewPDF2">生成试卷</el-button>
+          <el-button
             name="shuxingyincangxianshi"
-            :content="(quesTagShow ? '隐藏' : '显示') + '属性'"
             @click="toSwitchQuesTagShowHide"
-          ></tool-tip-btn>
-          <tool-tip-btn
+            >{{ (quesTagShow ? "隐藏" : "显示") + "属性" }}</el-button
+          >
+          <el-button
             name="daochu"
-            content="导出试卷蓝图"
             :disabled="downloading"
             @click="toExportPaperBlue"
-          ></tool-tip-btn>
-          <tool-tip-btn
-            name="daanyincangxianshi"
-            :content="(quesAnswerShow ? '隐藏' : '显示') + '答案'"
-            @click="toSwitchQuesAnswerShowHide"
-          ></tool-tip-btn>
-          <!-- <el-button size="small" type="primary" plain @click="previewPDF2"
-            >预览</el-button
-          > -->
-          <!-- <el-button
-            type="primary"
-            size="small"
-            plain
-            @click="toSwitchQuesTagShowHide"
-          >
-            {{ quesTagShow ? "隐藏" : "显示" }}属性
-          </el-button> -->
-          <!-- <el-button
-            size="small"
-            type="primary"
-            plain
-            :loading="downloading"
-            @click="toExportPaperBlue"
             >导出试卷蓝图</el-button
-          > -->
-          <!-- <el-button
-            type="primary"
-            size="small"
-            plain
+          >
+          <el-button
+            name="daanyincangxianshi"
             @click="toSwitchQuesAnswerShowHide"
           >
-            {{ quesAnswerShow ? "隐藏" : "显示" }}答案
-          </el-button> -->
+            {{ (quesAnswerShow ? "隐藏" : "显示") + "答案" }}
+          </el-button>
         </div>
       </div>
     </div>

+ 12 - 13
src/modules/question/components/QuestionPreviewLoopDialog.vue

@@ -2,11 +2,16 @@
   <el-dialog
     custom-class="question-preview-dialog edit-paper"
     :visible.sync="modalIsShow"
-    title="试题预览"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
   >
+    <div class="box-justify" slot="title">
+      <h2>试题审核</h2>
+      <div>
+        <el-button icon="el-icon-back" @click="cancel">返回</el-button>
+      </div>
+    </div>
     <div v-if="modalIsShow" class="edit-part">
       <div class="edit-cont">
         <div class="edit-cont-title">
@@ -126,18 +131,12 @@
       </el-form>
       <div class="box-justify">
         <div>
-          <el-button
-            type="default"
-            icon="el-icon-caret-left"
-            :disabled="prevDisabled"
-            @click="toPrev"
-          ></el-button>
-          <el-button
-            type="default"
-            icon="el-icon-caret-right"
-            :disabled="nextDisabled"
-            @click="toNext"
-          ></el-button>
+          <el-button type="primary" :disabled="prevDisabled" @click="toPrev"
+            >上一题</el-button
+          >
+          <el-button type="primary" :disabled="nextDisabled" @click="toNext"
+            >下一题</el-button
+          >
         </div>
         <div>
           <el-button

+ 11 - 2
src/modules/questions/views/GenPaper.vue

@@ -576,10 +576,19 @@ export default {
     ...mapState({ user: (state) => state.user }),
   },
   watch: {
-    $route: "initVue",
+    $route: {
+      immediate: true,
+      handler(val) {
+        // console.log(val, oldval);
+        if (val.name === "PaperManage") {
+          this.initVue();
+        }
+      },
+    },
   },
+
   created() {
-    this.initVue();
+    // this.initVue();
     this.registWindowSubmit();
   },
   beforeDestroy() {

+ 0 - 4
src/plugins/axios.js

@@ -2,7 +2,6 @@ import Vue from "vue";
 import axios from "axios";
 import router from "../router";
 import { loadProgressBar } from "axios-progress-bar";
-import networkInformationHint from "./networkInformationHint.js";
 import { initSyncTime, fetchTime } from "./syncServerTime";
 import { getAuthorization } from "./crypto";
 function setAuth(config) {
@@ -80,7 +79,6 @@ function returnLogin() {
 
 _$httpWith500Msg.interceptors.request.use(
   function (config) {
-    networkInformationHint();
     // Do something before request is sent
     if (!noauthUrls.some((url) => config.url.includes(url))) {
       setAuth(config);
@@ -133,7 +131,6 @@ _$httpWith500Msg.interceptors.request.use(
 _$http.interceptors.request.use(
   // no auto 500 error UI
   function (config) {
-    networkInformationHint();
     // Do something before request is sent
     if (!noauthUrls.some((url) => config.url.includes(url))) {
       setAuth(config);
@@ -363,7 +360,6 @@ _$http.interceptors.response.use(
 _$httpWithoutBar.interceptors.request.use(
   // no auto 500 error UI
   function (config) {
-    networkInformationHint();
     // Do something before request is sent
     if (!noauthUrls.some((url) => config.url.includes(url))) {
       setAuth(config);

+ 0 - 1
src/plugins/tts/index.js

@@ -8,7 +8,6 @@ export default class TtsVoice {
   apiSecret = "";
   apiKey = "";
   ttsWS = null;
-  text = "";
   status = "UNDEFINED";
   statusStr = "";
   audioPlayer = null;