zhangjie 2 yıl önce
ebeveyn
işleme
3dd4dcd83d

+ 35 - 3
src/modules/paper-export/assets/styles/temp.css

@@ -68,9 +68,8 @@
   position: absolute;
 }
 .paper-page .page-column-element .element-item::before {
-  border: none;
+  border: 0;
 }
-
 .elem-pane-box .elem-body {
   min-height: 60px;
   position: relative;
@@ -86,8 +85,41 @@
 .elem-pane-box .elem-pane-box-element .element-item {
   position: absolute;
 }
-
 .elem-rich-text {
   display: inline-block;
   white-space: pre-wrap;
 }
+.elem-paper-struct ol {
+  padding-left: 15px;
+}
+.elem-paper-struct li {
+  list-style: decimal;
+}
+.rich-text {
+  display: inline-block;
+  vertical-align: top;
+  line-height: 20px;
+}
+.rich-text img[data-is-answer-point] {
+  max-width: 100%;
+  max-height: 16px;
+  display: inline-block;
+  vertical-align: text-top;
+  border-bottom: 1px solid #000;
+}
+.rich-text audio {
+  height: 20px;
+  display: inline-block;
+  vertical-align: top;
+  margin-left: 5px;
+  margin-right: 5px;
+}
+.rich-text u {
+  text-decoration: underline;
+}
+.rich-text i {
+  font-style: italic;
+}
+.rich-text b {
+  font-weight: 600;
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1
src/modules/paper-export/previewTemp.js


+ 27 - 2
src/modules/paper-export/views/PaperTemplateBuild.vue

@@ -273,7 +273,10 @@ export default {
         detail.paperDetailUnits.forEach((question) => {
           let questionInfo = question.question;
           if (questionInfo.subQuestions && questionInfo.subQuestions.length) {
-            const bodys = this.parseTitleOption(questionInfo.quesBody, "");
+            const bodys = this.parseTitleOption(
+              questionInfo.quesBody,
+              `${question.number}、`
+            );
             renderStructList.push(...bodys);
 
             const isMatches = this.checkIsMatches(questionInfo.questionType);
@@ -358,11 +361,33 @@ export default {
       });
       return contents;
     },
+    changeRichTextCloze(richText) {
+      return {
+        sections: richText.sections.map((section) => {
+          return {
+            blocks: section.blocks.map((item) => {
+              if (item.type === "cloze") {
+                return {
+                  type: "text",
+                  value: "_____",
+                };
+              } else {
+                return { ...item };
+              }
+            }),
+          };
+        }),
+      };
+    },
     parseSimpleQuestion(question, isCommon) {
       let contents = [];
+      let quesBody = question.quesBody;
+      if (question.questionType === "FILL_BLANK_QUESTION") {
+        quesBody = this.changeRichTextCloze(quesBody);
+      }
 
       const tbodys = this.parseTitleOption(
-        question.quesBody,
+        quesBody,
         isCommon ? `${question.number}、` : `${question.subNumber}、`
       );
       contents.push(...tbodys);

+ 1 - 0
src/modules/paper/components/BuildPaperQuestionBase.vue

@@ -89,6 +89,7 @@ export default {
   methods: {
     scoreChange() {
       this.$emit("input", this.score);
+      this.$emit("change", this.score);
     },
     editQuestion() {
       this.$emit("on-edit", this.question);

+ 16 - 4
src/modules/paper/components/BuildPaperQuestionNested.vue

@@ -5,10 +5,12 @@
         <el-tag size="mini" effect="dark" type="success">{{
           question.questionType | questionType
         }}</el-tag>
-        <span class="inline-middle margin-left-10">小题分数:</span>
+        <span class="inline-middle margin-left-10"
+          >试题总分:{{ totalScore }}分,</span
+        >
+        <span class="inline-middle margin-left-10">每题分数:</span>
         <el-input-number
           v-model="score"
-          placeholder="请输入小题分数"
           size="mini"
           :step="0.1"
           :min="0.1"
@@ -49,6 +51,7 @@
           :question="subq"
           :question-serialno="sindex + 1"
           :show-action="false"
+          @change="updateTotalScore"
         ></build-paper-question-base>
       </template>
     </div>
@@ -57,7 +60,7 @@
 
 <script>
 import BuildPaperQuestionBase from "./BuildPaperQuestionBase.vue";
-import { deepCopy } from "@/plugins/utils";
+import { calcSum, deepCopy } from "@/plugins/utils";
 
 export default {
   name: "BuildPaperQuestionNested",
@@ -76,8 +79,9 @@ export default {
   },
   data() {
     return {
-      score: "",
+      score: undefined,
       quesBody: null,
+      totalScore: 0,
     };
   },
   created() {
@@ -102,6 +106,8 @@ export default {
           ],
         };
       }
+
+      this.updateTotalScore();
     }
   },
   methods: {
@@ -110,6 +116,12 @@ export default {
       this.question.subQuestions.forEach((subq) => {
         subq.score = this.score;
       });
+      this.updateTotalScore();
+    },
+    updateTotalScore() {
+      this.totalScore = calcSum(
+        this.question.subQuestions.map((item) => item.score || 0)
+      );
     },
     editQuestion() {
       this.$emit("on-edit", this.question);

+ 6 - 1
src/modules/paper/components/SelectQuestionDialog.vue

@@ -11,7 +11,12 @@
   >
     <div slot="title" class="box-justify">
       <h3>选择试题</h3>
-      <el-button size="mini" type="primary" @click="confirm">确定</el-button>
+      <div>
+        <el-button size="mini" type="primary" @click="confirm">确定</el-button>
+        <el-button size="mini" type="danger" plain @click="cancel"
+          >取消</el-button
+        >
+      </div>
     </div>
 
     <el-tabs

+ 46 - 2
src/modules/paper/views/EditPaper.vue

@@ -297,6 +297,28 @@
                     </div>
                   </div>
                 </div>
+                <div
+                  v-if="paperDetailUnit.question.quesProperties"
+                  class="edit-cont-props"
+                  style="margin-top: 10px"
+                >
+                  <el-tag
+                    v-for="(content, propIndex) in paperDetailUnit.question
+                      .quesProperties"
+                    :key="propIndex"
+                    type="primary"
+                    effect="dark"
+                    style="margin-right: 5px; margin-bottom: 5px"
+                  >
+                    {{ content.courseProperty && content.courseProperty.name }}
+                    <span style="margin: 0 3px">/</span>
+                    {{ content.firstProperty && content.firstProperty.name }}
+                    <span v-if="content.secondProperty" style="margin: 0 3px"
+                      >/</span
+                    >
+                    {{ content.secondProperty && content.secondProperty.name }}
+                  </el-tag>
+                </div>
                 <div class="edit-cont-action">
                   <span class="tips-info">
                     {{ paperDetailUnit.question.bodyLengthText }}
@@ -425,6 +447,27 @@
                     <!-- <rich-text :text-json="subQuestion.quesAnswer"></rich-text> -->
                   </div>
                 </div>
+                <div
+                  v-if="subQuestion.quesProperties"
+                  class="edit-cont-props"
+                  style="margin-top: 10px"
+                >
+                  <el-tag
+                    v-for="(content, propIndex) in subQuestion.quesProperties"
+                    :key="propIndex"
+                    type="primary"
+                    effect="dark"
+                    style="margin-right: 5px; margin-bottom: 5px"
+                  >
+                    {{ content.courseProperty && content.courseProperty.name }}
+                    <span style="margin: 0 3px">/</span>
+                    {{ content.firstProperty && content.firstProperty.name }}
+                    <span v-if="content.secondProperty" style="margin: 0 3px"
+                      >/</span
+                    >
+                    {{ content.secondProperty && content.secondProperty.name }}
+                  </el-tag>
+                </div>
                 <div v-show="quesTagShow" class="edit-property">
                   <div class="edit-property-box">
                     <div
@@ -756,10 +799,11 @@ export default {
     },
     // 大题编辑
     toEditPaperDetail(detail) {
-      this.curDetail = detail;
+      this.curDetail = { ...detail, detailName: detail.name };
       this.$refs.ModifyDetailStruct.open();
     },
     async detailModified(detail) {
+      detail.name = detail.detailName;
       const res = await paperDetailUpdateApi(this.paperId, detail).catch(
         (error) => {
           this.$notify({
@@ -776,7 +820,7 @@ export default {
         (item) => item.id === detail.id
       );
       if (!paperDetail) return;
-      paperDetail.name = detail.name;
+      paperDetail.name = detail.detailName;
       paperDetail.description = detail.description;
     },
     // 移动大题

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor