Browse Source

选项显示为多列, 多选题的类型,改为:多选题(x~x个)

Mask96 4 years ago
parent
commit
68d457abbb
1 changed files with 36 additions and 5 deletions
  1. 36 5
      src/components/WebQn.vue

+ 36 - 5
src/components/WebQn.vue

@@ -32,6 +32,7 @@
           <span class="h3">{{questionHEAD + 1}}、</span>
           <span class="h3">{{questionHEAD + 1}}、</span>
           <span class="h3" style="margin-left: 5;">[</span>
           <span class="h3" style="margin-left: 5;">[</span>
           <span class="h3">{{questionType}}</span>
           <span class="h3">{{questionType}}</span>
+          <span class="h3">{{multipleTip}}</span>
           <span class="h3" style="margin-right: 5;">]</span>
           <span class="h3" style="margin-right: 5;">]</span>
         </div>
         </div>
 
 
@@ -41,12 +42,14 @@
       </div>
       </div>
 
 
       <mt-radio
       <mt-radio
+        style="display: inline-block;"
         v-if="questionType == '单选题'"
         v-if="questionType == '单选题'"
         v-model="selectedSingle"
         v-model="selectedSingle"
         :options="questionOptions"
         :options="questionOptions"
         @change="onOptionSelected"
         @change="onOptionSelected"
       ></mt-radio>
       ></mt-radio>
       <mt-checklist
       <mt-checklist
+        style="display: inline-block;"
         v-else-if="questionType == '多选题'"
         v-else-if="questionType == '多选题'"
         v-model="selectedMultiple"
         v-model="selectedMultiple"
         :options="questionOptions"
         :options="questionOptions"
@@ -238,6 +241,21 @@ export default {
         return "开放题";
         return "开放题";
       }
       }
     },
     },
+    multipleTip() {
+      let type = this.currentQuestion.type;
+      if (type == 1) {
+        if (this.currentQuestion.maxOptions > 1) {
+          return (
+            "(" +
+            this.currentQuestion.minOptions +
+            "-" +
+            this.currentQuestion.maxOptions +
+            "个)"
+          );
+        }
+      }
+      return "";
+    },
     questionBody() {
     questionBody() {
       // 处理${ID}的情况
       // 处理${ID}的情况
       return this.replaceDollarId(this.currentQuestion.body);
       return this.replaceDollarId(this.currentQuestion.body);
@@ -444,11 +462,9 @@ export default {
         let isUnselect = this.lastCheckList.length > index.length;
         let isUnselect = this.lastCheckList.length > index.length;
 
 
         if (isUnselect) {
         if (isUnselect) {
-          let selSet = new Set(index)
-          let lastSet = new Set(this.lastCheckList)
-          let unselectSet = new Set(
-            [...lastSet].filter(x => !selSet.has(x))
-          );
+          let selSet = new Set(index);
+          let lastSet = new Set(this.lastCheckList);
+          let unselectSet = new Set([...lastSet].filter(x => !selSet.has(x)));
           let unselectItem = Array.from(unselectSet)[0];
           let unselectItem = Array.from(unselectSet)[0];
 
 
           for (
           for (
@@ -875,4 +891,19 @@ export default {
 .select-open-dialog textarea {
 .select-open-dialog textarea {
   height: 100px;
   height: 100px;
 }
 }
+.mint-cell {
+  display: inherit;
+}
+
+/* 取消选择框上下线 */
+.mint-cell-wrapper {
+  background-image: none;
+}
+.mint-cell:last-child {
+  background-image: none;
+}
+/* .mint-radio-input:checked + .mint-radio-core {
+  background-color: #e80413;
+  border-color: #e80413;
+} */
 </style>
 </style>