|
|
@@ -14,11 +14,11 @@
|
|
|
<b-field>
|
|
|
<b-select placeholder="选择题目类型">
|
|
|
<option
|
|
|
- v-for="option in questionType"
|
|
|
- :value="option.title"
|
|
|
- :key="option.id"
|
|
|
+ v-for="(option, index) in questionType"
|
|
|
+ :value="option"
|
|
|
+ :key="index"
|
|
|
>
|
|
|
- {{ option.title }}
|
|
|
+ {{ option }}
|
|
|
</option>
|
|
|
</b-select>
|
|
|
</b-field>
|
|
|
@@ -53,7 +53,10 @@
|
|
|
<router-link
|
|
|
:to="{
|
|
|
path: `${props.row.id}`,
|
|
|
- query: { questionName: props.row.name }
|
|
|
+ query: {
|
|
|
+ questionName: props.row.name,
|
|
|
+ questionId: props.row.id
|
|
|
+ }
|
|
|
}"
|
|
|
>{{ props.row.name }}</router-link
|
|
|
>
|
|
|
@@ -78,11 +81,11 @@
|
|
|
|
|
|
<b-table-column
|
|
|
label="平均时长"
|
|
|
- field="expectTime"
|
|
|
+ field="expect_time"
|
|
|
sortable
|
|
|
centered
|
|
|
>
|
|
|
- {{ props.row.expectTime }}分钟
|
|
|
+ {{ props.row.expect_time }}分钟
|
|
|
</b-table-column>
|
|
|
</template>
|
|
|
|
|
|
@@ -92,22 +95,27 @@
|
|
|
<div class="content">
|
|
|
<p class="detail-content">
|
|
|
<strong>{{ props.row.name }}</strong>
|
|
|
- <small
|
|
|
- ><b-tag type="is-info"
|
|
|
- >{{ props.row.expectTime }}分钟</b-tag
|
|
|
- ></small
|
|
|
- >
|
|
|
- <small
|
|
|
- ><b-tag
|
|
|
+ <small v-show="props.row.expect_time">
|
|
|
+ <b-tag type="is-info"
|
|
|
+ >{{ props.row.expect_time }}分钟</b-tag
|
|
|
+ >
|
|
|
+ </small>
|
|
|
+ <small v-show="props.row.difficulty">
|
|
|
+ <b-tag
|
|
|
:type="`${difficultyClass(props.row.difficulty)}`"
|
|
|
>{{ difficultyType(props.row.difficulty) }}</b-tag
|
|
|
- ></small
|
|
|
- >
|
|
|
- <small
|
|
|
- ><b-tag type="is-link">{{
|
|
|
- props.row.assignmentType.value
|
|
|
- }}</b-tag></small
|
|
|
- >
|
|
|
+ >
|
|
|
+ </small>
|
|
|
+ <small v-show="props.row.assignmentType">
|
|
|
+ <b-tag type="is-link">{{
|
|
|
+ props.row.assignmentType
|
|
|
+ }}</b-tag>
|
|
|
+ </small>
|
|
|
+ <small v-show="props.row.questionType">
|
|
|
+ <b-tag type="is-primary">{{
|
|
|
+ props.row.questionType
|
|
|
+ }}</b-tag>
|
|
|
+ </small>
|
|
|
<br /><br />
|
|
|
{{ props.row.description }}
|
|
|
</p>
|
|
|
@@ -123,8 +131,10 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { mapState } from "vuex";
|
|
|
-import { getStudentCourseReviewList } from "@/api/review";
|
|
|
-import { getTeacherQuestions } from "@/api/question";
|
|
|
+import {
|
|
|
+ getQuestionsByAssignType,
|
|
|
+ getTeacherQuestionType
|
|
|
+} from "@/api/question";
|
|
|
import PageHeader from "@/components/PageHeader";
|
|
|
import PageBody from "@/components/PageBody/index";
|
|
|
|
|
|
@@ -142,18 +152,34 @@ export default {
|
|
|
return {
|
|
|
courses: [],
|
|
|
review: [],
|
|
|
- questionType: [
|
|
|
- { id: 1, title: "文档作业题目" },
|
|
|
- { id: 2, title: "代码作业题目" }
|
|
|
- ],
|
|
|
+ questionType: [],
|
|
|
data: []
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- getStudentCourseReviewList(this.courses.id).then(
|
|
|
- value => (this.review = value.data)
|
|
|
- );
|
|
|
- getTeacherQuestions().then(value => (this.data = value.data));
|
|
|
+ //获取全部题目分类
|
|
|
+ getTeacherQuestionType()
|
|
|
+ .then(value => {
|
|
|
+ this.questionType = value.res;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast.open({
|
|
|
+ message: e.message,
|
|
|
+ type: "is-link"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //获取全部题目
|
|
|
+ getQuestionsByAssignType({ type: "DOCUMENT", page: 0, limit: 10 })
|
|
|
+ .then(value => {
|
|
|
+ console.log(value);
|
|
|
+ this.data = value.res.content;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast.open({
|
|
|
+ message: e.message,
|
|
|
+ type: "is-danger"
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
difficultyType: level => {
|