Parcourir la source

feat[wwf]:门户eaxm详情等UI逻辑修改

StackWwf il y a 3 ans
Parent
commit
428d34ddde

+ 8 - 1
src/views/CoderPage/ExamDetail.vue

@@ -234,6 +234,11 @@
               </el-button>
             </template>
           </el-table-column>
+          <el-table-column type="expand">
+            <template #default="scope">
+              <CommitBoard :commit-id="scope.row.id" :exam-id="$route.params.examId"></CommitBoard>
+            </template>
+          </el-table-column>
         </el-table>
       </el-card>
 
@@ -420,6 +425,7 @@ import {
 } from "@/utils/coder-utils";
 import {mapGetters} from "vuex";
 import PageHeader from "../../components/PageHeader.vue";
+import CommitBoard from "@/views/CoderPage/ResultPage/CommitPage/components/CommitBoard.vue";
 import Echarts from "@/views/CoderPage/ResultPage/Echarts.vue";
 import {ElMessage} from "element-plus";
 import Clipboard from "clipboard";
@@ -429,7 +435,8 @@ export default {
   name: "ExamDetail",
   components: {
     PageHeader,
-    Echarts
+    Echarts,
+    CommitBoard
   },
   props: {},
   data() {

+ 13 - 8
src/views/CoderPage/ResultPage/CommitPage/RecordPage/RecordDetail.vue

@@ -22,9 +22,9 @@
               查看控制台输出
             </el-button>
           </template>
-          <el-button @click="getBack" style="border: none;background: none;">
-            <el-icon :size="22"><Back /></el-icon>
-          </el-button>
+<!--          <el-button @click="getBack" style="border: none;background: none;">-->
+<!--            <el-icon :size="22"><Back /></el-icon>-->
+<!--          </el-button>-->
           <span style="font-size: 36px;font-family: 'Inter',sans-serif">运行详情</span>
         </page-header>
       </template>
@@ -95,7 +95,14 @@ export default {
   name: "RecordDetail",
   components: {PageHeader},
   props: {
-
+    examId:{
+      type: Number,
+      required: true
+    },
+    recordId:{
+      type: Number,
+      required: true
+    }
   },
   data() {
     return {
@@ -123,8 +130,7 @@ export default {
   },
   methods: {
     fetchData() {
-      const {recordId} = this.$route.params;
-      this.$apis.getRecordByRecordId(recordId)
+      this.$apis.getRecordByRecordId(this.recordId)
           .then(_res => {
             this.record = _res.data.res;
           }).catch(_err => {
@@ -132,8 +138,7 @@ export default {
       });
     },
     checkConsole() {
-      const {examId} = this.$route.params;
-      this.$apis.getExamIsShownForStu(examId)
+      this.$apis.getExamIsShownForStu(this.examId)
           .then(_res => {
             this.isConsoleOutputShownForStu = _res.data?.res;
           }).catch(_err => {

+ 47 - 28
src/views/CoderPage/ResultPage/CommitPage/components/CommitBoard.vue

@@ -1,30 +1,30 @@
 <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"
-      style="background: none; box-shadow:none;border: none;">
-    <template #header>
-      <page-header>
-        <span style="font-size: 24px;font-family: 'Inter',sans-serif">提交列表</span>
-      </page-header>
-    </template>
-    <el-table :data="commit.records">
+      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" border>
       <el-table-column label="题目">
         <template #default="scope">
           <span>{{ scope.row.problem.name }}</span>
@@ -43,7 +43,7 @@
         <template #default="scope">
           <el-button
               type="text"
-              @click="$router.push(`${$route.path}/record/${scope.row.id}`)"
+              @click="this.openRecordDetail(scope.row.id)"
           >详情</el-button>
           <el-button
               v-if="stopRecordButton(scope.row.status)"
@@ -58,19 +58,28 @@
     </el-table>
   </el-card>
 
+  <el-dialog width="70%" v-model="recordDetailVisible" title="运行详情">
+    <RecordDetail :exam-id="this.examId" :record-id="this.selectedRecordId"></RecordDetail>
+  </el-dialog>
+
 </template>
 
 <script>
 import {formatTimestamp, buildStatusToTagType, buildStatusToTagContent} from "@/utils/coder-utils";
 import PageHeader from "@/views/ProblemPage/components/PageHeader.vue";
+import RecordDetail from "@/views/CoderPage/ResultPage/CommitPage/RecordPage/RecordDetail";
 
 export default {
   name: "CommitBoard",
-  components: {PageHeader},
+  components: {RecordDetail},
   props: {
     commitId: {
       type: Number,
       required: true
+    },
+    examId:{
+      type: Number,
+      required: true
     }
   },
   data() {
@@ -79,7 +88,9 @@ export default {
       dialog: {
         stop: -1
       },
-      loading: false
+      loading: false,
+      recordDetailVisible:false,
+      selectedRecordId:0
     };
   },
   mounted() {
@@ -90,12 +101,20 @@ export default {
       this.$apis.getCommitByCommitId(this.commitId)
           .then(_res => {
             this.commit = _res.data.res;
-            console.log(this.commit);
+            console.log("commit",this.commit);
           }).catch(_err => {
         console.log(_err);
 
       });
     },
+    openRecordDetail(id){
+      console.log("jumpToRecordDetail!");
+      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,

+ 1 - 1
src/views/ProblemPage/ProblemDetail.vue

@@ -129,7 +129,7 @@
       </span>
       </template>
     </el-dialog>
-    <el-dialog v-model="dialog.update" title="更新题目文件">
+    <el-dialog destroy-on-close v-model="dialog.update" title="更新题目文件">
       <el-form label-width="40px">
         <el-form-item label="路径" prop="name">
           <div>{{ selectedFile }}</div>