zhangjie hace 2 años
padre
commit
df5f85d9df

+ 13 - 6
src/assets/styles/pages.scss

@@ -548,13 +548,9 @@
 }
 .row-question-body {
   line-height: 24px;
+  max-height: 100px;
+  overflow: hidden;
   cursor: pointer;
-  p {
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    overflow: hidden;
-    margin-bottom: 0;
-  }
 }
 // question-edit
 .question-edit-option {
@@ -1137,3 +1133,14 @@
     font-size: 14px;
   }
 }
+
+// question-preview-dialog
+.question-preview-dialog {
+  .edit-part {
+    margin-bottom: 15px;
+
+    img {
+      max-width: 100%;
+    }
+  }
+}

+ 8 - 8
src/modules/card/views/CardHeadEdit.vue

@@ -177,8 +177,8 @@ export default {
               const vals = value.split(/\n/);
               if (vals.length > 2) {
                 callback(new Error("题卡标题只能换行一次"));
-              } else if (vals.some((item) => item.length > 26)) {
-                callback(new Error("题卡标题每行最多只允许输入26个字符"));
+              } else if (vals.some((item) => item.length > 30)) {
+                callback(new Error("题卡标题每行最多只允许输入30个字符"));
               } else {
                 callback();
               }
@@ -195,8 +195,8 @@ export default {
           {
             validator: (rule, value, callback) => {
               const val = value.replace(/\n/g, "");
-              if (val.length > 200) {
-                callback(new Error("注意事项最多只能输入200个字符"));
+              if (val.length > 500) {
+                callback(new Error("注意事项最多只能输入500个字符"));
               } else {
                 callback();
               }
@@ -211,8 +211,8 @@ export default {
             trigger: "change",
           },
           {
-            max: 26,
-            message: "客观题注意事项最多只能输入26个汉字",
+            max: 60,
+            message: "客观题注意事项最多只能输入60个汉字",
             trigger: "change",
           },
         ],
@@ -223,8 +223,8 @@ export default {
             trigger: "change",
           },
           {
-            max: 26,
-            message: "主观题注意事项最多只能输入26个汉字",
+            max: 60,
+            message: "主观题注意事项最多只能输入60个汉字",
             trigger: "change",
           },
         ],

+ 6 - 0
src/modules/paper-export/api.js

@@ -31,6 +31,12 @@ export const paperTemplateDetailApi = (tid) => {
 export const savePaperTemplateApi = (datas) => {
   return $httpWithMsg.post(QUESTION_API + "/paper_template/save", datas);
 };
+export const checkPaperTemplateNameApi = (datas) => {
+  return $httpWithMsg.post(
+    QUESTION_API + "/paper_template/check_name_repeat",
+    datas
+  );
+};
 export const paperTemplateEnableApi = ({ id, enable }) => {
   return $httpWithMsg.post(
     QUESTION_API + "/paper_template/enable",

+ 2 - 0
src/modules/paper-export/components/ModifyPaperTemplateInfo.vue

@@ -46,6 +46,7 @@
 
 <script>
 import { PAPER_TEMPLATE_TYPE } from "@/constants/constants";
+import { checkPaperTemplateNameApi } from "../api";
 
 const initModalForm = {
   id: null,
@@ -118,6 +119,7 @@ export default {
       if (!valid) return;
 
       if (!this.isEdit) {
+        await checkPaperTemplateNameApi(this.modalForm);
         this.$emit("new-temp", this.modalForm);
         this.cancel();
         return;

+ 3 - 2
src/modules/paper-export/components/PaperTemplateDesign.vue

@@ -261,6 +261,7 @@ export default {
       "modifyElement",
       "rebuildPages",
       "changePage",
+      "directChangePage",
     ]),
     pageTypeType(pageType) {
       const types = {
@@ -292,7 +293,7 @@ export default {
 
       if (pages && pages.length) {
         this.setPages(pages);
-        this.changePage(0);
+        this.directChangePage(0);
       } else {
         this.initPageData(pageConfig);
       }
@@ -306,7 +307,7 @@ export default {
         pages.unshift(getPageModel({ ...this.pageConfig, pageType: "cover" }));
       }
       this.setPages(pages);
-      this.changePage(0);
+      this.directChangePage(0);
     },
     addNewTopic(type) {
       // if (type === 'PAGE')

+ 2 - 2
src/modules/paper/components/SelectQuestionDialog.vue

@@ -67,7 +67,7 @@
             label="编号"
           >
           </el-table-column>
-          <el-table-column label="题干">
+          <el-table-column label="题干" min-width="200">
             <div slot-scope="scope" @click="toViewQuestion(scope.row)">
               <rich-text
                 class="row-question-body"
@@ -136,7 +136,7 @@
         <el-table :data="curSelectedQuestions" border>
           <el-table-column width="60" type="index" label="编号">
           </el-table-column>
-          <el-table-column label="题干">
+          <el-table-column label="题干" min-width="200">
             <div slot-scope="scope" @click="toViewQuestion(scope.row)">
               <rich-text
                 class="row-question-body"

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

@@ -80,7 +80,7 @@
               width="50"
               align="center"
             ></el-table-column>
-            <el-table-column label="题干">
+            <el-table-column label="题干" min-width="200">
               <template slot-scope="scope">
                 <rich-text
                   class="row-question-body"

+ 1 - 0
src/modules/question/components/QuestionPreviewDialog.vue

@@ -1,5 +1,6 @@
 <template>
   <el-dialog
+    custom-class="question-preview-dialog"
     :visible.sync="modalIsShow"
     title="试题预览"
     :modal="false"

+ 4 - 1
src/modules/question/components/edit/FillBlankQuestion.vue

@@ -18,9 +18,9 @@
       <el-form-item
         v-for="(answer, oindex) in modalForm.quesAnswer"
         :key="oindex"
-        :prop="`quesAnswer.${oindex}.body`"
         :rules="answerRule"
       >
+        <!-- :prop="`quesAnswer.${oindex}.body`" -->
         <div class="question-edit-option">
           <div class="option-check">({{ oindex + 1 }})</div>
           <div class="option-body">
@@ -69,6 +69,9 @@ export default {
               if (!value || isAnEmptyRichText(value)) {
                 return callback(new Error(`请输入题干`));
               }
+              if (!this.modalForm.quesAnswer.length) {
+                return callback(new Error(`请插入答题点`));
+              }
               callback();
             },
             trigger: "change",

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

@@ -93,7 +93,7 @@
         element-loading-text="加载中"
         :data="questionList"
       >
-        <el-table-column label="题干">
+        <el-table-column label="题干" min-width="200">
           <div slot-scope="scope" @click="toViewQuestion(scope.row)">
             <rich-text
               class="row-question-body"