|
|
@@ -4,14 +4,14 @@
|
|
|
:loading="loadingCommittedGroups"
|
|
|
:routes="[
|
|
|
{ name: '代码作业', path: 'code' },
|
|
|
- { name: '作业详情', path: 'code/${assignmentInfo.id}' }
|
|
|
+ { name: '作业详情', path: `${$route.path}` }
|
|
|
]"
|
|
|
>
|
|
|
<template slot="title">
|
|
|
- {{ assignmentInfo.name }}
|
|
|
+ {{ problemInfo.name }}
|
|
|
</template>
|
|
|
<template slot="content">
|
|
|
- 作业描述信息作业描述信息作业描述信息作业描述信息作业描述信息作业描述信息作业描述信息
|
|
|
+ {{ problemInfo.description }}
|
|
|
</template>
|
|
|
</page-header>
|
|
|
|
|
|
@@ -38,43 +38,58 @@
|
|
|
{{ props.row.group.id }}
|
|
|
</b-table-column>
|
|
|
<b-table-column label="构建" centered>
|
|
|
- <span :class="geneTitleAndTag(props.row.buildStatus.key).tag">
|
|
|
- {{ geneTitleAndTag(props.row.buildStatus.key).title }}
|
|
|
+ <span :class="geneTag(props.row.buildStatus.key)">
|
|
|
+ {{
|
|
|
+ props.row.buildStatus.key === 0
|
|
|
+ ? "未构建"
|
|
|
+ : props.row.buildStatus.key === -1
|
|
|
+ ? "失败"
|
|
|
+ : "成功"
|
|
|
+ }}
|
|
|
</span>
|
|
|
</b-table-column>
|
|
|
|
|
|
<b-table-column label="部署" centered>
|
|
|
- <span
|
|
|
- :class="geneTitleAndTag(props.row.deployStatus.key).tag"
|
|
|
- >
|
|
|
- {{ geneTitleAndTag(props.row.deployStatus.key).title }}
|
|
|
+ <span :class="geneTag(props.row.deployStatus.key)">
|
|
|
+ {{
|
|
|
+ props.row.deployStatus.key === 0
|
|
|
+ ? "未部署"
|
|
|
+ : props.row.deployStatus.key === -1
|
|
|
+ ? "失败"
|
|
|
+ : "成功"
|
|
|
+ }}
|
|
|
</span>
|
|
|
</b-table-column>
|
|
|
- <b-table-column label="单元测试">
|
|
|
- <span
|
|
|
- :class="geneTitleAndTag(props.row.unitTestStatus.key).tag"
|
|
|
- >
|
|
|
- {{ props.row.unitTestStatus.passCount }}/{{
|
|
|
- props.row.unitTestStatus.testCount
|
|
|
+ <b-table-column label="单元测试" centered>
|
|
|
+ <span :class="geneTag(props.row.unitTestStatus.key)">
|
|
|
+ {{
|
|
|
+ props.row.unitTestStatus.key === 0
|
|
|
+ ? "未测试"
|
|
|
+ : props.row.unitTestStatus.key === -1
|
|
|
+ ? "构建失败"
|
|
|
+ : props.row.unitTestStatus.passCount +
|
|
|
+ "/" +
|
|
|
+ props.row.unitTestStatus.testCount
|
|
|
}}
|
|
|
</span>
|
|
|
</b-table-column>
|
|
|
- <b-table-column label="功能测试">
|
|
|
- <span
|
|
|
- :class="
|
|
|
- geneTitleAndTag(props.row.functionTestStatus.key).tag
|
|
|
- "
|
|
|
- >
|
|
|
- {{ props.row.functionTestStatus.passCount }}/{{
|
|
|
- props.row.functionTestStatus.testCount
|
|
|
+ <b-table-column label="功能测试" centered>
|
|
|
+ <span :class="geneTag(props.row.functionTestStatus.key)">
|
|
|
+ {{
|
|
|
+ props.row.functionTestStatus.key === 0
|
|
|
+ ? "未测试"
|
|
|
+ : props.row.functionTestStatus.key === -1
|
|
|
+ ? "未知状态"
|
|
|
+ : props.row.functionTestStatus.passCount +
|
|
|
+ "/" +
|
|
|
+ props.row.functionTestStatus.testCount
|
|
|
}}
|
|
|
</span>
|
|
|
</b-table-column>
|
|
|
- <b-table-column label="详情">
|
|
|
+ <b-table-column label="详情" centered>
|
|
|
<router-link
|
|
|
:to="{
|
|
|
- path: `/course-teacher/:courseId/code/detail/test`,
|
|
|
- query: { assignmentInfo: props.row }
|
|
|
+ path: `${$route.path}/test/${props.row.id}`
|
|
|
}"
|
|
|
>查看详情</router-link
|
|
|
>
|
|
|
@@ -117,7 +132,7 @@
|
|
|
<b-table-column label="小组名称" centered>
|
|
|
{{ props.row.name }}
|
|
|
</b-table-column>
|
|
|
- <b-table-column label="小组成员" centered>
|
|
|
+ <b-table-column label="小组a成员" centered>
|
|
|
<span v-for="member in props.row.members" :key="member.id"
|
|
|
>{{ member.username }} </span
|
|
|
>
|
|
|
@@ -136,15 +151,9 @@ import PageHeader from "@/components/PageHeader";
|
|
|
import PageBody from "@/components/PageBody/index";
|
|
|
import { getCodeProcedureListByCodeId } from "@/api/assignment";
|
|
|
import { getUnsubmittedCodeGroupsList } from "@/api/assignment";
|
|
|
-import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
+import { getCodeAssignmentByTeacher } from "@/api/assignment";
|
|
|
|
|
|
-const assignmentInfo = {
|
|
|
- id: 0,
|
|
|
- name: "",
|
|
|
- description: "",
|
|
|
- startAt: 0,
|
|
|
- endAt: 0
|
|
|
-};
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
|
|
|
const tag = {
|
|
|
success: "tag is-success",
|
|
|
@@ -165,15 +174,18 @@ export default {
|
|
|
PageSectionLoading
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.codeId = this.$route.params;
|
|
|
this.loadingUncommittedGroups = true;
|
|
|
this.loadingCommittedGroups = true;
|
|
|
- this.assignmentInfo = this.$route.query.assignmentInfo;
|
|
|
- getCodeProcedureListByCodeId(123).then(res => {
|
|
|
+ getCodeAssignmentByTeacher(this.codeId).then(res => {
|
|
|
+ this.problemInfo = res.data.problem;
|
|
|
+ });
|
|
|
+ getCodeProcedureListByCodeId(this.codeId).then(res => {
|
|
|
this.codeProcedureList = res.data;
|
|
|
this.submitInfo.yes = "已提交:" + this.codeProcedureList.length;
|
|
|
this.loadingCommittedGroups = false;
|
|
|
});
|
|
|
- getUnsubmittedCodeGroupsList(123).then(res => {
|
|
|
+ getUnsubmittedCodeGroupsList(this.codeId).then(res => {
|
|
|
this.unsubmitedGroups = res.data;
|
|
|
this.submitInfo.no = "未提交:" + this.unsubmitedGroups.length;
|
|
|
this.loadingUncommittedGroups = false;
|
|
|
@@ -181,10 +193,14 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ codeId: null,
|
|
|
codeProcedureList: [],
|
|
|
unsubmitedGroups: [],
|
|
|
- showResult: [],
|
|
|
- assignmentInfo,
|
|
|
+ problemInfo: {
|
|
|
+ id: null,
|
|
|
+ name: null,
|
|
|
+ description: null
|
|
|
+ },
|
|
|
tag,
|
|
|
status,
|
|
|
submitInfo: {
|
|
|
@@ -196,6 +212,17 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ geneTag(state) {
|
|
|
+ let showTag = "";
|
|
|
+ if (state === -1) {
|
|
|
+ showTag = tag.failed;
|
|
|
+ } else if (state === 0) {
|
|
|
+ showTag = tag.uncommitted;
|
|
|
+ } else {
|
|
|
+ showTag = tag.success;
|
|
|
+ }
|
|
|
+ return showTag;
|
|
|
+ },
|
|
|
geneTitleAndTag(state) {
|
|
|
let data = {
|
|
|
title: "",
|