소스 검색

调整页面

wangxy 3 주 전
부모
커밋
19eda40195
5개의 변경된 파일21개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 0
      components/questions/danxuan.vue
  2. 4 0
      components/questions/duoxuan.vue
  3. 3 0
      components/questions/panduan.vue
  4. 7 1
      components/questions/tiankong.vue
  5. 4 6
      pages/client/Kaoshi/exam.vue

+ 3 - 0
components/questions/danxuan.vue

@@ -37,6 +37,8 @@
 		}
 	})
 
+  const emits = defineEmits(['change'])
+
 	const data = reactive({
 		name: '', //题干数据
 		contents: [], // 选项数据
@@ -81,5 +83,6 @@
 			return;
 		}
 		props.question.reply = index;
+    emits('change')
 	}
 </script>

+ 4 - 0
components/questions/duoxuan.vue

@@ -42,6 +42,8 @@
 		contents: [], // 选项数据
 	})
 
+  const emits = defineEmits(['change'])
+
 	watch(() => props.question, (val) => formatData(val), {
 		immediate: true
 	})
@@ -83,5 +85,7 @@
 				props.question.reply.push(index);
 			}
 		}
+
+    emits('change')
 	}
 </script>

+ 3 - 0
components/questions/panduan.vue

@@ -30,11 +30,14 @@
 		}
 	})
 
+  const emits = defineEmits(['change'])
+
 	function radioChange(e) {
 		if (props.showError) {
 			return;
 		}
 		props.question.reply = e.detail.value;
+		emits('change')
 	}
 	
 	function formatClass(index) {

+ 7 - 1
components/questions/tiankong.vue

@@ -8,7 +8,7 @@
 		<!-- 选项区域 -->
 		<view v-for="(item,index) in question.reply" class="tiankong-option-box" :key="index" :class="formatClass(index)">
 			<text class="option-question">填空{{index+1}}:</text>
-			<input type="text" v-model="question.reply[index]" class="option-question-text" :placeholder="`请输入填空${index+1}答案`">
+			<input type="text" v-model="question.reply[index]" class="option-question-text" :placeholder="`请输入填空${index+1}答案`" @blur="handleBlur">
 		</view>
 	</view>
 </template>
@@ -32,4 +32,10 @@
 			}
 		}
 	}
+
+  const emits = defineEmits(['change'])
+
+  function handleBlur() {
+    emits('change')
+  }
 </script>

+ 4 - 6
pages/client/Kaoshi/exam.vue

@@ -19,19 +19,19 @@
 			<view v-if="activeSt">
 				<template v-if="activeSt.stTypeId == 1">
 					<!-- 单选 -->
-					<danxuan :question="activeSt" :key="activeSt.stId"></danxuan>
+					<danxuan :question="activeSt" :key="activeSt.stId" @change="handleSave1"></danxuan>
 				</template>
 				<template v-if="activeSt.stTypeId == 2">
 					<!-- 多选 -->
-					<duoxuan :question="activeSt" :key="activeSt.stId"></duoxuan>
+					<duoxuan :question="activeSt" :key="activeSt.stId" @change="handleSave1"></duoxuan>
 				</template>
 				<template v-if="activeSt.stTypeId == 3">
 					<!-- 判断 -->
-					<panduan :question="activeSt" :key="activeSt.stId"></panduan>
+					<panduan :question="activeSt" :key="activeSt.stId" @change="handleSave1"></panduan>
 				</template>
 				<template v-if="activeSt.stTypeId == 4">
 					<!-- 填空 -->
-					<tiankong :question="activeSt" :key="activeSt.stId"></tiankong>
+					<tiankong :question="activeSt" :key="activeSt.stId" @change="handleSave1"></tiankong>
 				</template>
 			</view>
 
@@ -598,7 +598,6 @@
 			progress.dlIndex = result.dlIndex;
 			progress.dtIndex = result.dtIndex
 		}
-		handleSave1()
 	}
 
 	function handleNext() {
@@ -609,7 +608,6 @@
 			progress.dlIndex = result.dlIndex;
 			progress.dtIndex = result.dtIndex
 		}
-		handleSave1()
 	}
 
 	function formatDuanluoList(dlData) {