|
@@ -7,28 +7,28 @@
|
|
|
<ie-image :is-oss="true" src="/study-title4.png" custom-class="w-282 h-64 absolute top-126 left-72 z-2" />
|
|
<ie-image :is-oss="true" src="/study-title4.png" custom-class="w-282 h-64 absolute top-126 left-72 z-2" />
|
|
|
<view class="relative z-3 pt-244 pb-20 mx-30">
|
|
<view class="relative z-3 pt-244 pb-20 mx-30">
|
|
|
<view class="bg-white rounded-15 px-20 pb-1">
|
|
<view class="bg-white rounded-15 px-20 pb-1">
|
|
|
- <rate-chart :value="50" />
|
|
|
|
|
|
|
+ <rate-chart :value="rightRate" />
|
|
|
<view class="h-1 bg-[#E6E6E6] my-20"></view>
|
|
<view class="h-1 bg-[#E6E6E6] my-20"></view>
|
|
|
<view>
|
|
<view>
|
|
|
<view class="my-20 flex items-center justify-between text-24">
|
|
<view class="my-20 flex items-center justify-between text-24">
|
|
|
<ie-image src="/pagesStudy/static/image/icon-house.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
<ie-image src="/pagesStudy/static/image/icon-house.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
|
<text class="ml-10 text-fore-light flex-1">考试院校</text>
|
|
<text class="ml-10 text-fore-light flex-1">考试院校</text>
|
|
|
- <text class="text-fore-title">长沙民政职业技术学院-大数据与会计</text>
|
|
|
|
|
|
|
+ <text class="text-fore-title">{{ examineeData.collegeName }}-{{ examineeData.majorName }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="my-20 flex items-center justify-between text-24">
|
|
<view class="my-20 flex items-center justify-between text-24">
|
|
|
<ie-image src="/pagesStudy/static/image/icon-group.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
<ie-image src="/pagesStudy/static/image/icon-group.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
|
- <text class="ml-10 text-fore-light flex-1">测试类型</text>
|
|
|
|
|
- <text class="text-fore-title">职业技能模拟考试</text>
|
|
|
|
|
|
|
+ <text class="ml-10 text-fore-light flex-1">考试科目</text>
|
|
|
|
|
+ <text class="text-fore-title">{{ examineeData.subjectName }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="my-20 flex items-center justify-between text-24">
|
|
<view class="my-20 flex items-center justify-between text-24">
|
|
|
<ie-image src="/pagesStudy/static/image/icon-clock.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
<ie-image src="/pagesStudy/static/image/icon-clock.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
|
- <text class="ml-10 text-fore-light flex-1">测试时间</text>
|
|
|
|
|
- <text class="text-fore-title">2025.09.25 10:00</text>
|
|
|
|
|
|
|
+ <text class="ml-10 text-fore-light flex-1">考试时长</text>
|
|
|
|
|
+ <text class="text-fore-title">{{ formatTime(examineeData.duration) }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <exam-stat />
|
|
|
|
|
- <score-stat />
|
|
|
|
|
|
|
+ <exam-stat :data="examineeData" />
|
|
|
|
|
+ <score-stat :data="examineeData" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</ie-page>
|
|
</ie-page>
|
|
@@ -40,11 +40,44 @@ import ExamStat from './components/exam-stat.vue';
|
|
|
import ScoreStat from './components/score-stat.vue';
|
|
import ScoreStat from './components/score-stat.vue';
|
|
|
import { getExamineeResult } from '@/api/modules/study';
|
|
import { getExamineeResult } from '@/api/modules/study';
|
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
|
|
+import { Study } from '@/types';
|
|
|
|
|
+import { EnumQuestionType } from '@/common/enum';
|
|
|
const { prevData } = useTransferPage();
|
|
const { prevData } = useTransferPage();
|
|
|
-const examineeResult = ref<any>(null);
|
|
|
|
|
|
|
+const examineeData = ref<Study.Examinee>({} as Study.Examinee);
|
|
|
|
|
+// const questionList = computed(() => {
|
|
|
|
|
+// return (examineeData.value.questions || []).map((item: Study.ExamineeQuestion) => {
|
|
|
|
|
+// return {
|
|
|
|
|
+// ...item,
|
|
|
|
|
+// isRight: judgeCorrect(item)
|
|
|
|
|
+// }
|
|
|
|
|
+// });
|
|
|
|
|
+// });
|
|
|
|
|
+const rightRate = computed(() => {
|
|
|
|
|
+ const { totalCount = 0, wrongCount = 0 } = examineeData.value;
|
|
|
|
|
+ return Math.round((totalCount - wrongCount) / totalCount * 100) || 0;
|
|
|
|
|
+});
|
|
|
|
|
+// const judgeCorrect = (qs: Study.ExamineeQuestion) => {
|
|
|
|
|
+// if (qs.typeId === EnumQuestionType.SINGLE_CHOICE) {
|
|
|
|
|
+// return qs.answers.includes(qs.answer1);
|
|
|
|
|
+// } else if (qs.typeId === EnumQuestionType.MULTIPLE_CHOICE) {
|
|
|
|
|
+// const rightAnswers = qs.answer1.split('').filter(item => item !== ' ');
|
|
|
|
|
+// return rightAnswers.length === qs.answers.length && rightAnswers.every(item => qs.answers.includes(item));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+const formatTime = (time: number) => {
|
|
|
|
|
+ const hours = Math.floor(time / 3600);
|
|
|
|
|
+ const minutes = Math.floor((time % 3600) / 60);
|
|
|
|
|
+ const seconds = time % 60;
|
|
|
|
|
+
|
|
|
|
|
+ if (hours >= 1) {
|
|
|
|
|
+ return `${hours}时${minutes}分${seconds}秒`;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return `${minutes}分${seconds}秒`;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
const loadData = async () => {
|
|
const loadData = async () => {
|
|
|
const res = await getExamineeResult(prevData.value.examineeId);
|
|
const res = await getExamineeResult(prevData.value.examineeId);
|
|
|
- examineeResult.value = res.data;
|
|
|
|
|
|
|
+ examineeData.value = res.data;
|
|
|
};
|
|
};
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
|
loadData();
|
|
loadData();
|