瀏覽代碼

1.修复了学生作业页面点击返回回到教师批改列表的bug;对几个不需要重构页面的按钮颜色进行了更改

Jiang Pengyu 1 年之前
父節點
當前提交
6124017ab9

+ 2 - 2
src/apis/axios.config.ts

@@ -1,9 +1,9 @@
 import axios from "axios";
 
 // const BASEURL = 'http://47.111.23.171:8081'
-// const BASEURL = 'http://localhost:8082'
+const BASEURL = 'http://localhost:8080'
 // const BASEURL = 'http://8.130.126.86:8080'
-const BASEURL = 'https://air-nju.seec.seecoder.cn/'
+// const BASEURL = 'https://air-nju.seec.seecoder.cn/'
 
 const axiosInstance = axios.create({
     baseURL: BASEURL,

+ 3 - 3
src/layout/Header/index.scss

@@ -38,13 +38,13 @@
       &:hover {
         background-color: #fff;
         color: #000000;
-        border-bottom: 2px solid #597d3b;
+        border-bottom: 2px solid #4A90C4;
       }
 
       &.is-active {
         background-color: #fff;
-        color: #597d3b !important;
-        border-bottom: 2px solid #597d3b;
+        color: #4A90C4 !important;
+        border-bottom: 2px solid #4A90C4;
       }
     }
   }

+ 15 - 15
src/router/index.ts

@@ -16,24 +16,24 @@ const router = createRouter({
     },
 
     // 登录与注册
-    {
-      path: "/",
-      redirect: () => {
-        window.location.href = "https://p-nju.seec.seecoder.cn/login?from=https://air-nju.seec.seecoder.cn";
-        // window.location.href = "http://localhost:8000/login?from=http://localhost:4000";
-        // {本地门户首页地址}?from={本地eai首页地址}
-        return "/"; // 占位返回值,实际不会执行
-    },
-    },
     // {
     //   path: "/",
-    //   redirect: "/login"
+    //   redirect: () => {
+    //     window.location.href = "https://p-nju.seec.seecoder.cn/login?from=https://air-nju.seec.seecoder.cn";
+    //     // window.location.href = "http://localhost:8000/login?from=http://localhost:4000";
+    //     // {本地门户首页地址}?from={本地eai首页地址}
+    //     return "/"; // 占位返回值,实际不会执行
     // },
-    // {
-    //   path: '/login',
-    //   name: 'login',
-    //   component: () => import('../views/LoginPage/LoginPage.vue')
     // },
+    {
+      path: "/",
+      redirect: "/login"
+    },
+    {
+      path: '/login',
+      name: 'login',
+      component: () => import('../views/LoginPage/LoginPage.vue')
+    },
     {
       path: '/register',
       name: 'register',
@@ -195,7 +195,7 @@ const router = createRouter({
  */
   router.beforeEach(async (to) => {
     const store = useStore();
-    const publicPaths = [ '/register', '/passwordChange', '/admin/login'];
+    const publicPaths = [ '/register', '/passwordChange', '/admin/login','/login'];
     // 1. 检查URL中的token
     const urlToken = new URLSearchParams(window.location.search).get('token');
     if (urlToken) {

+ 18 - 9
src/views/AiSpeakingPage/SpeakingRecord.vue

@@ -2,7 +2,7 @@
   <div class="container">
     <div class="header-container">
       <!-- 返回按钮 -->
-      <el-button style="color:#597D3B" class="back-button" type="text" @click="goBack">
+      <el-button style="color:#4A90C4" class="back-button" type="text" @click="goBack">
         <el-icon><Back /></el-icon>
       </el-button>
       <!-- 标题 -->
@@ -255,7 +255,7 @@
             <div class="button-container">
               <div class="left-buttons">
                 <el-button 
-                  style="background-color:#597D3B;color:white;width:200px" 
+                  style="background-color:#4A90C4;color:white;width:200px" 
                   @click="submitComment" 
                   class="submit-button"
                   :loading="submitting"
@@ -264,7 +264,7 @@
                 </el-button>
                 
                 <el-button
-                  style="background-color:#597D3B;color:white;width:200px;margin-top:50px"
+                  style="background-color:#4A90C4;color:white;width:200px;margin-top:50px"
                   @click="handleNext"
                   :disabled="isAllCorrected"
                 >
@@ -272,14 +272,14 @@
                 </el-button>
                 <!-- 新增:评语模板 -->
                 <el-button
-                  style="background-color:#597D3B;color:white;width:200px;margin-top:50px;"
+                  style="background-color:#4A90C4;color:white;width:200px;margin-top:50px;"
                   @click="showTemplateDialog"
                 >
                   评语模板
                 </el-button>
 
                 <el-button
-                  style="background-color:#597D3B;color:white;width:200px;margin-top:50px;"
+                  style="background-color:#4A90C4;color:white;width:200px;margin-top:50px;"
                   @click="goBack"
                 >
                   返回
@@ -937,10 +937,19 @@ onBeforeUnmount(() => {
 });
 
 const goBack = () => {
-  router.push({
-    name: 'myCorrectWithAssignmentId',
-    params: { assignmentId: props.assignmentId }
-  });
+  // 根据用户角色决定返回页面
+  if (ROLE === 'STUDENT') {
+    // 学生返回 myHomework 页面
+    router.push({
+      name: 'myHomework'
+    });
+  } else {
+    // 老师保持原有逻辑,返回批改页面
+    router.push({
+      name: 'myCorrectWithAssignmentId',
+      params: { assignmentId: props.assignmentId }
+    });
+  }
 };
 
 const ROLE = store.user.role;

+ 1 - 1
src/views/EditPage/EditPage.vue

@@ -8,7 +8,7 @@
   <div class="my-work" >
 
     <div class="my-work-slider">
-      <el-button class="back" color="#597D3B" @click="handleBack">&lt;返回</el-button>
+      <el-button class="back" color="#4A90C4" style="color: #FFFFFF;" @click="handleBack">返回</el-button>
       <AIChatter :dialogueId="dataForm.dialogueId" :messages="dataForm.messages" :is-teacher="false" />
       <Dictionaries />
     </div>

+ 2 - 2
src/views/Home/component/Edit/index.vue

@@ -11,8 +11,8 @@
         <QuillEditor/>
       </div>
       <div class="button-right">
-        <el-button type="primary" @click="handleSubmit" :disabled="useBtn" color="#597D3B">提交</el-button>
-        <el-button type="primary" @click="handleStage" :disabled="useBtn" color="#597D3B">暂存</el-button>
+        <el-button type="primary" @click="handleSubmit" :disabled="useBtn" color="#4A90C4" style="color: #FFFFFF; width: 70px;">提交</el-button>
+        <el-button type="primary" @click="handleStage" :disabled="useBtn" color="#4A90C4" style="color: #FFFFFF; width: 70px; margin-left: 15px;">暂存</el-button>
       </div>
     </div>
   </div>

+ 13 - 4
src/views/Home/component/Remark/Remark.vue

@@ -260,10 +260,19 @@ export default defineComponent({
     };
 
     const goBack = () => {
-      router.push({
-        name: 'myCorrectWithAssignmentId',
-        params: { assignmentId: props.assignmentId }
-      });
+      // 根据用户角色决定返回页面
+      if (isStudent.value) {
+        // 学生返回 myHomework 页面
+        router.push({
+          name: 'myHomework'
+        });
+      } else {
+        // 老师保持原有逻辑,返回批改页面
+        router.push({
+          name: 'myCorrectWithAssignmentId',
+          params: { assignmentId: props.assignmentId }
+        });
+      }
     };
     //新增:验证评分是否在1-100之间
     const validateScore = () => {

+ 2 - 1
src/views/Home/component/Silder/index.scss

@@ -48,7 +48,8 @@
     gap: 10px;
 
     .slider-tag-item {
-      background-color: #add94f;
+      background-color: #4A90C4;
+      color: #FFFFFF;
       padding: 8px 0;
       display: flex;
       justify-content: center;