|
@@ -5,7 +5,7 @@ import { getRoute } from "../../utils/router";
|
|
|
import { request } from "../../utils/request";
|
|
|
import { useTimeStore } from "@/store/time";
|
|
|
import Container from "../../components/Container/Container.vue";
|
|
|
-import ShareTemplate from "../../components/ShareTemplate/ShareTemplate.vue";
|
|
|
+import ShareTemplate from "../../components/ShareTemplate/ShareTemplateExam.vue";
|
|
|
|
|
|
const Time = useTimeStore();
|
|
|
|
|
@@ -39,15 +39,25 @@ const pageParams = ref({
|
|
|
limit: 999,
|
|
|
});
|
|
|
const data = ref([]);
|
|
|
+const real_topic_id = ref(0);
|
|
|
|
|
|
-const getList = async (params) => {
|
|
|
+const getList = async (params = {}) => {
|
|
|
if (pageParams.value.page * pageParams.value.limit >= total.value) return;
|
|
|
+ const t = await request(
|
|
|
+ "api/question_bank/question_reception/real_topic/set_user_new_paper",
|
|
|
+ {
|
|
|
+ catalogue_id: getRoute().params.id,
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ real_topic_id.value = t.data;
|
|
|
+
|
|
|
const res = await request(
|
|
|
- "api/question_bank/question_reception/topic/get_chapter_topic",
|
|
|
+ "api/question_bank/question_reception/real_topic/get_real_topic",
|
|
|
{
|
|
|
...params,
|
|
|
- // id: getRoute().params.id,
|
|
|
- id: 66,
|
|
|
+ catalogue_id: getRoute().params.id,
|
|
|
+ real_topic_id: real_topic_id.value,
|
|
|
}
|
|
|
);
|
|
|
total.value = res.data.total;
|
|
@@ -96,10 +106,20 @@ const nextPage = (e) => {
|
|
|
getList(pageParams.value);
|
|
|
};
|
|
|
|
|
|
-const lookReport = (d, s) => {
|
|
|
+const lookReport = async (d, s) => {
|
|
|
data.value = d;
|
|
|
- showReport.value = true;
|
|
|
const totalTime = Time.end();
|
|
|
+ // 提交试卷
|
|
|
+ await request(
|
|
|
+ "api/question_bank/question_reception/real_topic/user_submit_real_paper",
|
|
|
+ {
|
|
|
+ user_real_paper_id: real_topic_id.value,
|
|
|
+ catalogue_id: getRoute().params.id,
|
|
|
+ use_time: totalTime.totalTime,
|
|
|
+ use_time_str: totalTime.formatTime,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ showReport.value = true;
|
|
|
submitter.value = {
|
|
|
...s,
|
|
|
totalTime,
|
|
@@ -115,11 +135,11 @@ const lookReport = (d, s) => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- Time.start();
|
|
|
+onMounted(async () => {
|
|
|
const params = getRoute().params;
|
|
|
title.value = params.title;
|
|
|
- getList(pageParams.value);
|
|
|
+ await getList(pageParams.value);
|
|
|
+ Time.start();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -131,6 +151,7 @@ onMounted(() => {
|
|
|
:topics="data"
|
|
|
@nextPage="nextPage"
|
|
|
@lookReport="lookReport"
|
|
|
+ :real_topic_id="real_topic_id"
|
|
|
:empty="!data.length"
|
|
|
border
|
|
|
v-if="!showReport && !showShare"
|
|
@@ -191,7 +212,7 @@ onMounted(() => {
|
|
|
<ShareTemplate
|
|
|
:onClose="() => (showShare = false)"
|
|
|
:correct="correct"
|
|
|
- bg="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/ix4wGk9h7Fb4c3d8hjkYjJP6VsPNbZgG3uDTUzxp.png"
|
|
|
+ bg="https://openwork-oss.oss-cn-shenzhen.aliyuncs.com/uploads/question/2025/05/BxBKVS1eV1xaSylWq3i2UjE5VmiJfrfVT7Cc98m3.png"
|
|
|
v-else
|
|
|
/>
|
|
|
</template>
|