Explorar o código

第一次提交3

baiseventeen %!s(int64=2) %!d(string=hai) anos
pai
achega
cc1755b367

+ 13 - 0
index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <link rel="icon" href="/favicon.ico">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Vite App</title>
+  </head>
+  <body>
+    <div id="app"></div>
+    <script type="module" src="/src/main.ts"></script>
+  </body>
+</html>

+ 10 - 0
src/components/ViewsWordEditor/index.scss

@@ -0,0 +1,10 @@
+.view-word-editor{
+  .full-modal {
+    height: 90vh;
+  }
+  .button-right {
+    display: flex;
+    gap: 5px;
+    justify-content: flex-end;
+  }
+}

+ 27 - 0
src/components/languageIcon/index.scss

@@ -0,0 +1,27 @@
+.language-icon {
+  position: relative;
+  cursor: pointer;
+  user-select: none;
+
+  .text-icons {
+    position: absolute;
+    font-size: 10px;
+
+    z-index: 999;
+    background-color: #ffffff;
+    line-height: 10px;
+
+    &.z {
+      right: -3px;
+      bottom: 2px;
+    }
+
+    &.y {
+      left: -3px;
+      top: 0;
+    }
+  }
+
+  .text-icons {
+  }
+}

+ 56 - 0
src/layout/Header/index.scss

@@ -0,0 +1,56 @@
+.header {
+  height: 40px;
+  line-height: 40px;
+  flex-shrink: 0;
+  padding: 0 32px;
+  box-sizing: border-box;
+  border-bottom: solid 1px #e8e8e8;
+  //box-shadow: rgba(0, 0, 0, 0.1) 0 4px 10px;
+  display: flex;
+  align-items: center;
+  background-color: #fff;
+
+  .header-icons {
+    display: flex;
+    color: #597D3B;
+  }
+
+  .header-menu {
+    margin-left: 100px;
+
+    & .menu {
+      height: 40px;
+    }
+
+    & .header-menu-item{
+      color: #000000;
+      height: 40px;
+
+      &:hover{
+        //z-index: 1;
+        background-color: #fff;
+        color: #000000;
+        border-bottom: 2px solid #597D3B;
+        //& .header-menu-item-text{
+        //  z-index: 99;
+        //  border-bottom: 2px solid #597D3B;
+        //}
+      }
+
+      &.is-active{
+        background-color: #fff;
+        color: #597D3B!important;
+        border-bottom: 2px solid #597D3B;
+      }
+    }
+  }
+
+  .header-userName {
+    margin-left: auto;
+    display: flex;
+    align-items: center;
+    gap: 15px;
+    float: right;
+  }
+}
+

+ 0 - 0
src/views/CoursePage/index.scss


+ 20 - 0
src/views/CourseSquare/component/Banner/index.scss

@@ -0,0 +1,20 @@
+.carousel-banner {
+  width: 1200px;
+  margin: 0 auto;
+  height: 300px;
+  //border-radius: 10px;
+  overflow: hidden;
+  position: relative;
+
+  .carousel-items {
+    height: 100%;
+    //width: 700px;
+
+    & .carousel-image {
+      height: 100%;
+      width: 100%;
+      object-fit: cover;
+    }
+  }
+}
+//}

+ 114 - 0
src/views/HomeworkPage/component/HomeworkDetail.vue

@@ -0,0 +1,114 @@
+<template>
+  <div class="homework-details">
+    <div class="homework-details-title">
+      作业详情
+    </div>
+    <div class="homework-details-info">
+      <div class="homework-details-text">
+        <div class="title">
+          {{data.assignmentName}}
+        </div>
+        <div class="item">
+          <span style="font-weight: 600">作业描述: </span>
+          {{data.description}}
+        </div>
+        <div class="item">
+          <span style="font-weight: 600">发布老师: </span>
+          {{data.teacherId}}
+        </div>
+        <div class="item">
+          <span style="font-weight: 600">截止日期: </span>
+          {{new Date(Date.parse(data.endTime)).toLocaleString()}}
+        </div>
+        <div class="item">
+          <el-link type="primary" @click="console.log('文件下载')">相关文件下载</el-link>
+          <el-button color="#597d3b" size="large" style="margin-left: 660px" @click="handleWriting()">开始写作</el-button>
+        </div>
+      </div>
+    </div>
+    <div class="homework-details-title">
+      评论区
+    </div>
+    <div class="homework-remark">
+      <div>
+        <el-skeleton style="width: 240px" animated >
+          <template #template>
+            <el-skeleton-item variant="circle" style="--el-skeleton-circle-size: 40px"></el-skeleton-item>
+            <el-skeleton-item variant="text" style="height: 40px;width: 200px; margin-left: 30px"></el-skeleton-item>
+          </template>
+        </el-skeleton>
+      </div>
+      <div>
+        <el-input type="textarea" style="width: 100%;margin: 20px 0"></el-input>
+        <el-button color="#597d3b" size="large" style="float: right">发布</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import useApis from "@/apis";
+import {useRoute} from "vue-router";
+import {onMounted, reactive} from "vue";
+import type {IAssignment} from "@/types/vo";
+import './homeworkDetail.scss'
+import {useStore} from "@/store";
+import router from "@/router";
+import {ElMessage} from "element-plus";
+
+const apis = useApis()
+const store = useStore()
+const route = useRoute()
+const assignmentId = +route.params.assignmentId //string转number
+
+let data = reactive<IAssignment>({
+  assignmentId: null,
+  assignmentName: "",
+  description: "",
+  descriptionFile: null,
+  attachments: null,
+  teacherId: null,
+  courseId: null,
+  startTime: "",
+  endTime: "",
+  createTime: "",
+  status: ""
+})
+
+async function handleWriting(){
+  await apis.getEngagement(store.user.id, assignmentId)
+      .then((_res:any) => {
+        console.log(_res)
+        //还未参加作业,则先加入作业
+        if(_res.data.data == null){
+          apis.engageAssignment(assignmentId);
+          ElMessage({
+            message: '参加作业成功',
+            type: 'success',
+          })
+        } else {
+          router.push(`/home/assignment/${assignmentId}/edit`)
+        }
+      }).catch((_err:any) => {
+        console.log(_err)
+      })
+
+}
+
+const fetchData = () => {
+  apis.getAssignmentById(assignmentId)
+      .then((res: any) => {
+        Object.assign(data, res.data.data)
+      })
+}
+
+onMounted(() => {
+  fetchData()
+})
+</script>
+
+<script lang="ts">
+export default {
+  name: "HomeworkDetail"
+}
+</script>

+ 50 - 0
src/views/HomeworkPage/component/homeworkDetail.scss

@@ -0,0 +1,50 @@
+.homework-details {
+  width: 800px;
+  margin: 0 auto;
+  padding: 20px;
+  //background-color: #fff;
+
+  .homework-details-title {
+    font-weight: 600;
+    font-size: 20px;
+    margin: 10px 20px;
+    font-family: v-sans !important;
+  }
+
+  .homework-details-info {
+    padding: 20px;
+    box-sizing: border-box;
+    border-radius: 7px;
+    border: solid 1px #d0d0d0;
+    display: flex;
+    gap: 20px;
+    background-color: #fff;
+    line-height: 30px;
+
+    .homework-details-text {
+      display: flex;
+      flex-direction: column;
+      gap: 15px;
+    }
+
+    .title {
+      font-size: 18px;
+      font-weight: 600;
+    }
+
+    .item {
+    }
+  }
+
+  .homework-remark {
+    padding: 20px;
+    box-sizing: border-box;
+    border-radius: 7px;
+    border: solid 1px #d0d0d0;
+    background-color: #fff;
+    line-height: 30px;
+    overflow: hidden;
+  }
+
+
+}