|
|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<page-header
|
|
|
+ :loading="isQuestionDetailLoading"
|
|
|
:routes="[
|
|
|
{ name: '查看题目', path: 'question/' },
|
|
|
{ name: `${questionName}`, path: `question/123` }
|
|
|
@@ -19,30 +20,35 @@
|
|
|
</template>
|
|
|
</page-header>
|
|
|
<page-body>
|
|
|
- <div class="data-table">
|
|
|
- <div class="question-description">
|
|
|
- <div class="subtitle">题目描述</div>
|
|
|
- <div class="question-content">{{ questionInfo.description }}</div>
|
|
|
- </div>
|
|
|
- <div class="question-description">
|
|
|
- <div class="subtitle">预计完成时间</div>
|
|
|
- <div class="question-content">{{ questionInfo.expectTime }}分钟</div>
|
|
|
- </div>
|
|
|
- <div class="question-description">
|
|
|
- <div class="subtitle">题目难度</div>
|
|
|
- <div class="question-content">
|
|
|
- {{ difficultyType(questionInfo.difficulty) }}
|
|
|
+ <page-section-loading :show="isQuestionDetailLoading" />
|
|
|
+ <div v-if="!isQuestionDetailLoading" class="data-table">
|
|
|
+ <div>
|
|
|
+ <div class="question-description">
|
|
|
+ <div class="subtitle">题目描述</div>
|
|
|
+ <div class="question-content">{{ questionInfo.description }}</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="question-description">
|
|
|
- <div class="subtitle">文件信息</div>
|
|
|
- <div class="question-content">
|
|
|
- <div
|
|
|
- class="file-info"
|
|
|
- v-for="(item, index) in questionInfo.file"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <a>{{ item.filename }}</a>
|
|
|
+ <div class="question-description">
|
|
|
+ <div class="subtitle">预计完成时间</div>
|
|
|
+ <div class="question-content">
|
|
|
+ {{ questionInfo.expectTime }}分钟
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="question-description">
|
|
|
+ <div class="subtitle">题目难度</div>
|
|
|
+ <div class="question-content">
|
|
|
+ {{ difficultyType(questionInfo.difficulty) }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="question-description">
|
|
|
+ <div class="subtitle">文件信息</div>
|
|
|
+ <div class="question-content">
|
|
|
+ <div
|
|
|
+ class="file-info"
|
|
|
+ v-for="(item, index) in questionInfo.file"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <a>{{ item.filename }}</a>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -54,11 +60,13 @@
|
|
|
import PageHeader from "@/components/PageHeader";
|
|
|
import PageBody from "@/components/PageBody/index";
|
|
|
import { getQuestionDetail } from "@/api/question";
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
PageBody,
|
|
|
- PageHeader
|
|
|
+ PageHeader,
|
|
|
+ PageSectionLoading
|
|
|
},
|
|
|
mounted() {
|
|
|
this.questionName = this.$route.query.questionName;
|
|
|
@@ -66,13 +74,15 @@ export default {
|
|
|
getQuestionDetail(this.questionId).then(res => {
|
|
|
console.log(res.data);
|
|
|
this.questionInfo = res.data;
|
|
|
+ this.isQuestionDetailLoading = false;
|
|
|
});
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
questionName: "",
|
|
|
questionInfo: {},
|
|
|
- questionId: ""
|
|
|
+ questionId: "",
|
|
|
+ isQuestionDetailLoading: true
|
|
|
};
|
|
|
},
|
|
|
methods: {
|