|
|
@@ -30,60 +30,88 @@
|
|
|
</div>
|
|
|
<!---->
|
|
|
<b-tabs type="is-boxed">
|
|
|
- <b-tab-item>
|
|
|
- <template slot="header">
|
|
|
- <span> {{ submitInfo.yes }} </span>
|
|
|
- </template>
|
|
|
- <div class="submitted-list">
|
|
|
- <b-table :data="showResult" paginated per-page="5">
|
|
|
- <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>
|
|
|
- <span :class="props.row.buildTag">{{
|
|
|
- props.row.buildStatus
|
|
|
- }}</span>
|
|
|
- </b-table-column>
|
|
|
+ <b-tab-item label="已提交">
|
|
|
+ <b-table :data="codeProcedureList" paginated per-page="5">
|
|
|
+ <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="geneTitleAndTag(props.row.buildStatus.key).tag">
|
|
|
+ {{ geneTitleAndTag(props.row.buildStatus.key).title }}
|
|
|
+ </span>
|
|
|
+ </b-table-column>
|
|
|
|
|
|
- <b-table-column label="部署" centered>
|
|
|
- <span :class="props.row.deployTag">{{
|
|
|
- props.row.deployStatus
|
|
|
- }}</span>
|
|
|
- </b-table-column>
|
|
|
- <b-table-column label="测试">
|
|
|
- <span :class="props.row.testTag">{{
|
|
|
- props.row.testStatus
|
|
|
- }}</span>
|
|
|
- </b-table-column>
|
|
|
- <b-table-column label="详情">
|
|
|
- <router-link
|
|
|
- :to="{
|
|
|
- path: `/course-teacher/:courseId/code/detail/test`,
|
|
|
- query: { assignmentInfo: props.row }
|
|
|
- }"
|
|
|
- >查看详情</router-link
|
|
|
- >
|
|
|
- </b-table-column>
|
|
|
- </template>
|
|
|
- </b-table>
|
|
|
- </div>
|
|
|
+ <b-table-column label="部署" centered>
|
|
|
+ <span
|
|
|
+ :class="geneTitleAndTag(props.row.deployStatus.key).tag"
|
|
|
+ >
|
|
|
+ {{ geneTitleAndTag(props.row.deployStatus.key).title }}
|
|
|
+ </span>
|
|
|
+ </b-table-column>
|
|
|
+ <b-table-column label="单元测试">
|
|
|
+ <span
|
|
|
+ :class="geneTitleAndTag(props.row.unitTestStatus.key).tag"
|
|
|
+ >
|
|
|
+ {{ 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
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </b-table-column>
|
|
|
+ <b-table-column label="详情">
|
|
|
+ <router-link
|
|
|
+ :to="{
|
|
|
+ path: `/course-teacher/:courseId/code/detail/test`,
|
|
|
+ query: { assignmentInfo: props.row }
|
|
|
+ }"
|
|
|
+ >查看详情</router-link
|
|
|
+ >
|
|
|
+ </b-table-column>
|
|
|
+ </template>
|
|
|
+ </b-table>
|
|
|
</b-tab-item>
|
|
|
- <b-tab-item>
|
|
|
- <template slot="header">
|
|
|
- <span> {{ submitInfo.no }} </span>
|
|
|
- </template>
|
|
|
- <b-table
|
|
|
- :data="unsubmited.data"
|
|
|
- :columns="unsubmited.columns"
|
|
|
- ></b-table>
|
|
|
+
|
|
|
+ <b-tab-item :label="submitInfo.no">
|
|
|
+ <b-table :data="unsubmitedGroups" paginated per-page="5">
|
|
|
+ <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>
|
|
|
+ <b-table-column label="小组成员" centered>
|
|
|
+ <span v-for="member in props.row.members" :key="member.id"
|
|
|
+ >{{ member.username }} </span
|
|
|
+ >
|
|
|
+ </b-table-column>
|
|
|
+ </template>
|
|
|
+ </b-table>
|
|
|
</b-tab-item>
|
|
|
</b-tabs>
|
|
|
</div>
|
|
|
@@ -94,71 +122,9 @@
|
|
|
<script>
|
|
|
import PageHeader from "@/components/PageHeader";
|
|
|
import PageBody from "@/components/PageBody/index";
|
|
|
+import { getCodeProcedureListByCodeId } from "@/api/assignment";
|
|
|
+import { getUnsubmittedCodeGroupsList } from "@/api/assignment";
|
|
|
|
|
|
-const unsubmited = {
|
|
|
- data: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- PM: "Jesse",
|
|
|
- members: "Simmons\tClarence\tTina\tJohn"
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- PM: "Jesse",
|
|
|
- members: "Simmons Clarence Tina John"
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- PM: "Jesse",
|
|
|
- members: "Simmons Clarence Tina John"
|
|
|
- }
|
|
|
- ],
|
|
|
- columns: [
|
|
|
- {
|
|
|
- field: "id",
|
|
|
- label: "小组ID",
|
|
|
- numeric: true,
|
|
|
- centered: true
|
|
|
- },
|
|
|
- {
|
|
|
- field: "PM",
|
|
|
- label: "组长"
|
|
|
- },
|
|
|
- {
|
|
|
- field: "members",
|
|
|
- label: "组员"
|
|
|
- }
|
|
|
- ]
|
|
|
-};
|
|
|
-const info = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- PM: "Jesse",
|
|
|
- members: "Simmons\tClarence\tTina\tJohn",
|
|
|
- build: 0,
|
|
|
- deploy: 0,
|
|
|
- test: -1,
|
|
|
- pass: 0,
|
|
|
- testNum: 10
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- build: 1,
|
|
|
- deploy: 1,
|
|
|
- test: 0,
|
|
|
- pass: 0,
|
|
|
- testNum: 10
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- build: 1,
|
|
|
- deploy: 1,
|
|
|
- test: 1,
|
|
|
- pass: 10,
|
|
|
- testNum: 10
|
|
|
- }
|
|
|
-];
|
|
|
-const showResult = [];
|
|
|
const assignmentInfo = {
|
|
|
id: 0,
|
|
|
name: "",
|
|
|
@@ -170,23 +136,13 @@ const assignmentInfo = {
|
|
|
const tag = {
|
|
|
success: "tag is-success",
|
|
|
failed: "tag is-danger",
|
|
|
- blank: "tag is-dark"
|
|
|
+ uncommitted: "tag is-dark"
|
|
|
};
|
|
|
|
|
|
const status = {
|
|
|
- pending: "PENDING",
|
|
|
+ uncommitted: "UNCOMMITTED",
|
|
|
success: "SUCCESS",
|
|
|
- failed: "FAILED",
|
|
|
- blank: "BLANK"
|
|
|
-};
|
|
|
-
|
|
|
-const submitCount = {
|
|
|
- yes: 19,
|
|
|
- no: 8
|
|
|
-};
|
|
|
-const submitInfo = {
|
|
|
- yes: "已提交:" + submitCount.yes,
|
|
|
- no: "未提交:" + submitCount.no
|
|
|
+ failed: "FAILED"
|
|
|
};
|
|
|
|
|
|
export default {
|
|
|
@@ -194,30 +150,49 @@ export default {
|
|
|
PageBody,
|
|
|
PageHeader
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ async mounted() {
|
|
|
this.assignmentInfo = this.$route.query.assignmentInfo;
|
|
|
- for (var item of info) {
|
|
|
- showResult.push({
|
|
|
- id: item.id,
|
|
|
- buildStatus: item.build === 1 ? status.success : status.failed,
|
|
|
- buildTag: item.build === 1 ? tag.success : tag.failed,
|
|
|
- deployStatus: item.deploy === 1 ? status.success : status.failed,
|
|
|
- deployTag: item.deploy === 1 ? tag.success : tag.failed,
|
|
|
- testStatus: item.test === 1 ? status.success : status.failed,
|
|
|
- testTag: item.test === 1 ? tag.success : tag.failed
|
|
|
- });
|
|
|
- }
|
|
|
+ getCodeProcedureListByCodeId(123).then(res => {
|
|
|
+ this.codeProcedureList = res.data;
|
|
|
+ this.submitInfo.yes = "已提交:" + this.codeProcedureList.length;
|
|
|
+ });
|
|
|
+ getUnsubmittedCodeGroupsList(123).then(res => {
|
|
|
+ this.unsubmitedGroups = res.data;
|
|
|
+ this.submitInfo.no = "未提交:" + this.unsubmitedGroups.length;
|
|
|
+ });
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- info,
|
|
|
- unsubmited,
|
|
|
+ codeProcedureList: [],
|
|
|
+ unsubmitedGroups: [],
|
|
|
+ showResult: [],
|
|
|
assignmentInfo,
|
|
|
tag,
|
|
|
status,
|
|
|
- showResult,
|
|
|
- submitInfo
|
|
|
+ submitInfo: {
|
|
|
+ yes: "",
|
|
|
+ no: ""
|
|
|
+ }
|
|
|
};
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ geneTitleAndTag(state) {
|
|
|
+ let data = {
|
|
|
+ title: "",
|
|
|
+ tag: ""
|
|
|
+ };
|
|
|
+ if (state === 2) {
|
|
|
+ data.title = status.failed;
|
|
|
+ data.tag = tag.failed;
|
|
|
+ } else if (state === 0) {
|
|
|
+ data.title = status.uncommitted;
|
|
|
+ data.tag = tag.uncommitted;
|
|
|
+ } else {
|
|
|
+ data.title = status.success;
|
|
|
+ data.tag = tag.success;
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -233,19 +208,10 @@ export default {
|
|
|
min-height: 80vh;
|
|
|
background-color: #ffffff;
|
|
|
}
|
|
|
-.submitted-list {
|
|
|
- /*margin-top: 30px;*/
|
|
|
-}
|
|
|
+
|
|
|
.form-group {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
margin-bottom: 1.5rem;
|
|
|
}
|
|
|
-
|
|
|
-.submit-state {
|
|
|
- display: flex;
|
|
|
- margin-top: 20px;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 20px;
|
|
|
-}
|
|
|
</style>
|