zhangjie 2 years ago
parent
commit
fe80c6afc7

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

@@ -1155,7 +1155,7 @@
 
     &:first-child {
       text-align: right;
-      border-color: transparent;
+      border: none;
       font-size: 12px;
       color: #000;
       > i {

+ 4 - 3
card/components/ElementPropEdit.vue

@@ -116,8 +116,9 @@ export default {
           topic.startNumber + topic.questionsCount - 1
         ];
         return (
-          (er[0] <= tr[1] && er[0] >= tr[0]) ||
-          (er[1] <= tr[1] && er[1] >= tr[0])
+          (er[0] <= tr[0] && er[1] >= tr[0]) ||
+          (er[0] <= tr[1] && er[1] >= tr[1]) ||
+          (er[0] >= tr[0] && er[1] <= tr[1])
         );
       });
 
@@ -125,7 +126,7 @@ export default {
     },
     modified(element) {
       // 在不校验大题号重复的情况下,需要校验小题号重复
-      if (!this.checkTopic(element)) {
+      if (!element["container"] && !this.checkTopic(element)) {
         this.$message.error("小题号重复,请重新设置小题号");
         return;
       }

+ 12 - 21
card/components/PageStructDialog.vue

@@ -42,37 +42,28 @@ export default {
   },
   methods: {
     visibleChange() {
-      let structData = {};
-      let curTopicNo = "";
+      let structData = [];
+      let curTopicId = 0;
       this.topics.forEach(topic => {
         if (!topic.parent) return;
-        curTopicNo = topic.parent.topicNo;
-        let questionsCount = 0;
-        if (topic.type === "EXPLAIN") {
-          questionsCount = topic.parent.questionsCount;
-        } else if (topic.type === "COMPOSITION") {
-          questionsCount = 1;
-        } else {
-          questionsCount = topic.questionsCount;
-        }
 
-        if (structData[curTopicNo]) {
-          if (topic.type !== "EXPLAIN") {
-            structData[curTopicNo].questionsCount += questionsCount;
+        if (curTopicId !== topic.parent.id) {
+          curTopicId = topic.parent.id;
+          let questionsCount = 0;
+          if (topic.type === "COMPOSITION") {
+            questionsCount = 1;
+          } else {
+            questionsCount = topic.parent.questionsCount;
           }
-        } else {
-          let sd = {
-            topicNo: curTopicNo,
+          let data = {
+            topicNo: topic.parent.topicNo,
             topicName: topic.parent.topicName,
             questionsCount
           };
-
-          structData[curTopicNo] = sd;
+          structData.push(data);
         }
       });
 
-      structData = Object.values(structData);
-      structData.sort((a, b) => a.topicNo - b.topicNo);
       this.structData = structData;
     },
     cancel() {

File diff suppressed because it is too large
+ 0 - 0
card/previewTemp.js


Some files were not shown because too many files changed in this diff