zhangjie 1 年間 前
コミット
03758d097c

+ 1 - 0
card/assets/styles/card-preview.scss

@@ -354,6 +354,7 @@
   &-title {
     padding: 10px;
     font-size: 14px;
+    font-weight: bold;
     color: rgba(0, 0, 0, 1);
     line-height: 1;
     white-space: normal;

+ 1 - 0
card/assets/styles/card-temp.css

@@ -277,6 +277,7 @@
 .elem-title {
   padding: 10px;
   font-size: 14px;
+  font-weight: bold;
   color: rgb(0, 0, 0);
   line-height: 1;
   white-space: normal;

+ 2 - 7
card/components/CardDesign.vue

@@ -413,13 +413,8 @@ export default {
     },
     insetNewTopic({ id, type }) {
       this.preInsertTopic = { id, type };
-      if (type === "FILL_QUESTION") {
-        this.topicList = this.TOPIC_LIST;
-      } else {
-        this.topicList = this.TOPIC_LIST.filter(
-          (item) => !item.type.includes("FILL_QUESTION")
-        );
-      }
+      this.topicList = this.TOPIC_LIST;
+
       this.$refs.TopicSelectDialog.open();
     },
     // 元件编辑

+ 5 - 1
card/elements/fill-question/EditFillQuestion.vue

@@ -65,7 +65,11 @@
           :disabled="modalForm.isBoolean"
         ></el-input-number>
       </el-form-item>
-      <el-form-item label="选项排列方向:" required>
+      <el-form-item
+        v-if="topicType === 'boolean'"
+        label="选项排列方向:"
+        required
+      >
         <el-radio-group v-model="modalForm.optionDirection" size="small">
           <el-radio-button
             v-for="(val, key) in DIRECTION_TYPE"

ファイルの差分が大きいため隠しています
+ 0 - 0
card/previewTemp.js


+ 16 - 26
card/store/card.js

@@ -95,9 +95,9 @@ const fetchAllRelateParentElementPositionInfos = (parentElement, topics) => {
   return postionInfos;
 };
 
-const fetchFirstSubjectiveTopicPositionInfo = (topics) => {
-  return topics.findIndex((item) => item.sign === "subjective");
-};
+// const fetchFirstSubjectiveTopicPositionInfo = (topics) => {
+//   return topics.findIndex((item) => item.sign === "subjective");
+// };
 
 const fetchSameSerialNumberChildrenPositionInfo = (
   elementChildernElement,
@@ -287,28 +287,16 @@ const actions = {
   // 新增试题 --------------->
   addElement({ state, commit, dispatch }, element) {
     let pos = null;
-    // 客观题和主观题分别对待
     if (element.insertTopic && element.insertTopic.id) {
       // 存在插入目标元素
-      if (
-        element.insertTopic.type === "FILL_QUESTION" &&
-        element.type !== "FILL_QUESTION"
-      ) {
-        pos = fetchFirstSubjectiveTopicPositionInfo(state.topics);
-      } else {
-        let relateTopicPos = [];
-        state.topics.forEach((item, index) => {
-          if (item.parent && item.parent.id === element.insertTopic.id)
-            relateTopicPos.push(index);
-        });
-        pos = relateTopicPos.slice(-1)[0] + 1;
-      }
+      let relateTopicPos = [];
+      state.topics.forEach((item, index) => {
+        if (item.parent && item.parent.id === element.insertTopic.id)
+          relateTopicPos.push(index);
+      });
+      pos = relateTopicPos.slice(-1)[0] + 1;
+
       delete element.insertTopic;
-    } else {
-      // 不存在插入目标元素
-      if (element.sign === "objective") {
-        pos = fetchFirstSubjectiveTopicPositionInfo(state.topics);
-      }
     }
 
     let preElements = createFunc[element.type](element);
@@ -662,10 +650,12 @@ const actions = {
     };
 
     const checkElementIsCurColumnFirstType = (element) => {
-      const topicHeadIndex = curColumnElements.findIndex(
-        (elem) => elem.type === "TOPIC_HEAD" && elem.sign === element.sign
-      );
-      return topicHeadIndex === -1;
+      const lastElement = curColumnElements.slice(-1)[0];
+      if (lastElement) {
+        return lastElement.sign !== element.sign;
+      } else {
+        return true;
+      }
     };
 
     // 放入元素通用流程

+ 1 - 1
src/modules/card/autoBuild/simplePaperCard.js

@@ -79,7 +79,7 @@ function parsePaperStruct(paperSimpleStruct) {
     }
   });
 
-  structList.sort((a, b) => a.sortNo - b.sortNo);
+  // structList.sort((a, b) => a.sortNo - b.sortNo);
   // console.log(structList);
   return structList;
 }

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません