Эх сурвалжийг харах

客观题新增题型标志

zhangjie 4 жил өмнө
parent
commit
cd32de062f

+ 1 - 0
card/INTRODUCTION.md

@@ -33,6 +33,7 @@
 - 客观题和主观题改变大题顺序。
 - 在当前大题下新建大题。
 - 所有试题元素新增最小高度字段。
+- 客观题编辑时新增题型标志。
 
 ## v0.1.0
 

+ 34 - 0
card/assets/styles/card-design.scss

@@ -187,6 +187,40 @@
         }
       }
     }
+
+    // 客观题强调标记
+    .elem-fill-question {
+      &::before {
+        content: "";
+        position: absolute;
+        right: 0;
+        top: 0;
+        z-index: 99;
+        color: #fff;
+        padding: 6px 10px;
+        line-height: 1;
+        font-size: 20px;
+        border-bottom-left-radius: 10px;
+      }
+    }
+    .elem-fill-question-simple {
+      &::before {
+        content: "单选";
+        background-color: $--color-success;
+      }
+    }
+    .elem-fill-question-multiply {
+      &::before {
+        content: "多选";
+        background-color: $--color-blue-white;
+      }
+    }
+    .elem-fill-question-boolean {
+      &::before {
+        content: "判断";
+        background-color: $--color-warning;
+      }
+    }
   }
 
   // page-main-outer

+ 7 - 1
card/elements/fill-question/ElemFillQuestion.vue

@@ -42,7 +42,13 @@ export default {
     classes() {
       return [
         "elem-fill-question",
-        `elem-fill-question-${this.data.optionDirection}`
+        `elem-fill-question-${this.data.optionDirection}`,
+        {
+          "elem-fill-question-simple":
+            !this.data.isMultiply && !this.data.isBoolean,
+          "elem-fill-question-multiply": this.data.isMultiply,
+          "elem-fill-question-boolean": this.data.isBoolean
+        }
       ];
     },
     groupGapStyles() {

+ 8 - 9
card/views/CardDesign.vue

@@ -449,15 +449,14 @@ export default {
       // });
       const result = await this.save();
       if (!result) return;
-      window.open(
-        this.getRouterPath({
-          name: "CardPreview",
-          params: {
-            cardId: this.cardId,
-            viewType: "view"
-          }
-        })
-      );
+      const { href } = this.$router.resolve({
+        name: "CardPreview",
+        params: {
+          cardId: this.cardId,
+          viewType: "view"
+        }
+      });
+      window.open(href);
     },
     swithPage(pindex) {
       if (this.curPageNo === pindex) return;