|
|
@@ -1,29 +1,29 @@
|
|
|
<template>
|
|
|
-<!-- <el-descriptions class="commit-description">-->
|
|
|
-<!-- <el-descriptions-item-->
|
|
|
-<!-- label-class-name="label-bold"-->
|
|
|
-<!-- label="编号:">{{ commit.id }}</el-descriptions-item>-->
|
|
|
-<!-- <el-descriptions-item-->
|
|
|
-<!-- :width="600"-->
|
|
|
-<!-- label-class-name="label-bold"-->
|
|
|
-<!-- label="提交时间:">{{ formatTimestamp(commit.createdAt) }}</el-descriptions-item>-->
|
|
|
-<!-- <el-descriptions-item-->
|
|
|
-<!-- :width="200"-->
|
|
|
-<!-- label-class-name="label-bold"-->
|
|
|
-<!-- label="分数:">{{ commit.score }}</el-descriptions-item>-->
|
|
|
-<!-- <el-descriptions-item-->
|
|
|
-<!-- label-class-name="label-bold"-->
|
|
|
-<!-- label="Git Commit ID:" :span="2">{{ commit.hash }}</el-descriptions-item>-->
|
|
|
-<!-- </el-descriptions>-->
|
|
|
+ <!-- <el-descriptions class="commit-description">-->
|
|
|
+ <!-- <el-descriptions-item-->
|
|
|
+ <!-- label-class-name="label-bold"-->
|
|
|
+ <!-- label="编号:">{{ commit.id }}</el-descriptions-item>-->
|
|
|
+ <!-- <el-descriptions-item-->
|
|
|
+ <!-- :width="600"-->
|
|
|
+ <!-- label-class-name="label-bold"-->
|
|
|
+ <!-- label="提交时间:">{{ formatTimestamp(commit.createdAt) }}</el-descriptions-item>-->
|
|
|
+ <!-- <el-descriptions-item-->
|
|
|
+ <!-- :width="200"-->
|
|
|
+ <!-- label-class-name="label-bold"-->
|
|
|
+ <!-- label="分数:">{{ commit.score }}</el-descriptions-item>-->
|
|
|
+ <!-- <el-descriptions-item-->
|
|
|
+ <!-- label-class-name="label-bold"-->
|
|
|
+ <!-- label="Git Commit ID:" :span="2">{{ commit.hash }}</el-descriptions-item>-->
|
|
|
+ <!-- </el-descriptions>-->
|
|
|
|
|
|
<el-card
|
|
|
- class="son-card" border
|
|
|
- style="background:none ; box-shadow: none; border: none">
|
|
|
-<!-- <template #header>-->
|
|
|
-<!-- <page-header>-->
|
|
|
-<!-- <span style="font-size: 24px;font-family: 'Inter',sans-serif;margin-left: 10px">提交列表</span>-->
|
|
|
-<!-- </page-header>-->
|
|
|
-<!-- </template>-->
|
|
|
+ class="son-card" border
|
|
|
+ style="background:none ; box-shadow: none; border: none">
|
|
|
+ <!-- <template #header>-->
|
|
|
+ <!-- <page-header>-->
|
|
|
+ <!-- <span style="font-size: 24px;font-family: 'Inter',sans-serif;margin-left: 10px">提交列表</span>-->
|
|
|
+ <!-- </page-header>-->
|
|
|
+ <!-- </template>-->
|
|
|
<el-table :data="commit.records">
|
|
|
<el-table-column label="题目">
|
|
|
<template #default="scope">
|
|
|
@@ -33,18 +33,19 @@
|
|
|
<el-table-column label="状态" width="380">
|
|
|
<template #default="scope">
|
|
|
<span
|
|
|
- :style="{color: buildStatusToColor(buildStatusToTagType(scope.row.status))}">
|
|
|
+ :style="{color: buildStatusToColor(buildStatusToTagType(scope.row.status))}">
|
|
|
{{ buildStatusToTagContent(scope.row.status) }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="score" label="分数" width="220" />
|
|
|
+ <el-table-column prop="score" label="分数" width="220"/>
|
|
|
<el-table-column label="操作" width="160">
|
|
|
<template #default="scope">
|
|
|
<el-button
|
|
|
- type="text"
|
|
|
- @click="this.openRecordDetail(scope.row.id)"
|
|
|
- >详情</el-button>
|
|
|
+ type="text"
|
|
|
+ @click="this.openRecordDetail(scope.row.id)"
|
|
|
+ >详情
|
|
|
+ </el-button>
|
|
|
<el-divider direction="vertical"/>
|
|
|
<el-button type="text" class="stop-record-button"
|
|
|
@click="handleStopRecordButtonClick(scope.row.id)">
|
|
|
@@ -74,7 +75,7 @@ export default {
|
|
|
type: Number,
|
|
|
required: true
|
|
|
},
|
|
|
- examId:{
|
|
|
+ examId: {
|
|
|
type: Number,
|
|
|
required: true
|
|
|
}
|
|
|
@@ -86,8 +87,8 @@ export default {
|
|
|
stop: -1
|
|
|
},
|
|
|
loading: false,
|
|
|
- recordDetailVisible:false,
|
|
|
- selectedRecordId:0
|
|
|
+ recordDetailVisible: false,
|
|
|
+ selectedRecordId: 0
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -96,27 +97,27 @@ export default {
|
|
|
methods: {
|
|
|
fetchData() {
|
|
|
this.$apis.getCommitByCommitId(this.commitId)
|
|
|
- .then(_res => {
|
|
|
- this.commit = _res.data.res;
|
|
|
- console.log("commit",this.commit);
|
|
|
- }).catch(_err => {
|
|
|
+ .then(_res => {
|
|
|
+ this.commit = _res.data.res;
|
|
|
+ console.log("commit", this.commit);
|
|
|
+ }).catch(_err => {
|
|
|
console.log(_err);
|
|
|
|
|
|
});
|
|
|
},
|
|
|
- openRecordDetail(id){
|
|
|
+ openRecordDetail(id) {
|
|
|
console.log("jumpToRecordDetail!");
|
|
|
- this.selectedRecordId=id;
|
|
|
- console.log("examId",this.examId);
|
|
|
- console.log("recordId",this.selectedRecordId);
|
|
|
- this.recordDetailVisible=true;
|
|
|
+ this.selectedRecordId = id;
|
|
|
+ console.log("examId", this.examId);
|
|
|
+ console.log("recordId", this.selectedRecordId);
|
|
|
+ this.recordDetailVisible = true;
|
|
|
// this.$router.push(`${this.$route.path}/commit/${this.commitId}/record/${id}`);
|
|
|
},
|
|
|
formatTimestamp,
|
|
|
buildStatusToTagType,
|
|
|
buildStatusToTagContent,
|
|
|
buildStatusToColor(status) {
|
|
|
- switch(status) {
|
|
|
+ switch (status) {
|
|
|
case "success":
|
|
|
return this.$color.ElEMENT_COLOR.successColor;
|
|
|
case "warning":
|
|
|
@@ -130,7 +131,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 点击"停止"按钮,停止当前提交的运行;
|
|
|
- async handleStopRecordButtonClick(recordId){
|
|
|
+ async handleStopRecordButtonClick(recordId) {
|
|
|
const res = (await this.$apis.stopRecordById(recordId)).data;
|
|
|
this.fetchData();
|
|
|
},
|
|
|
@@ -139,7 +140,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-:deep .el-descriptions__body{
|
|
|
+:deep .el-descriptions__body {
|
|
|
font-size: 16px;
|
|
|
background-color: #F8F9FB; //样式穿透,覆盖原本的样式
|
|
|
}
|
|
|
@@ -154,11 +155,11 @@ export default {
|
|
|
padding-bottom: 0 !important;
|
|
|
}
|
|
|
|
|
|
-.stop-record-button{
|
|
|
+.stop-record-button {
|
|
|
color: var(--el-color-danger);
|
|
|
}
|
|
|
|
|
|
-.stop-record-button:hover{
|
|
|
- opacity: 75%;
|
|
|
+.stop-record-button:hover {
|
|
|
+ color: rgba(245, 108, 108, 75%);
|
|
|
}
|
|
|
</style>
|