|
|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<page-header
|
|
|
+ :loading="testDetailLoading"
|
|
|
:routes="[
|
|
|
{ name: '代码作业', path: 'code' },
|
|
|
{ name: '项目列表', path: `code/${$route.params.homeworkId}` },
|
|
|
@@ -24,15 +25,22 @@
|
|
|
</template>
|
|
|
</page-header>
|
|
|
<page-body>
|
|
|
- <div v-for="item in testDetail.detail" :key="item.id" class="gap-section">
|
|
|
- <div class="page-section">
|
|
|
- <div>
|
|
|
- <pass-tag :pass="item.isPass" />
|
|
|
- <strong style="padding-left: 10px">
|
|
|
- 页面测试用例 : #{{ item.id }}
|
|
|
- </strong>
|
|
|
+ <div v-if="testDetailLoading"><page-section-loading show /></div>
|
|
|
+ <div v-else>
|
|
|
+ <div
|
|
|
+ v-for="item in testDetail.detail"
|
|
|
+ :key="item.id"
|
|
|
+ class="gap-section"
|
|
|
+ >
|
|
|
+ <div class="page-section">
|
|
|
+ <div>
|
|
|
+ <pass-tag :pass="item.isPass" />
|
|
|
+ <strong style="padding-left: 10px">
|
|
|
+ 页面测试用例 : #{{ item.id }}
|
|
|
+ </strong>
|
|
|
+ </div>
|
|
|
+ <div class="code-section">{{ item.message }}</div>
|
|
|
</div>
|
|
|
- <div class="code-section">{{ item.message }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</page-body>
|
|
|
@@ -45,17 +53,23 @@ import PageBody from "@/components/PageBody/index";
|
|
|
import { getUnitTestDetail } from "@/api/codehw";
|
|
|
import timeMixins from "@/mixins/time";
|
|
|
import PassTag from "@/views/student/Code/ProjectDetail/components/PassTag";
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
export default {
|
|
|
- components: { PassTag, PageBody, PageHeader },
|
|
|
+ components: { PageSectionLoading, PassTag, PageBody, PageHeader },
|
|
|
data() {
|
|
|
return {
|
|
|
- testDetail: { detail: [] }
|
|
|
+ testDetail: { detail: [] },
|
|
|
+ testDetailLoading: false
|
|
|
};
|
|
|
},
|
|
|
mixins: [timeMixins],
|
|
|
mounted() {
|
|
|
const { unitTestId } = this.$route.params;
|
|
|
- getUnitTestDetail(unitTestId).then(value => (this.testDetail = value.data));
|
|
|
+ this.testDetailLoading = true;
|
|
|
+ getUnitTestDetail(unitTestId).then(value => {
|
|
|
+ this.testDetail = value.data;
|
|
|
+ this.testDetailLoading = false;
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
</script>
|