|
|
@@ -1,311 +1,174 @@
|
|
|
<template>
|
|
|
- <!-- 能力测评 -->
|
|
|
- <div class="home-container">
|
|
|
- <el-row class="test-paper">
|
|
|
- <el-col class="answer-sheet" span="12">
|
|
|
- <el-card style="min-height: 100%" shadow="hover">
|
|
|
- <h4>序号:</h4>
|
|
|
- <div class="all-serial-number">
|
|
|
- <el-button
|
|
|
- @click="handleLeft(index)"
|
|
|
- v-for="(item, index) in state.examDetails"
|
|
|
- :key="index"
|
|
|
- class="serial-number"
|
|
|
- size="mini"
|
|
|
- :class="{ 'yi-zuo-da': item.da.length != 0 }"
|
|
|
- >
|
|
|
- {{ index + 1 }}
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-button @click="getSubmit" type="primary" plain>提 交</el-button>
|
|
|
+ <div class="test-topic">
|
|
|
+ <!-- 测试标题 -->
|
|
|
+ <div class="test-title" @click="handleClick">
|
|
|
+ <el-icon><ArrowLeftBold /></el-icon>
|
|
|
+ 在线测试
|
|
|
+ </div>
|
|
|
+ <!-- 测试内容 -->
|
|
|
+ <div class="test-content">
|
|
|
+ <!-- 左侧 题目 -->
|
|
|
+ <div class="content-left">
|
|
|
+ <div class="question-container">
|
|
|
+ <!-- 添加题目进度显示 -->
|
|
|
+ <div class="question-progress">
|
|
|
+ 第 {{ currentQuestionIndex + 1 }}/{{ questions.length }} 题
|
|
|
</div>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col class="test-questions" span="12">
|
|
|
- <el-card shadow="hover">
|
|
|
- <div
|
|
|
- @click="getChenge"
|
|
|
- v-for="(shiTi, index) in state.examDetails"
|
|
|
- :key="index"
|
|
|
- :id="'id' + index"
|
|
|
- class="exam-details"
|
|
|
- :class="{ 'skip-style': index === state.navgatorIndex }"
|
|
|
- >
|
|
|
- <!-- 试题 -->
|
|
|
- <div class="shi-ti-style">
|
|
|
- <!-- 题目 -->
|
|
|
- <div>{{ index + 1 }}、{{ shiTi.timu }}</div>
|
|
|
- <!-- 选项 -->
|
|
|
- <div class="xuan-xiang-style">
|
|
|
- <!-- 单选 -->
|
|
|
- <el-radio-group
|
|
|
- @input="gegegegeg(shiTi, index)"
|
|
|
- v-if="shiTi.type == '单选'"
|
|
|
- v-model="shiTi.da"
|
|
|
- >
|
|
|
- <el-radio
|
|
|
- v-for="(dan, danIdnex) in shiTi.xuanxiang"
|
|
|
- :label="danIdnex"
|
|
|
- :key="danIdnex"
|
|
|
- >
|
|
|
- {{ dan }}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
- <!-- 多选 -->
|
|
|
- <el-checkbox-group
|
|
|
- @change="gegegegeg(shiTi, index)"
|
|
|
- v-else-if="shiTi.type == '多选'"
|
|
|
- v-model="shiTi.da"
|
|
|
+ <!-- 添加题目内容 -->
|
|
|
+ <div class="question-content">
|
|
|
+ <!-- 题目 -->
|
|
|
+ <div class="question-title" v-html="questions[currentQuestionIndex]?.qcontent"></div>
|
|
|
+ <!-- 选项 -->
|
|
|
+ <div class="question-options">
|
|
|
+ <el-radio-group
|
|
|
+ v-model="selectedOption"
|
|
|
+ size="large"
|
|
|
+ class="radio-button-group custom-radio-group"
|
|
|
+ >
|
|
|
+ <el-radio-button
|
|
|
+ v-for="(option, index) in questions[currentQuestionIndex]?.questionOptionsList || []"
|
|
|
+ :key="option.oid"
|
|
|
+ :label="option.ovalue"
|
|
|
+ >{{ option.ovalue }}. {{ option.oname }}</el-radio-button
|
|
|
>
|
|
|
- <el-checkbox
|
|
|
- v-for="(duo, duoIndex) in shiTi.xuanxiang"
|
|
|
- :label="duoIndex"
|
|
|
- :key="duoIndex"
|
|
|
- >
|
|
|
- {{ duo }}
|
|
|
- </el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
- <!-- 问答 -->
|
|
|
- <div v-else>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- :rows="2"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="shiTi.da"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </el-radio-group>
|
|
|
</div>
|
|
|
- <!-- 标记 @click="getChangMark(index)"-->
|
|
|
- <div class="mark-style">
|
|
|
- <el-tooltip
|
|
|
- :content="shiTi.mark ? '已标记' : '可标记'"
|
|
|
- placement="right"
|
|
|
- effect="light"
|
|
|
+ </div>
|
|
|
+ <!-- 添加题目导航按钮盒子 -->
|
|
|
+ <div class="question-navigation">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ border
|
|
|
+ class="prev-question-btn"
|
|
|
+ @click="handlePrevQuestion"
|
|
|
+ >上一题</el-button
|
|
|
+ >
|
|
|
+ <!-- 修改下一题按钮样式 -->
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="next-question-btn"
|
|
|
+ @click="handleNextQuestion"
|
|
|
+ >下一题</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 右侧答题卡 -->
|
|
|
+ <div class="content-right">
|
|
|
+ <div class="center-box">
|
|
|
+ <div class="box-title">答题卡</div>
|
|
|
+ <div class="box-content">
|
|
|
+ <div class="number-buttons">
|
|
|
+ <el-button
|
|
|
+ v-for="num in questions.length"
|
|
|
+ :key="num"
|
|
|
+ class="circle-btn"
|
|
|
+ :class="{ clicked: clickedNumbers.includes(num) }"
|
|
|
+ @click="handleButtonClick(num)"
|
|
|
+ >{{ num }}</el-button
|
|
|
>
|
|
|
- <a
|
|
|
- @click="getChangMark(index)"
|
|
|
- class="el-icon-star-on"
|
|
|
- :class="{ mark: shiTi.mark }"
|
|
|
- />
|
|
|
- </el-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { reactive, onMounted, onUnmounted, ref } from 'vue'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
+import { ref,watch ,onMounted} from 'vue'
|
|
|
+import { ArrowLeftBold } from '@element-plus/icons-vue'
|
|
|
+import { useRouter,useRoute } from 'vue-router'
|
|
|
|
|
|
-// 定义响应式数据
|
|
|
-const state = reactive({
|
|
|
- examDetails: [
|
|
|
- {
|
|
|
- timu: '《山行》是描绘了( C )的景色。',
|
|
|
- type: '单选',
|
|
|
- xuanxiang: ['A、春天', 'B、夏天', 'C、秋天', ' D、冬天'],
|
|
|
- // 答案存放字符串
|
|
|
- da: '',
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '劝君更尽一杯酒,西出阳关无故人。”出自( B )的名句。',
|
|
|
- type: '单选',
|
|
|
- xuanxiang: ['A、李白', 'B、王维', 'C、王昌龄', 'D、杜牧'],
|
|
|
- // 答案存放字符串
|
|
|
- da: '',
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '把“春风”比作“剪刀”的是哪首诗?( C )',
|
|
|
- type: '单选',
|
|
|
- xuanxiang: [
|
|
|
- 'A、《忆江南》',
|
|
|
- 'B、《滁州西涧》',
|
|
|
- 'C、《咏柳》',
|
|
|
- 'D、《游园不值》'
|
|
|
- ],
|
|
|
- // 答案存放字符串
|
|
|
- da: '',
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '横看成岭侧成峰,远近高低各不一样。”诗中写的名胜是( D )。',
|
|
|
- type: '单选',
|
|
|
- xuanxiang: ['A、泰山', 'B、华山', 'C、黄山', 'D、庐山'],
|
|
|
- // 答案存放字符串
|
|
|
- da: '',
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '解落三秋叶,能开二月花。过江千尺浪,入竹万竿斜。”这首诗写的是( B )。',
|
|
|
- type: '单选',
|
|
|
- xuanxiang: ['A、花', 'B、风', 'C、竹', 'D、水'],
|
|
|
- // 答案存放字符串
|
|
|
- da: '',
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '以下哪些诗句出自白居易的作品?( A、C、E )',
|
|
|
- type: '多选',
|
|
|
- xuanxiang: [
|
|
|
- 'A、春风又绿江南岸',
|
|
|
- 'B、白日依山尽',
|
|
|
- 'C、人生自古谁无死',
|
|
|
- 'D、大漠孤烟直',
|
|
|
- 'E、举杯邀明月',
|
|
|
- 'F、月落乌啼霜满天'
|
|
|
- ],
|
|
|
- // 答案存放数组
|
|
|
- da: [0, 2, 4],
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '以下哪些是唐代诗人?( A、B、C、E、F )',
|
|
|
- type: '多选',
|
|
|
- xuanxiang: [
|
|
|
- 'A、杜甫',
|
|
|
- 'B、苏轼',
|
|
|
- 'C、白居易',
|
|
|
- 'D、李清照',
|
|
|
- 'E、辛弃疾',
|
|
|
- 'F、陆游'
|
|
|
- ],
|
|
|
- // 答案存放数组
|
|
|
- da: [],
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '以下哪些诗人被称为“唐三百首”?( A、B、C )',
|
|
|
- type: '多选',
|
|
|
- xuanxiang: ['A、李白', 'B、杜甫', 'C、白居易', 'D、苏轼', 'E、王之涣'],
|
|
|
- // 答案存放数组
|
|
|
- da: [],
|
|
|
- mark: false
|
|
|
- },
|
|
|
- {
|
|
|
- timu: '以下哪些诗人被称为“宋词四大家”?( A、B、C、D )',
|
|
|
- type: '多选',
|
|
|
- xuanxiang: ['A、李清照', 'B、辛弃疾', 'C、苏轼', 'D、杜牧', 'E、杨万里'],
|
|
|
- // 答案存放数组
|
|
|
- da: [],
|
|
|
- mark: false
|
|
|
- },
|
|
|
- // {
|
|
|
- // timu: '具有诗仙、诗圣、诗鬼称号的的诗人分别是谁?',
|
|
|
- // type: '问答',
|
|
|
- // xuanxiang: ['李白 杜甫 李贺'],
|
|
|
- // // 答案存放字符串
|
|
|
- // da: '',
|
|
|
- // mark: false
|
|
|
- // },
|
|
|
- // {
|
|
|
- // timu: '在苏轼写的《惠崇春江晚景》这首中,让我们明白了有一种味美但内脏有毒的鱼叫什么?',
|
|
|
- // type: '问答',
|
|
|
- // xuanxiang: ['河豚'],
|
|
|
- // // 答案存放字符串
|
|
|
- // da: '',
|
|
|
- // mark: false
|
|
|
- // }
|
|
|
- ],
|
|
|
- navgatorIndex: null,
|
|
|
- listBoxState: true,
|
|
|
- isSkip: true,
|
|
|
- isShiTi: false,
|
|
|
- listBox: null
|
|
|
-})
|
|
|
+import { QuestionTopicList } from '@/api/question/test.js'
|
|
|
|
|
|
-// DOM引用
|
|
|
-const scrollContainer = ref(null)
|
|
|
-let timeId = null
|
|
|
+const router = useRouter()
|
|
|
+const route = useRoute()
|
|
|
|
|
|
-// 页面滚动处理函数
|
|
|
-const handleScroll = () => {
|
|
|
- clearTimeout(timeId)
|
|
|
- timeId = setTimeout(() => {
|
|
|
- scrollToTop()
|
|
|
- console.log('执行完成')
|
|
|
- }, 100)
|
|
|
-}
|
|
|
+const selectedOption = ref(null)
|
|
|
+const clickedNumbers = ref([])
|
|
|
+// 当前题目索引
|
|
|
+const currentQuestionIndex = ref(0)
|
|
|
+const userAnswers = ref([]) // 存储用户答案
|
|
|
|
|
|
-// 点击导航菜单滚动到指定位置
|
|
|
-const handleLeft = index => {
|
|
|
- state.navgatorIndex = index
|
|
|
- const element = document.getElementById(`id${index}`)
|
|
|
- if (element) {
|
|
|
- element.scrollIntoView({
|
|
|
- top: '100px',
|
|
|
- behavior: 'smooth',
|
|
|
- block: 'center'
|
|
|
- })
|
|
|
- }
|
|
|
- state.listBoxState = false
|
|
|
- clearTimeout(timeId)
|
|
|
- timeId = setTimeout(() => {
|
|
|
- state.listBoxState = true
|
|
|
- }, 200)
|
|
|
+const handleClick = () => {
|
|
|
+ router.push({
|
|
|
+ path: '/evaluation',
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-// 监听页面滚动改变导航选中状态
|
|
|
-const scrollToTop = () => {
|
|
|
- const scrollTop =
|
|
|
- window.pageYOffset ||
|
|
|
- document.documentElement.scrollTop ||
|
|
|
- document.body.scrollTop
|
|
|
- if (state.listBoxState && state.listBox) {
|
|
|
- state.listBox.forEach((_, i) => {
|
|
|
- const element = document.getElementById(`id${i}`)
|
|
|
- if (element) {
|
|
|
- const offsetTop = element.offsetTop
|
|
|
- const scrollHeight = element.scrollHeight
|
|
|
- if (scrollTop >= offsetTop && scrollTop <= offsetTop + scrollHeight) {
|
|
|
- state.navgatorIndex = i
|
|
|
- }
|
|
|
+// 添加题目数据
|
|
|
+const questions = ref([
|
|
|
+])
|
|
|
+
|
|
|
+onMounted(()=>{
|
|
|
+ // 获取路由参数中的id
|
|
|
+ const id = route.query.id
|
|
|
+ console.log(id);
|
|
|
+ if (id) {
|
|
|
+ // 将id作为参数传递给QuestionTopicList接口
|
|
|
+ QuestionTopicList({ qrId: id }).then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ // 将接口返回的题目数据赋值给questions
|
|
|
+ questions.value = res.data.questionList || []
|
|
|
+ // 初始化currentQuestionIndex,防止越界
|
|
|
+ if (questions.value.length > 0) {
|
|
|
+ currentQuestionIndex.value = 0
|
|
|
}
|
|
|
+ console.log(questions.value);
|
|
|
+ }).catch(err => {
|
|
|
+ console.error('获取题目失败:', err)
|
|
|
})
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-// 标记或收藏题目
|
|
|
-// const getChangMark = num => {
|
|
|
-// state.examDetails[num].mark = !state.examDetails[num].mark
|
|
|
-// }
|
|
|
+})
|
|
|
|
|
|
-const gegegegeg = (val, num) => {
|
|
|
- console.log(val)
|
|
|
+// 上一题按钮逻辑
|
|
|
+const handlePrevQuestion = () => {
|
|
|
+ if (currentQuestionIndex.value > 0) {
|
|
|
+ // 保存当前题目的答案
|
|
|
+ userAnswers.value[currentQuestionIndex.value] = selectedOption.value;
|
|
|
+ currentQuestionIndex.value--;
|
|
|
+ // 加载上一题的答案
|
|
|
+ selectedOption.value = userAnswers.value[currentQuestionIndex.value] || null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-// 取消跳转样式
|
|
|
-const getChenge = () => {
|
|
|
- state.navgatorIndex = null
|
|
|
+// 下一题按钮逻辑
|
|
|
+const handleNextQuestion = () => {
|
|
|
+ if (currentQuestionIndex.value < questions.value.length - 1) {
|
|
|
+ // 保存当前题目的答案
|
|
|
+ userAnswers.value[currentQuestionIndex.value] = selectedOption.value;
|
|
|
+ currentQuestionIndex.value++;
|
|
|
+ // 加载下一题的答案
|
|
|
+ selectedOption.value = userAnswers.value[currentQuestionIndex.value] || null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-// 提交答案
|
|
|
-const getSubmit = () => {
|
|
|
- console.log(state.examDetails)
|
|
|
- const list = state.examDetails.map(item => item.da)
|
|
|
- console.log(list)
|
|
|
- ElMessage({
|
|
|
- message: JSON.stringify(list),
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
+// 答题卡
|
|
|
+const handleButtonClick = (num) => {
|
|
|
+ // 切换到对应题目
|
|
|
+ currentQuestionIndex.value = num - 1
|
|
|
+ // 加载该题目的答案
|
|
|
+ selectedOption.value = userAnswers.value[currentQuestionIndex.value] || null
|
|
|
+ // 答题卡选中状态切换逻辑
|
|
|
+ // if (clickedNumbers.value.includes(num)) {
|
|
|
+ // clickedNumbers.value = clickedNumbers.value.filter(n => n !== num)
|
|
|
+ // } else {
|
|
|
+ // clickedNumbers.value.push(num)
|
|
|
+ // }
|
|
|
}
|
|
|
-
|
|
|
-// 生命周期钩子
|
|
|
-onMounted(() => {
|
|
|
- window.addEventListener('scroll', handleScroll, true)
|
|
|
+// 监听选项变化,自动更新答题卡状态
|
|
|
+watch(selectedOption, (newVal) => {
|
|
|
+ if (newVal !== null) {
|
|
|
+ const currentQuestionNumber = currentQuestionIndex.value + 1
|
|
|
+ // 保存当前题目的答案
|
|
|
+ userAnswers.value[currentQuestionIndex.value] = newVal
|
|
|
+ if (!clickedNumbers.value.includes(currentQuestionNumber)) {
|
|
|
+ clickedNumbers.value.push(currentQuestionNumber)
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
-onUnmounted(() => {
|
|
|
- window.removeEventListener('scroll', handleScroll, true)
|
|
|
- clearTimeout(timeId)
|
|
|
-})
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
@@ -314,109 +177,210 @@ onUnmounted(() => {
|
|
|
@function rpx($px) {
|
|
|
@return math.div($px, 750) * 100vw;
|
|
|
}
|
|
|
-.home-container {
|
|
|
+.test-topic {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
- background: linear-gradient(to bottom, #001169, #8a78d0);
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
+ background-color: #e2ddfc;
|
|
|
gap: rpx(0);
|
|
|
- font-size: rpx(8);
|
|
|
}
|
|
|
-.test-paper {
|
|
|
+.test-title {
|
|
|
+ width: 100%;
|
|
|
+ height: rpx(30);
|
|
|
+ font-size: rpx(10);
|
|
|
+ cursor: pointer;
|
|
|
+ color: black;
|
|
|
+ display: flex; /* 设置flex布局 */
|
|
|
+ align-items: center; /* 垂直居中 */
|
|
|
+ padding-left: rpx(15); /* 添加左侧内边距 */
|
|
|
+ gap: rpx(5); /* 设置图标和文字间距 */
|
|
|
+}
|
|
|
+.test-content {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ display: flex; /* 使用flex布局使子元素并排 */
|
|
|
+ gap: rpx(10); /* 左右盒子间距 */
|
|
|
}
|
|
|
-:deep(.el-card__body) {
|
|
|
- min-height: 100%;
|
|
|
+// 左侧盒子样式 题目
|
|
|
+.content-left {
|
|
|
+ flex: 1.5;
|
|
|
+ border-radius: rpx(5);
|
|
|
+ padding: rpx(10);
|
|
|
}
|
|
|
-.el-card {
|
|
|
- border: none;
|
|
|
- // background: linear-gradient(to bottom, #e2ddfc, #f1effd);
|
|
|
+.question-container {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding-left: rpx(40);
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative; // 相对定位
|
|
|
}
|
|
|
-.answer-sheet {
|
|
|
- width: rpx(140);
|
|
|
- display: inline-block;
|
|
|
- margin-right: rpx(5);
|
|
|
+/* 添加题目进度样式 */
|
|
|
+.question-progress {
|
|
|
+ font-size: rpx(12);
|
|
|
+ font-weight: bold;
|
|
|
+ color: #9e78e7;
|
|
|
text-align: left;
|
|
|
}
|
|
|
-.test-questions {
|
|
|
- flex: 1;
|
|
|
- height: 100%;
|
|
|
- display: inline-block;
|
|
|
- text-align: left;
|
|
|
- overflow-y: auto; /* 启用垂直滚动 */
|
|
|
+// 题目
|
|
|
+.question-content {
|
|
|
+ // margin-top: 20px;
|
|
|
+ ::v-deep(.el-radio-button) {
|
|
|
+ // 添加选项选中状态样式
|
|
|
+ &.is-active .el-radio-button__inner {
|
|
|
+ background-color: #9e78e7;
|
|
|
+ border-color: #9e78e7;
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-.test-questions .el-card::-webkit-scrollbar {
|
|
|
- width: rpx(2);
|
|
|
+.question-title {
|
|
|
+ font-size: rpx(12);
|
|
|
+ text-align: left;
|
|
|
+ color: black;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ line-height: 1.5;
|
|
|
}
|
|
|
-.test-questions .el-card::-webkit-scrollbar-thumb {
|
|
|
- background-color: #ddd;
|
|
|
- border-radius: 3px;
|
|
|
+.question-options {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 10px;
|
|
|
}
|
|
|
-</style>
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-@use 'sass:math';
|
|
|
-// 定义rpx转换函数
|
|
|
-@function rpx($px) {
|
|
|
- @return math.div($px, 750) * 100vw;
|
|
|
+.radio-button-group {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ text-align: left;
|
|
|
+ gap: 10px;
|
|
|
}
|
|
|
-/* 具体样式:答题卡样式 */
|
|
|
-.all-serial-number {
|
|
|
+.el-radio-button {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: rpx(10);
|
|
|
+ justify-content: flex-start;
|
|
|
}
|
|
|
-.serial-number {
|
|
|
- margin: rpx(5);
|
|
|
- width: rpx(15);
|
|
|
- height: rpx(15);
|
|
|
+.el-radio-button ::v-deep(.el-radio-button__inner) {
|
|
|
+ width: fit-content; //按钮宽度跟随文字多少变化
|
|
|
+ height: rpx(25);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ text-align: left;
|
|
|
font-size: rpx(8);
|
|
|
+ border-radius: rpx(5);
|
|
|
+ color: black;
|
|
|
+ border: 1px solid white;
|
|
|
+ background: rgb(255, 255, 255, 0.5);
|
|
|
}
|
|
|
-/* 具体样式:试题样式 */
|
|
|
-.exam-details {
|
|
|
- margin-bottom: rpx(5);
|
|
|
- padding: rpx(5);
|
|
|
- border: 1px solid #001169;
|
|
|
+// 上一题 下一题按钮
|
|
|
+/* 添加导航按钮样式 */
|
|
|
+.question-navigation {
|
|
|
+ display: flex;
|
|
|
+ margin-top: rpx(20); // 与题目内容保持间距
|
|
|
+ // 绝对定位到底部
|
|
|
+ position: absolute;
|
|
|
+ bottom: rpx(25);
|
|
|
+ left: rpx(40);
|
|
|
+ right: 0;
|
|
|
+ // 上一题按钮样式
|
|
|
+ ::v-deep(.prev-question-btn) {
|
|
|
+ border: 1px solid #9e78e7; // 添加边框
|
|
|
+ color: #9e78e7; // 设置文字颜色
|
|
|
+ font-size: rpx(8);
|
|
|
+ background-color: transparent; // 透明背景
|
|
|
+ &:hover {
|
|
|
+ background-color: #9e78e7; // hover效果
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 下一题按钮样式
|
|
|
+ ::v-deep(.next-question-btn) {
|
|
|
+ background-color: #9e78e7; // 更换为紫色
|
|
|
+ border-color: #9e78e7;
|
|
|
+ font-size: rpx(8);
|
|
|
+ &:hover {
|
|
|
+ background-color: #8a63d2; // hover加深颜色
|
|
|
+ border-color: #8a63d2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.question-navigation .el-button {
|
|
|
+ width: rpx(80); // 固定按钮宽度
|
|
|
+ height: rpx(20);
|
|
|
border-radius: rpx(5);
|
|
|
- height: rpx(55);
|
|
|
}
|
|
|
-/* 指定跳转题目样式 */
|
|
|
-.skip-style {
|
|
|
- border: 1px solid rgb(255, 0, 0);
|
|
|
+
|
|
|
+// 右侧盒子样式 答题卡
|
|
|
+.content-right {
|
|
|
+ flex: 1;
|
|
|
+ border-radius: rpx(5);
|
|
|
+ padding: rpx(10);
|
|
|
+ display: flex; /* 使用flex布局 */
|
|
|
+ flex-direction: column; /* 垂直方向排列 */
|
|
|
+ align-items: center; /* 水平居中 */
|
|
|
+ justify-content: center; /* 垂直居中 */
|
|
|
}
|
|
|
-.shi-ti-style {
|
|
|
- display: inline-block;
|
|
|
- // width: calc(100% - 30px);
|
|
|
+// 答题卡
|
|
|
+.center-box {
|
|
|
+ width: rpx(200); /* 宽度 */
|
|
|
+ height: 100%; /* 高度 */
|
|
|
+ background-color: #fefefe80;
|
|
|
+ border-radius: rpx(5);
|
|
|
+ border: 1px solid white;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column; /* 垂直排列子元素 */
|
|
|
+ padding: rpx(10);
|
|
|
+ gap: rpx(5); /* 标题和内容间距 */
|
|
|
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
|
-/* 选项样式 */
|
|
|
-.xuan-xiang-style {
|
|
|
- margin-top: rpx(10);
|
|
|
+// 标题盒子样式
|
|
|
+.box-title {
|
|
|
+ width: 100%;
|
|
|
+ height: rpx(20);
|
|
|
+ font-size: rpx(11);
|
|
|
+ font-weight: bold;
|
|
|
+ border-radius: rpx(3);
|
|
|
+ line-height: rpx(20);
|
|
|
}
|
|
|
-/* 标记样式 */
|
|
|
-// .mark-style {
|
|
|
-// float: right;
|
|
|
-// text-align: center;
|
|
|
-// width: 30px;
|
|
|
-// }
|
|
|
-// .el-icon-star-on {
|
|
|
-// font-size: 25px;
|
|
|
-// }
|
|
|
-// .mark {
|
|
|
-// color: #f7ba2a;
|
|
|
-// }
|
|
|
-</style>
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
-@use 'sass:math';
|
|
|
-// 定义rpx转换函数
|
|
|
-@function rpx($px) {
|
|
|
- @return math.div($px, 750) * 100vw;
|
|
|
+// 内容盒子样式
|
|
|
+.box-content {
|
|
|
+ height: 100%;
|
|
|
+ border-radius: rpx(3);
|
|
|
+ padding: rpx(5);
|
|
|
+ overflow: auto; /* 内容溢出时显示滚动条 */
|
|
|
+}
|
|
|
+// 数字按钮容器
|
|
|
+.number-buttons {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start; // 将center改为flex-start实现左对齐
|
|
|
+ gap: rpx(8);
|
|
|
+ flex-wrap: wrap; // 添加换行属性
|
|
|
+}
|
|
|
+
|
|
|
+// 圆形按钮样式
|
|
|
+.circle-btn {
|
|
|
+ width: rpx(25);
|
|
|
+ height: rpx(25);
|
|
|
+ margin-left: 0;
|
|
|
+ border-radius: 50%; // 圆形显示
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: rpx(10);
|
|
|
+ background-color: transparent;
|
|
|
+ border: 1px solid white;
|
|
|
+ color: #909090;
|
|
|
+ min-width: auto; // 移除Element Plus按钮默认最小宽度
|
|
|
+}
|
|
|
+
|
|
|
+.circle-btn:focus,
|
|
|
+.circle-btn:active,
|
|
|
+.circle-btn.clicked {
|
|
|
+ color: white;
|
|
|
+ background-color: #9e78e7;
|
|
|
}
|
|
|
-/* 联动样式 */
|
|
|
-.yi-zuo-da {
|
|
|
- color: #fff;
|
|
|
- background: dodgerblue;
|
|
|
+.circle-btn:hover{
|
|
|
+ border: 2px solid #9e78e7;
|
|
|
}
|
|
|
</style>
|