|
|
@@ -0,0 +1,213 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <page-header
|
|
|
+ :loading="loadingCommittedGroups"
|
|
|
+ :routes="[
|
|
|
+ { name: '机器学习作业', path: 'dlwork' },
|
|
|
+ { name: '作业详情', path: `${$route.path}` }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <template slot="title">
|
|
|
+ {{ problemInfo.name }}
|
|
|
+ </template>
|
|
|
+ <template slot="content">
|
|
|
+ {{ problemInfo.description }}
|
|
|
+ </template>
|
|
|
+ </page-header>
|
|
|
+
|
|
|
+ <page-body>
|
|
|
+ <div class="data-table">
|
|
|
+ <b-tabs>
|
|
|
+ <b-tab-item :label="submitInfo.yes">
|
|
|
+ <page-section-loading :show="loadingCommittedGroups" />
|
|
|
+ <b-table
|
|
|
+ v-if="!loadingCommittedGroups"
|
|
|
+ :data="codeProcedureList"
|
|
|
+ detailed
|
|
|
+ detail-key="id"
|
|
|
+ >
|
|
|
+ <template slot-scope="props">
|
|
|
+ <b-table-column
|
|
|
+ field="id"
|
|
|
+ label="小组ID"
|
|
|
+ width="120"
|
|
|
+ numeric
|
|
|
+ sortable
|
|
|
+ centered
|
|
|
+ >
|
|
|
+ {{ props.row.group.id }}
|
|
|
+ </b-table-column>
|
|
|
+ <b-table-column label="构建" centered>
|
|
|
+ <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="geneTag(props.row.deployStatus.key)">
|
|
|
+ {{
|
|
|
+ props.row.deployStatus.key === 0
|
|
|
+ ? "未部署"
|
|
|
+ : props.row.deployStatus.key === -1
|
|
|
+ ? "失败"
|
|
|
+ : "成功"
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </b-table-column>
|
|
|
+ <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="详情" centered>
|
|
|
+ <router-link
|
|
|
+ :to="{
|
|
|
+ path: `${$route.path}/${props.row.id}`
|
|
|
+ }"
|
|
|
+ >查看详情
|
|
|
+ </router-link>
|
|
|
+ </b-table-column>
|
|
|
+ </template>
|
|
|
+ </b-table>
|
|
|
+ </b-tab-item>
|
|
|
+
|
|
|
+ <b-tab-item :label="submitInfo.no">
|
|
|
+ <page-section-loading :show="loadingUncommittedGroups" />
|
|
|
+ <b-table v-if="!loadingUncommittedGroups" :data="unsubmitedGroups">
|
|
|
+ <template slot-scope="props">
|
|
|
+ <b-table-column
|
|
|
+ field="id"
|
|
|
+ label="用户ID"
|
|
|
+ width="120"
|
|
|
+ numeric
|
|
|
+ sortable
|
|
|
+ centered
|
|
|
+ >
|
|
|
+ {{ props.row.id }}
|
|
|
+ </b-table-column>
|
|
|
+ <b-table-column label="用户昵称" centered>
|
|
|
+ {{ props.row.name }}
|
|
|
+ </b-table-column>
|
|
|
+ </template>
|
|
|
+ </b-table>
|
|
|
+ </b-tab-item>
|
|
|
+ </b-tabs>
|
|
|
+ </div>
|
|
|
+ </page-body>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import PageHeader from "@/components/PageHeader";
|
|
|
+import PageBody from "@/components/PageBody/index";
|
|
|
+import { getCodeProcedureListByCodeId } from "@/api/assignment";
|
|
|
+import { getUnsubmittedCodeGroupsList } from "@/api/assignment";
|
|
|
+import { getDLAssignmentById } from "@/api/dlwork";
|
|
|
+
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
+
|
|
|
+const tag = {
|
|
|
+ success: "tag is-success",
|
|
|
+ failed: "tag is-danger",
|
|
|
+ uncommitted: "tag is-dark"
|
|
|
+};
|
|
|
+
|
|
|
+const status = {
|
|
|
+ uncommitted: "UNCOMMITTED",
|
|
|
+ success: "SUCCESS",
|
|
|
+ failed: "FAILED"
|
|
|
+};
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ PageBody,
|
|
|
+ PageHeader,
|
|
|
+ PageSectionLoading
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ const { codeId } = this.$route.params;
|
|
|
+ this.codeId = codeId;
|
|
|
+ this.loadingUncommittedGroups = true;
|
|
|
+ this.loadingCommittedGroups = true;
|
|
|
+ getDLAssignmentById(codeId).then(res => {
|
|
|
+ this.problemInfo = res.data.problem;
|
|
|
+ });
|
|
|
+ getCodeProcedureListByCodeId(codeId).then(res => {
|
|
|
+ this.codeProcedureList = res.data;
|
|
|
+ this.submitInfo.yes = "已提交:" + this.codeProcedureList.length;
|
|
|
+ this.loadingCommittedGroups = false;
|
|
|
+ });
|
|
|
+ getUnsubmittedCodeGroupsList(codeId).then(res => {
|
|
|
+ this.unsubmitedGroups = res.data;
|
|
|
+ this.submitInfo.no = "未提交:" + this.unsubmitedGroups.length;
|
|
|
+ this.loadingUncommittedGroups = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ codeId: null,
|
|
|
+ codeProcedureList: [],
|
|
|
+ unsubmitedGroups: [],
|
|
|
+ problemInfo: {
|
|
|
+ id: null,
|
|
|
+ name: null,
|
|
|
+ description: null
|
|
|
+ },
|
|
|
+ tag,
|
|
|
+ status,
|
|
|
+ submitInfo: {
|
|
|
+ yes: "已提交",
|
|
|
+ no: "未提交"
|
|
|
+ },
|
|
|
+ loadingCommittedGroups: false,
|
|
|
+ loadingUncommittedGroups: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ geneTag(state) {
|
|
|
+ let showTag = "";
|
|
|
+ if (state === -1) {
|
|
|
+ showTag = tag.failed;
|
|
|
+ } else if (state === 0) {
|
|
|
+ showTag = tag.uncommitted;
|
|
|
+ } else {
|
|
|
+ showTag = tag.success;
|
|
|
+ }
|
|
|
+ return showTag;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.breadcrumb a {
|
|
|
+ /*color: #7957d5;*/
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+
|
|
|
+.data-table {
|
|
|
+ width: 100%;
|
|
|
+ padding: 30px;
|
|
|
+ min-height: 80vh;
|
|
|
+ background-color: #ffffff;
|
|
|
+}
|
|
|
+
|
|
|
+.form-group {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 1.5rem;
|
|
|
+}
|
|
|
+</style>
|