Forráskód Böngészése

Merge remote-tracking branch 'origin/seec' into seec

181250114 3 éve
szülő
commit
d540daf4d8

BIN
public/favicon.ico


+ 26 - 18
src/api/courseWare.js

@@ -35,25 +35,32 @@ function downloadCourseWare(id) {
 // const slideUrl = host + "/api/slide";
 // const useSlideServer = postfix => postfix ? slideUrl + postfix : slideUrl;
 
-// 获取课件的文件链接
-function getSlideUrl (slideId) {
-    // return axios
-    //     .get(useSlideServer("/" + slideId + "/url"))
-    //     .then(res => res.data);
-    return axios.get(`${prefix}/getSlideUrl`, {params: {slideId}});
-}
+// // 获取课件的文件链接
+// function getSlideUrl (slideId) {
+//     // return axios
+//     //     .get(useSlideServer("/" + slideId + "/url"))
+//     //     .then(res => res.data);
+//     return axios.get(`${prefix}/getSlideUrl`, {params: {slideId}});
+// }
+//
+// // 获取某个具体课件的信息
+// function getSlideInfo (slideId) {
+//     // return axios
+//     //     .get(useSlideServer("/" + slideId))
+//     //     .then(res => res.data);
+//     return axios.get(`${prefix}/getSlideInfo`, {params: {slideId}});
+// }
 
-// 获取某个具体课件的信息
-function getSlideInfo (slideId) {
-    // return axios
-    //     .get(useSlideServer("/" + slideId))
-    //     .then(res => res.data);
-    return axios.get(`${prefix}/getSlideInfo`, {params: {slideId}});
+function checkCourseWareNameUnique(courseId, name) {
+    return axios.get(`${prefix}/checkName`, {params: {courseId, name}});
 }
 
-function checkCourseWareNameUnique(courseId, name) {
-    return axios.get(`${prefix}/checkName`, {
-        params: {courseId, name}
+function changeCourseWareName(id, newName) {
+    return axios.post(`${prefix}/changeCourseWareName`, null, {
+        params: {
+            id,
+            newName,
+        }
     });
 }
 
@@ -65,8 +72,9 @@ const courseWareAPIs = {
     uploadCourseWareFile,
     downloadCourseWare,
     checkCourseWareNameUnique,
-    getSlideUrl,
-    getSlideInfo
+    // getSlideUrl,
+    // getSlideInfo,
+    changeCourseWareName
 };
 
 export default courseWareAPIs;

+ 0 - 190
src/components/Basic/CButton.vue

@@ -1,190 +0,0 @@
-<!--<template>-->
-<!--  <button class="c-button" :style="style" :class="classList" @click="$emit('click')">-->
-<!--    <c-icon :bold="!noBold" :right="6" :left="-4" v-if="icon" class="icon" :size="20">{{icon}}</c-icon>-->
-<!--    <slot></slot>-->
-<!--  </button>-->
-<!--</template>-->
-
-<!--<script>-->
-<!--import CIcon from "@/components/Basic/CIcon";-->
-
-<!--export default {-->
-<!--  components: { CIcon },-->
-<!--  // props: ['icon', 'noClickWarn']-->
-<!--  props: {-->
-<!--    icon: {-->
-<!--      type: String,-->
-<!--      default: null-->
-<!--    },-->
-<!--    noClickWarn: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    theme: {-->
-<!--      type: String,-->
-<!--      default: "normal"-->
-<!--    },-->
-<!--    // 背景透明的按钮-->
-<!--    text: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    // 使用白色字体、深色背景的最显眼按钮,优先级大于 text-->
-<!--    standout: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    // 占满宽度-->
-<!--    block: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    small: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    large: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    // 去掉涟漪效果-->
-<!--    noRipple: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    noBold: {-->
-<!--      type: Boolean,-->
-<!--      default: false-->
-<!--    },-->
-<!--    left: {-->
-<!--      type: Number,-->
-<!--      default: 0-->
-<!--    },-->
-<!--    right: {-->
-<!--      type: Number,-->
-<!--      default: 0-->
-<!--    }-->
-<!--  },-->
-<!--  computed: {-->
-<!--    style () {-->
-<!--      return {-->
-<!--        marginRight: this.right ? this.right + "px" : null,-->
-<!--        marginLeft: this.left ? this.left + "px" : null-->
-<!--      };-->
-<!--    },-->
-<!--    classList () {-->
-<!--      return [-->
-<!--        this.standout-->
-<!--          ? (this.theme ? "c-button-standout&#45;&#45;" + this.theme : "c-button-standout&#45;&#45;normal")-->
-<!--          : (-->
-<!--            this.text-->
-<!--              ? (this.theme ? "c-button-text&#45;&#45;" + this.theme : "c-button-text&#45;&#45;normal")-->
-<!--              : (this.theme ? "c-button&#45;&#45;" + this.theme : "c-button&#45;&#45;normal")-->
-<!--          ),-->
-<!--        this.large ? "c-button&#45;&#45;large" : "",-->
-<!--        this.small ? "c-button&#45;&#45;small" : "",-->
-<!--        this.noClickWarn ? "c-button&#45;&#45;disabled" : "",-->
-<!--        this.block ? "c-button&#45;&#45;block" : ""-->
-<!--      ];-->
-<!--    }-->
-<!--  }-->
-<!--};-->
-<!--</script>-->
-
-<!--<style lang="scss" scoped>-->
-<!--@import "src/style/theme.scss";-->
-<!--@import "src/style/set-theme.scss";-->
-
-<!--button {-->
-<!--  border: none;-->
-<!--  outline: none;-->
-<!--  cursor: pointer;-->
-<!--  display: inline-flex;-->
-<!--  align-items: center;-->
-<!--  justify-content: center;-->
-<!--  -webkit-tap-highlight-color: transparent;-->
-
-<!--  background: $theme-background-grey;-->
-<!--  color: $theme-grey;-->
-<!--  border-radius: 8px;-->
-<!--  font-size: 14px;-->
-<!--  padding: 8px 16px;-->
-<!--  font-weight: bold;-->
-<!--  box-sizing: border-box;-->
-<!--  transition: .15s;-->
-<!--  white-space: nowrap;-->
-
-<!--  &:hover {-->
-<!--    background: darken($theme-background-grey, 5);-->
-<!--  }-->
-
-<!--  &:active {-->
-<!--    background: darken($theme-background-grey-darker, 10);-->
-<!--  }-->
-<!--}-->
-
-<!--.c-button&#45;&#45;block {-->
-<!--  display: flex;-->
-<!--  width: 100%;-->
-<!--}-->
-
-<!--@mixin theme($name, $color, $backgroundColor) {-->
-<!--  .c-button&#45;&#45;#{$name} {-->
-<!--    color: $color;-->
-<!--    background: $backgroundColor;-->
-
-<!--    &:hover {-->
-<!--      background: darken($backgroundColor, 5);-->
-<!--    }-->
-
-<!--    &:active {-->
-<!--      background: darken($backgroundColor, 10);-->
-<!--    }-->
-
-<!--    .icon {-->
-<!--      color: $color;-->
-<!--    }-->
-<!--  }-->
-<!--  .c-button-text&#45;&#45;#{$name} {-->
-<!--    color: $color;-->
-<!--    border-radius: 1000px;-->
-<!--    background: transparent;-->
-<!--    transition: .3s;-->
-
-<!--    &:hover {-->
-<!--      background: $backgroundColor;-->
-<!--    }-->
-
-<!--    &:active {-->
-<!--      background: darken($backgroundColor, 5);-->
-<!--    }-->
-
-<!--    .icon {-->
-<!--      color: $color;-->
-<!--    }-->
-<!--  }-->
-<!--  .c-button-standout&#45;&#45;#{$name} {-->
-<!--    color: white;-->
-<!--    background: $color;-->
-
-<!--    &:hover {-->
-<!--      background: lighten($color, 5);-->
-<!--    }-->
-
-<!--    &:active {-->
-<!--      background: lighten($color, 10);-->
-<!--    }-->
-
-<!--    .icon {-->
-<!--      color: white;-->
-<!--    }-->
-<!--  }-->
-<!--}-->
-
-<!--@include setTheme();-->
-
-<!--.c-button&#45;&#45;disabled {-->
-<!--  opacity: .3;-->
-<!--  cursor: not-allowed;-->
-<!--}-->
-<!--</style>-->

+ 0 - 80
src/components/Basic/CIcon.vue

@@ -1,80 +0,0 @@
-<template>
-  <i></i>
-  <!--  <i class="c-icons c-icon" :class="classList" :style="style">-->
-  <!--    <slot></slot>-->
-  <!--  </i>-->
-</template>
-
-<script>
-  // export default {
-  //   props: {
-  //     bold: {
-  //       type: Boolean,
-  //       default: false
-  //     },
-  //
-  //     // icon 大小
-  //     size: {
-  //       type: Number,
-  //       default: 0
-  //     },
-  //
-  //     // 可以直接传入 6 位颜色值,将覆盖 theme 设置的颜色
-  //     color: {
-  //       type: String,
-  //       default: ""
-  //     },
-  //
-  //     theme: {
-  //       type: String,
-  //       default: "normal"
-  //     },
-  //
-  //     right: {
-  //       type: Number,
-  //       default: 0
-  //     },
-  //
-  //     left: {
-  //       type: Number,
-  //       default: 0
-  //     }
-  //   },
-  //   computed: {
-  //     classList () {
-  //       return [
-  //         this.bold ? "bold" : "",
-  //         this.theme ? "c-icon--" + this.theme : ""
-  //       ];
-  //     },
-  //     style () {
-  //       return {
-  //         fontSize: this.size ? this.size + "px" : null,
-  //         marginRight: this.right ? this.right + "px" : null,
-  //         marginLeft: this.left ? this.left + "px" : null,
-  //         color: this.color || null
-  //       };
-  //     }
-  //   }
-  // };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!-- @import "src/style/set-theme.scss";-->
-<!--i {-->
-<!--  transition: .2s ease-out;-->
-<!--}-->
-
-<!--.bold {-->
-<!--  font-weight: bold;-->
-<!--}-->
-
-<!--@mixin theme($name, $color, $backgroundColor) {-->
-<!--  .c-icon&#45;&#45;#{$name} {-->
-<!--    color: $color;-->
-<!--  }-->
-<!--}-->
-
-<!--@include setTheme-->
-<!--</style>-->
-

+ 0 - 76
src/components/Basic/CInput.vue

@@ -1,76 +0,0 @@
-<template>
-    <el-button></el-button>
-    <!--  <component-->
-    <!--    class="c-input"-->
-    <!--    :required="required"-->
-    <!--    :is="textarea ? 'textarea' : 'input'"-->
-    <!--    :type="type ? type : 'text'"-->
-    <!--    :placeholder="placeholder"-->
-    <!--    :value="value"-->
-    <!--    :maxlength="maxlength ? maxlength : null"-->
-    <!--    @input="$emit('input', $event.target.value)"-->
-    <!--  />-->
-</template>
-
-<script>
-    // export default {
-    //   model: {
-    //     prop: "value",
-    //     event: "input"
-    //   },
-    //   props: {
-    //     value: [String, Number],
-    //     placeholder: String,
-    //     textarea: Boolean,
-    //     type: String,
-    //     maxlength: Number,
-    //     required: Boolean
-    //   }
-    // };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--@import "src/style/theme.scss";-->
-
-<!--input, textarea {-->
-<!--  box-sizing: border-box;-->
-<!--  font-size: 16px;-->
-<!--  font-weight: bold;-->
-<!--  color: #3a4a5a;-->
-<!--  background: $input-background-color;-->
-<!--  border-radius: 8px;-->
-<!--  border: none;-->
-<!--  outline: none;-->
-<!--  width: 100%;-->
-<!--  height: 40px;-->
-<!--  line-height: 1.5;-->
-<!--  padding: 0 12px 0 12px;-->
-<!--  transition: .2s;-->
-
-<!--  &:hover {-->
-<!--    background: $input-hover-background-color;-->
-<!--  }-->
-
-<!--  &::placeholder {-->
-<!--    color: #8a9aaa;-->
-<!--  }-->
-<!--}-->
-
-<!--textarea {-->
-<!--  min-height: 96px;-->
-<!--  height: 100%;-->
-<!--  padding: 6px 12px;-->
-<!--  resize: none;-->
-<!--}-->
-
-<!--// 去掉数字输入框中的调整数字按键-->
-<!--input::-webkit-outer-spin-button,-->
-<!--input::-webkit-inner-spin-button {-->
-<!--  -webkit-appearance: none;-->
-<!--  margin: 0;-->
-<!--}-->
-
-<!--input[type=number] {-->
-<!--  -moz-appearance: textfield;-->
-<!--}-->
-<!--</style>-->

+ 0 - 48
src/components/Basic/CTag.vue

@@ -1,48 +0,0 @@
-<template>
-    <el-tag></el-tag>
-    <!--  <div class="c-tag" :class="classList">-->
-    <!--    <slot></slot>-->
-    <!--  </div>-->
-</template>
-
-<script>
-    // export default {
-    //   props: {
-    //     theme: {
-    //       type: String,
-    //       default: "normal"
-    //     }
-    //   },
-    //   computed: {
-    //     classList () {
-    //       return [this.theme ? "c-tag--" + this.theme : ""];
-    //     }
-    //   }
-    // };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--@import "src/style/set-theme.scss";-->
-
-<!--div {-->
-<!--  transition: .2s;-->
-<!--  display: inline-block;-->
-<!--  padding: 4px;-->
-<!--  border-radius: 4px;-->
-<!--  margin-left: 4px;-->
-<!--  font-size: 12px;-->
-<!--  line-height: 1;-->
-<!--  vertical-align: middle;-->
-<!--  position: relative;-->
-<!--  bottom: 1px;-->
-<!--}-->
-
-<!--@mixin theme($name, $color, $backgroundColor) {-->
-<!--  .c-tag&#45;&#45;#{$name} {-->
-<!--    color: $color;-->
-<!--    background: $backgroundColor;-->
-<!--  }-->
-<!--}-->
-
-<!--@include setTheme()-->
-<!--</style>-->

+ 0 - 110
src/components/Basic/IconButton.vue

@@ -1,110 +0,0 @@
-<template>
-  <el-button></el-button>
-  <!--  <div class="icon-button" :class="classList" :title="title ? title : ''" @click="$emit('click')" :style="style">-->
-  <!--    <c-icon :theme="theme" :bold="!noBold" :size="size ? size / 1.4 - 4 : 26">-->
-  <!--      <slot></slot>-->
-  <!--    </c-icon>-->
-  <!--    <ripple :color="theme"></ripple>-->
-  <!--  </div>-->
-</template>
-
-<script>
-  // import CIcon from "@/components/Basic/CIcon";
-  // import Ripple from "@/components/Basic/Ripple";
-  //
-  // export default {
-  //   components: { Ripple, CIcon },
-  //   // props: ['title', 'ripple', 'small']
-  //   props: {
-  //     title: {
-  //       type: String,
-  //       default: "按钮"
-  //     },
-  //
-  //     // 可以直接传入 6 位颜色值,将覆盖 theme 设置的颜色
-  //     color: {
-  //       type: String,
-  //       default: ""
-  //     },
-  //
-  //     // 这个值需要在下方 scss 中有相应的定义,否则无效
-  //     theme: {
-  //       type: String,
-  //       default: "normal"
-  //     },
-  //
-  //     noBold: {
-  //       type: Boolean,
-  //       default: false
-  //     },
-  //
-  //     // icon button 大小
-  //     size: Number,
-  //     left: Number,
-  //     right: Number
-  //   },
-  //   computed: {
-  //     classList () {
-  //       return [this.theme ? "icon-button--" + this.theme : ""];
-  //     },
-  //     style () {
-  //       return {
-  //         color: this.color.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/) ? this.color : "",
-  //         width: this.size ? this.size + "px" : null,
-  //         height: this.size ? this.size + "px" : null,
-  //         marginLeft: this.left ? this.left + "px" : null,
-  //         marginRight: this.right ? this.right + "px" : null
-  //       };
-  //     }
-  //   }
-  // };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--@import "src/style/theme.scss";-->
-<!--@import "src/style/set-theme.scss";-->
-
-<!--.icon-button {-->
-<!--  position: relative;-->
-<!--  display: inline-flex;-->
-<!--  align-items: center;-->
-<!--  justify-content: center;-->
-<!--  padding: 8px;-->
-<!--  border-radius: 100px;-->
-<!--  width: 44px;-->
-<!--  height: 44px;-->
-<!--  box-sizing: border-box;-->
-<!--  user-select: none;-->
-<!--  cursor: pointer;-->
-<!--  text-align: center;-->
-<!--  color: $icon-normal-color;-->
-<!--  transition: background-color 0.2s;-->
-<!--  overflow: hidden;-->
-<!--  clip-path: border-box;-->
-
-<!--  &:hover {-->
-<!--    background: $theme-background-grey;-->
-<!--  }-->
-
-<!--  &:active {-->
-<!--    color: darken($icon-hover-color, 10);-->
-<!--  }-->
-<!--}-->
-
-<!--@mixin theme($name, $color, $backgroundColor) {-->
-<!--  .icon-button&#45;&#45;#{$name} {-->
-<!--    color: $color;-->
-
-<!--    &:hover {-->
-<!--      background: $backgroundColor;-->
-<!--    }-->
-
-<!--    &:active {-->
-<!--      color: darken($color, 10);-->
-<!--    }-->
-<!--  }-->
-<!--}-->
-
-<!--@include setTheme()-->
-<!--</style>-->
-

+ 0 - 105
src/components/Basic/Ripple.vue

@@ -1,105 +0,0 @@
-<template>
-  <el-tag></el-tag>
-  <!--  <div class="ripple-wrapper" :class="color || ''">-->
-  <!--    <div class="ripple" @click="handleRipple" :class="className" :style="size ? `width: ${size}px; height: ${size}px;` : ''">-->
-  <!--    </div>-->
-  <!--    <div class="background"></div>-->
-  <!--  </div>-->
-</template>
-
-<script>
-  // export default {
-  //   props: ["size", "color"],
-  //   data () {
-  //     return {
-  //       className: "hide"
-  //     };
-  //   },
-  //   methods: {
-  //     handleRipple () {
-  //       this.className = "";
-  //       this.$nextTick(() => {
-  //         this.className = "show";
-  //         setTimeout(() => {
-  //           this.className = "";
-  //         }, 500);
-  //       });
-  //     }
-  //   }
-  // };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--@import "src/style/theme.scss";-->
-
-<!--$opacity: 1;-->
-<!--.ripple-wrapper {-->
-<!--  position: absolute;-->
-<!--  width: 100%;-->
-<!--  height: 100%;-->
-<!--  top: 0;-->
-<!--  left: 0;-->
-<!--  display: flex;-->
-<!--  align-items: center;-->
-<!--  justify-content: center;-->
-<!--}-->
-
-<!--.ripple {-->
-<!--  -webkit-tap-highlight-color: transparent;-->
-<!--  opacity: 0;-->
-<!--  width: 80px;-->
-<!--  height: 80px;-->
-<!--  z-index: 2;-->
-<!--  position: absolute;-->
-<!--  background-color: $theme-blue-transparent;-->
-<!--  border-radius: 100000px;-->
-<!--  transform-origin: center;-->
-<!--}-->
-
-<!--.show {-->
-<!--  opacity: $opacity;-->
-<!--  animation: ripple .5s forwards ease-out;-->
-<!--}-->
-
-<!--.red {-->
-<!--  .ripple {-->
-<!--    background: $theme-red-transparent;-->
-<!--  }-->
-<!--}-->
-
-<!--.orange {-->
-<!--  .ripple {-->
-<!--    background: $theme-orange-transparent;-->
-<!--  }-->
-<!--}-->
-
-<!--.green {-->
-<!--  .ripple {-->
-<!--    background: $theme-green-transparent;-->
-<!--  }-->
-<!--}-->
-
-<!--.blue {-->
-<!--  .ripple {-->
-<!--    background: $theme-blue-transparent;-->
-<!--  }-->
-<!--}-->
-
-<!--@keyframes ripple {-->
-<!--  0% {-->
-<!--    opacity: $opacity;-->
-<!--    transform: scale(0.1, 0.1);-->
-<!--  }-->
-<!--  40% {-->
-<!--    opacity: $opacity;-->
-<!--    transform: scale(1, 1);-->
-<!--  }-->
-<!--  80% {-->
-<!--    opacity: $opacity;-->
-<!--    transform: scale(1, 1);-->
-<!--  }-->
-<!--  100% {-->
-<!--    opacity: 0;-->
-<!--  }-->
-<!--}-->
-<!--</style>-->

+ 0 - 141
src/components/PDF/Pdf.vue

@@ -1,141 +0,0 @@
-<template>
-  <button></button>
-<!--  <div class="pdf">-->
-<!--    <canvas class="pdf pdf-canvas" id="pdf-canvas" :class="classList"></canvas>-->
-<!--&lt;!&ndash;    <div v-if="loading" class="loading">加载中...</div>&ndash;&gt;-->
-<!--&lt;!&ndash;    <fade-transition>&ndash;&gt;-->
-<!--&lt;!&ndash;      <div v-if="focus" class="focus-mask">禁用快捷键中...<br>点击空白出退出</div>&ndash;&gt;-->
-<!--&lt;!&ndash;    </fade-transition>&ndash;&gt;-->
-<!--  </div>-->
-</template>
-
-<script>
-// import { mapState } from "vuex";
-// import { SET_TOTAL_PAGES } from "@/store/types/pdf-types";
-// import FadeTransition from "@/animations/FadeTransition";
-//
-// const pdfJS = require("pdfjs-dist");
-// pdfJS.GlobalWorkerOptions.workerSrc = require("pdfjs-dist/build/pdf.worker.entry");
-//
-// export default {
-//   data() {
-//     return {
-//       loading: true,
-//     };
-//   },
-//   mounted() {
-//     this.loading = true;
-//     this._canvas = document.getElementById("pdf-canvas");
-//     this._context = this._canvas.getContext("2d");
-//
-//     // Default size
-//     this._canvas.height = 1080;
-//     this._canvas.width = 1440;
-//
-//     // if (this.src) {
-//     //   console.log(this.src);
-//     //   this.load(this.src);
-//     // } else {
-//     //   // ! 1秒后重试
-//     //   setTimeout(() => {
-//     //     //this.load(this.src);
-//     //   }, 1000);
-//     // }
-//     console.log(this.src);
-//     this.load(this.src);
-//   },
-//   computed: {
-//     ...mapState({
-//       src: state => state.pdf.src,
-//       showDiscussion: state => state.pdf.showDiscussion,
-//       currentPage: state => state.pdf.currentPage,
-//       screenShot: state => state.pdf.screenShot,
-//       focus: state => state.pdf.focus
-//     }),
-//     classList() {
-//       return {
-//         "full-size": !this.showDiscussion
-//       };
-//     }
-//   },
-//   watch: {
-//     currentPage() {
-//       this.showPage();
-//     }
-//   },
-//   methods: {
-//     load(src) {
-//       console.log(src);
-//       const loadingTask = pdfJS.getDocument(src);
-//       loadingTask.promise.then(pdf => {
-//         this.loading = false;
-//         this._pdf = pdf;
-//         this.$store.commit(SET_TOTAL_PAGES, {totalPages: pdf.numPages});
-//         this.showPage();
-//       });
-//     },
-//     showPage() {
-//       this._pdf && this._pdf.getPage(this.currentPage || 1).then(page => {
-//         const scale = 2.5;
-//         const viewport = page.getViewport({scale: scale});
-//
-//         this._canvas.height = viewport.height;
-//         this._canvas.width = viewport.width;
-//
-//         const renderContext = {
-//           canvasContext: this._context,
-//           viewport: viewport
-//         };
-//         page.render(renderContext);
-//       }).catch(() => {
-//         console.log("PDF 当前页解析错误");
-//         //this.$setInfoMessage('PDF 当前页解析错误')
-//       });
-//     }
-//   },
-// };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--@import 'src/style/set-theme.scss';-->
-
-<!--.pdf {-->
-<!--  z-index: -1;-->
-<!--  position: relative;-->
-<!--}-->
-
-<!--.loading, .focus-mask {-->
-<!--  position: absolute;-->
-<!--  display: flex;-->
-<!--  align-items: center;-->
-<!--  justify-content: center;-->
-<!--  height: 100%;-->
-<!--  width: 100%;-->
-<!--  top: 0;-->
-<!--  left: 0;-->
-<!--  color: #7a8a9a;-->
-<!--  font-size: 40px;-->
-<!--}-->
-
-<!--.focus-mask {-->
-<!--  box-sizing: border-box;-->
-<!--  padding-top: 60vh;-->
-<!--  font-size: 24px;-->
-<!--  background: rgba(255, 255, 255, 0.5);-->
-<!--  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.5);-->
-<!--  color: #3a4a5a;-->
-<!--  text-shadow: 2px 2px 6px rgba(255, 255, 255, 1);-->
-<!--}-->
-
-<!--.pdf-canvas {-->
-<!--  z-index: 0;-->
-<!--  outline: none;-->
-<!--  display: block;-->
-<!--  direction: ltr;-->
-<!--  margin: 0 auto;-->
-<!--  background-color: white;-->
-<!--  max-width: 100vw;-->
-<!--  max-height: 100vh;-->
-<!--}-->
-
-<!--</style>-->

+ 0 - 165
src/components/PDF/PdfController.vue

@@ -1,165 +0,0 @@
-<template>
-  <button></button>
-<!--  <div class="pdf-controller" style="margin-top: 5%">-->
-<!--    <div class="actions" :class="hide ? 'hide-actions' : ''">-->
-<!--      <a :href="src">-->
-<!--        <icon-button title="下载"><i class="el-icon-download"/></icon-button>-->
-<!--      </a>-->
-<!--      <icon-button @click="handlePrevious" title="上一页"><i class="el-icon-arrow-left"/></icon-button>-->
-<!--      <label class="to-page-action">-->
-<!--        {{currentPage}} / {{totalPages}}-->
-<!--        <c-input placeholder="to" ref="input" type="number" v-model="toPage" @input="handleToPage"/>-->
-<!--      </label>-->
-<!--      <icon-button @click="handleNext" title="下一页"><i class="el-icon-arrow-right"/></icon-button>-->
-<!--      <icon-button :theme="showDiscussion ? 'blue' : null" @click="handleDiscussionShowState" title="讨论区"><i class="el-icon-chat-dot-square"/>-->
-<!--      </icon-button>-->
-<!--    </div>-->
-<!--    <icon-button theme="blue" @click="handleHide" title="收起" class="show-button" :class="hide ? 'show-button-hide' : 'show-button-show'">-->
-<!--      <i class="el-icon-arrow-down"/>-->
-<!--    </icon-button>-->
-<!--  </div>-->
-</template>
-
-<script>
-// import IconButton from "@/components/Basic/IconButton";
-// import { NEXT_PAGE, PREVIOUS_PAGE, SET_CURRENT_PAGE, TOGGLE_SHOW_DISCUSSION } from "@/store/types/pdf-types";
-// import { mapState } from "vuex";
-// import CInput from "@/components/Basic/CInput";
-// import { isEmpty } from "@/utils/types";
-//
-// export default {
-//   components: { CInput, IconButton },
-//   data () {
-//     return {
-//       pageMarked: false,
-//       toPage: "",
-//       hide: false
-//     };
-//   },
-//   computed: {
-//     ...mapState({
-//       showDiscussion: state => state.pdf.showDiscussion,
-//       src: state => state.pdf.src,
-//       totalPages: state => state.pdf.totalPages,
-//       currentPage: state => state.pdf.currentPage
-//     })
-//   },
-//   methods: {
-//     handleDiscussionShowState () {
-//       this.$store.commit(TOGGLE_SHOW_DISCUSSION);
-//     },
-//     handlePrevious () {
-//       this.$store.commit(PREVIOUS_PAGE);
-//     },
-//     handleNext () {
-//       this.$store.commit(NEXT_PAGE);
-//     },
-//     handleToPage (value) {
-//       if (isEmpty(value) || value === "" || value === 0) {
-//         return;
-//       }
-//       value = typeof value === typeof "" ? parseInt(value) : value;
-//       if (value > this.totalPages) {
-//         console.log("超过最大页数,已跳到最后一页");
-//         this.$store.commit(SET_CURRENT_PAGE, { currentPage: this.totalPages });
-//       } else if (value <= 0) {
-//         console.log("超过最小页数,已跳到第一页");
-//         this.$store.commit(SET_CURRENT_PAGE, { currentPage: 1 });
-//       } else {
-//         this.$store.commit(SET_CURRENT_PAGE, { currentPage: value });
-//       }
-//     },
-//     handleHide () {
-//       this.hide = !this.hide;
-//     }
-//     // handleScreenShot () {
-//     //   this.$store.commit(SET_SCREEN_SHOT)
-//     // }
-//   }
-// };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--//@import 'src/style/set-theme.scss';-->
-
-<!--.pdf-controller {-->
-<!--  position: fixed;-->
-<!--  right: 12px;-->
-<!--  top: 12px;-->
-<!--  display: flex;-->
-<!--  align-items: center;-->
-<!--  justify-content: center;-->
-<!--  z-index: 2;-->
-
-<!--  transition: .2s ease-out;-->
-<!--}-->
-
-<!--.actions {-->
-<!--  display: flex;-->
-<!--  align-items: center;-->
-<!--  justify-content: center;-->
-
-<!--  padding: 4px 12px;-->
-<!--  margin-right: 12px;-->
-
-<!--  border-radius: 12px;-->
-<!--  background-color: rgba(218, 234, 250, 0.4);-->
-<!--  backdrop-filter: saturate(150%) blur(20px);-->
-
-<!--  transition: .2s ease-out;-->
-
-<!--  .icon-button {-->
-<!--    margin: 0 4px;-->
-<!--  }-->
-<!--}-->
-
-<!--.hide-actions {-->
-<!--  transform: translateY(-80px);-->
-<!--}-->
-
-<!--.to-page-action {-->
-<!--  color: #7a8a9a;-->
-<!--  padding: 0 6px;-->
-<!--  font-size: 14px;-->
-
-<!--  .c-input {-->
-<!--    max-width: 40px;-->
-<!--    height: 30px;-->
-<!--    font-size: 14px;-->
-<!--    padding-left: 8px;-->
-<!--    background-color: white;-->
-<!--    margin-left: 6px;-->
-<!--  }-->
-<!--}-->
-
-<!--.show-button {-->
-<!--  transition: .2s ease-out;-->
-<!--}-->
-
-<!--.show-button-hide {-->
-<!--  transform: scale(-1);-->
-<!--}-->
-
-<!--.show-button-show {-->
-<!--  transform: scale(1);-->
-<!--}-->
-
-<!--@media (max-width: 500px) {-->
-<!--  .show-button {-->
-<!--    display: none;-->
-<!--  }-->
-
-<!--  .hide-actions {-->
-<!--    transform: translateY(0);-->
-<!--  }-->
-
-<!--  .actions {-->
-<!--    padding: 4px 6px;-->
-<!--    margin-right: 0;-->
-
-<!--    .icon-button {-->
-<!--      margin: 0;-->
-<!--    }-->
-<!--  }-->
-<!--}-->
-<!--</style>-->

+ 0 - 211
src/components/PDF/PdfViewer.vue

@@ -1,211 +0,0 @@
-<template>
-  <div>
-<!--    <canvas class="pdf pdf-canvas" id="pdf-canvas" :class="classList"></canvas>-->
-
-<!--    <input type="file" ref="fielinput" @change="uploadFile" />-->
-<!--    <div class="canvas-container">-->
-<!--      <canvas ref="myCanvas" class="pdf-container"> </canvas>-->
-<!--    </div>-->
-<!--    <div class="pagination-wrapper">-->
-<!--      <button @click="clickPre">上一页</button>-->
-<!--      <span>第{{ pageNo }} / {{ pdfPageNumber }}页</span>-->
-<!--      <button @click="clickNext">下一页</button>-->
-<!--    </div>-->
-
-<!--    <pdf></pdf>-->
-<!--    <pdf-controller></pdf-controller>-->
-  </div>
-</template>
-
-<script>
-// import Pdf from "@/components/PDF/Pdf";
-// // import PdfController from "@/components/PDF/PdfController";
-//
-// export default {
-//   components: {
-//     // PdfController,
-//     Pdf },
-//   props: ["src"],
-//   data () {
-//     return {
-//       currentPage: 1,
-//       fullSize: !this.discussion
-//     };
-//   },
-//   watch: {
-//     discussion (newValue) {
-//       this.fullSize = !newValue;
-//     }
-//   }
-// };
-//
-
-
-// import { mapState } from "vuex";
-// import { SET_TOTAL_PAGES } from "@/store/types/pdf-types";
-// import FadeTransition from "@/animations/FadeTransition";
-
-// const pdfJS = require("pdfjs-dist");
-// pdfJS.GlobalWorkerOptions.workerSrc = require("pdfjs-dist/build/pdf.worker.entry");
-
-// export default {
-//   data() {
-//     return {
-//       loading: true,
-//     };
-//   },
-//   mounted() {
-//     this.loading = true;
-//     this._canvas = document.getElementById("pdf-canvas");
-//     this._context = this._canvas.getContext("2d");
-//
-//     // Default size
-//     this._canvas.height = 1080;
-//     this._canvas.width = 1440;
-//
-//     if (this.src) {
-//       this.load(this.src);
-//     } else {
-//       // ! 1秒后重试
-//       setTimeout(() => {
-//         this.load(this.src);
-//       }, 1000);
-//     }
-//   },
-//   computed: {
-//     ...mapState({
-//       src: state => state.pdf.src,
-//       showDiscussion: state => state.pdf.showDiscussion,
-//       currentPage: state => state.pdf.currentPage,
-//       screenShot: state => state.pdf.screenShot,
-//       focus: state => state.pdf.focus
-//     }),
-//     classList() {
-//       return {
-//         "full-size": !this.showDiscussion
-//       };
-//     }
-//   },
-//   watch: {
-//     currentPage() {
-//       this.showPage();
-//     }
-//   },
-//   methods: {
-//     load(src) {
-//       console.log(pdfJS);
-//       const loadingTask = pdfJS.getDocument(src);
-//       loadingTask.promise.then(pdf => {
-//         this.loading = false;
-//         this._pdf = pdf;
-//         this.$store.commit(SET_TOTAL_PAGES, {totalPages: pdf.numPages});
-//         this.showPage();
-//       });
-//     },
-//     showPage() {
-//       this._pdf && this._pdf.getPage(this.currentPage || 1).then(page => {
-//         const scale = 2.5;
-//         const viewport = page.getViewport({scale: scale});
-//
-//         this._canvas.height = viewport.height;
-//         this._canvas.width = viewport.width;
-//
-//         const renderContext = {
-//           canvasContext: this._context,
-//           viewport: viewport
-//         };
-//         page.render(renderContext);
-//       }).catch(() => {
-//         console.log("PDF 当前页解析错误");
-//         //this.$setInfoMessage('PDF 当前页解析错误')
-//       });
-//     }
-//   },
-// };
-
-// export default {
-//   mounted() {},
-//   data() {
-//     return {
-//       pageNo: null,
-//       pdfPageNumber: null,
-//       pdfTotalPages: 1,
-//       renderingPage: false,
-//       pdfData: null, // PDF的base64
-//       scale: 1, // 缩放值
-//     };
-//   },
-//   methods: {
-//     uploadFile() {
-//       let inputDom = this.$refs.fielinput;
-//       let file = inputDom.files[0];
-//       let reader = new FileReader();
-//       reader.readAsDataURL(file);
-//       reader.onload = () => {
-//         let data = atob(
-//                 reader.result.substring(reader.result.indexOf(",") + 1)
-//         );
-//         this.loadPdfData(data);
-//       };
-//     },
-//     loadPdfData(data) {
-//       console.log(pdfJS);
-//       // 引入pdf.js的字体
-//       let CMAP_URL = "https://unpkg.com/pdfjs-dist@2.0.943/cmaps/";
-//       //读取base64的pdf流文件
-//       this.pdfData = pdfJS.getDocument({
-//         data: data, // PDF base64编码
-//         cMapUrl: CMAP_URL,
-//         cMapPacked: true,
-//       });
-//       console.log(this.pdfData);
-//       this.renderPage(1);
-//       // this.renderScrollPdf();
-//     },
-//
-//     // 根据页码渲染相应的PDF
-//     renderPage(num) {
-//       this.renderingPage = true;
-//       this.pdfData.promise.then((pdf) => {
-//         this.pdfPageNumber = pdf.numPages;
-//
-//         pdf.getPage(num).then((page) => {
-//           // 获取DOM中为预览PDF准备好的canvasDOM对象
-//           let canvas = this.$refs.myCanvas;
-//           let viewport = page.getViewport(this.scale);
-//           canvas.height = viewport.height;
-//           canvas.width = viewport.width;
-//
-//           let ctx = canvas.getContext("2d");
-//           let renderContext = {
-//             canvasContext: ctx,
-//             viewport: viewport,
-//           };
-//           page.render(renderContext).then(() => {
-//             this.renderingPage = false;
-//             this.pageNo = num;
-//           });
-//         });
-//       });
-//     },
-//     clickPre() {
-//       if (!this.renderingPage && this.pageNo && this.pageNo > 1) {
-//         this.renderPage(this.pageNo - 1);
-//       }
-//     },
-//     clickNext() {
-//       if (
-//               !this.renderingPage &&
-//               this.pdfPageNumber &&
-//               this.pageNo &&
-//               this.pageNo < this.pdfPageNumber
-//       ) {
-//         this.renderPage(this.pageNo + 1);
-//       }
-//     },
-//   },
-// };
-</script>
-
-<!--<style lang="scss" scoped>-->
-<!--</style>-->

+ 0 - 193
src/components/PDF/PointerCanvas.vue

@@ -1,193 +0,0 @@
-<template>
-<!--  <canvas :width="width" :height="height" class="pointer-canvas" ref="pointerCanvas" @click="handleFocus">-->
-<!--  </canvas>-->
-  <div></div>
-</template>
-
-<script>
-// import { mapState } from "vuex";
-// import { USE_FOCUS } from "@/store/types/pdf-types";
-//
-// export default {
-//   name: "PointerCanvas",
-//   props: {
-//     noPointer: Boolean,
-//     noBox: Boolean
-//   },
-//   data () {
-//     return {
-//       points: [],
-//       disablePointer: false,
-//       width: window.innerWidth,
-//       height: document.documentElement.clientHeight,
-//       rects: [],
-//       drawingRect: {},
-//       poped: [],
-//       // 为了突破30fps限制(应该与chrome优化机制有关),往数组中多放入冗余数字,以让动画更流畅
-//       overrate: 4
-//     };
-//   },
-//   computed: {
-//     pointerActive () {
-//       return this.width > 500 && !this.noPointer && !this.disablePointer;
-//     },
-//     ...mapState({
-//       currentPage: state => state.pdf.currentPage
-//     })
-//   },
-//   watch: {
-//     currentPage () {
-//       this.rects = [];
-//       this.poped = [];
-//       this.drawingRect = {};
-//       this.renderer();
-//     }
-//   },
-//   mounted () {
-//     this._canvas = this.$refs.pointerCanvas;
-//     this._ctx = this._canvas.getContext("2d");
-//
-//     window.addEventListener("resize", this.handleResize);
-//     this._canvas.addEventListener("mousemove", this.handleMouseMove);
-//     this._canvas.addEventListener("mousedown", this.handleMouseDown);
-//     this._canvas.addEventListener("mouseup", this.handleMouseUp);
-//     this._interval = setInterval(this.shiftPoints, 1000 / 90);
-//   },
-//   unmounted () {
-//     clearInterval(this._interval);
-//     window.removeEventListener("resize", this.handleResize);
-//     this._canvas.removeEventListener("mousemove", this.handleMouseMove);
-//     this._canvas.removeEventListener("mousedown", this.handleMouseDown);
-//     this._canvas.removeEventListener("mouseup", this.handleMouseUp);
-//   },
-//   methods: {
-//     handleResize () {
-//       this.width = window.innerWidth;
-//       this.height = document.documentElement.clientHeight;
-//       this.renderer();
-//     },
-//     handleMouseMove (e) {
-//       if (this.pointerActive) {
-//         const { x, y } = this.points[this.points.length - 1] ?? { x: 0, y: 0 };
-//         if (this.points.length === 0 || Math.abs(x - e.clientX) > 8 || Math.abs(y - e.clientY) > 8) {
-//           [...Array(this.overrate)].forEach(_ => this.points.unshift({ x: e.clientX, y: e.clientY }));
-//           if (this.points.length > 100) {
-//             [...Array(this.overrate)].forEach(_ => this.points.pop());
-//           }
-//         }
-//       }
-//     },
-//     shiftPoints () {
-//       if (this.points.length > 34) {
-//         this.points.pop();
-//       }
-//       if (this.points.length > 0) {
-//         this.points.pop();
-//         requestAnimationFrame(() => {
-//           this.renderer();
-//         });
-//       }
-//     },
-//     handleMouseDown (e) {
-//       if (!this.noBox) {
-//         this.disablePointer = true;
-//         this.drawingRect.begin = { x: e.clientX, y: e.clientY };
-//
-//         this._canvas.addEventListener("mousemove", this.handleBoxMouseMove);
-//       }
-//     },
-//     handleBoxMouseMove (e) {
-//       this.drawingRect.end = { x: e.clientX, y: e.clientY };
-//       requestAnimationFrame(() => {
-//         this.renderer();
-//       });
-//     },
-//     handleMouseUp (e) {
-//       if (!this.noBox) {
-//         if (this.drawingRect.begin && this.drawingRect.end) {
-//           this.rects.push(this.drawingRect);
-//           this.poped = [];
-//         }
-//         this._canvas.removeEventListener("mousemove", this.handleBoxMouseMove);
-//         this.disablePointer = false;
-//         this.renderer();
-//         this.drawingRect = {};
-//       }
-//     },
-//     renderer () {
-//       this._ctx.clearRect(0, 0, 2000, 2000);
-//
-//       // 框选
-//       this._ctx.lineWidth = 4;
-//       this._ctx.lineJoin = "round";
-//       this._ctx.strokeStyle = "rgba(85, 136, 229, 1)";
-//       this._ctx.fillStyle = "rgba(85, 136, 229, .05)";
-//       this.rects.forEach(rect => {
-//         if (rect) {
-//           this._ctx.beginPath();
-//           this._ctx.rect(rect.begin.x, rect.begin.y, rect.end.x - rect.begin.x, rect.end.y - rect.begin.y);
-//           this._ctx.closePath();
-//           this._ctx.fill();
-//           this._ctx.stroke();
-//         }
-//       });
-//       if (this.drawingRect.begin && this.drawingRect.end) {
-//         this._ctx.beginPath();
-//         this._ctx.rect(
-//           this.drawingRect.begin.x,
-//           this.drawingRect.begin.y,
-//           this.drawingRect.end.x - this.drawingRect.begin.x,
-//           this.drawingRect.end.y - this.drawingRect.begin.y
-//         );
-//         this._ctx.closePath();
-//         this._ctx.fill();
-//         this._ctx.stroke();
-//       }
-//
-//       // 线条
-//       this._ctx.strokeStyle = "rgba(211, 47, 47, .2)";
-//       this._ctx.beginPath();
-//       const length = this.points.length;
-//       this.points.forEach((point, index) => {
-//         if (index % this.overrate) {
-//           this._ctx.lineTo(point.x, point.y);
-//           this._ctx.lineWidth = (length - index + 4) / (2 * this.overrate);
-//           this._ctx.stroke();
-//         }
-//       });
-//       this._ctx.closePath();
-//     },
-//     handleFocus () {
-//       this.$store.commit(USE_FOCUS);
-//     },
-//     cleanCanvas () {
-//       this.rects = [];
-//       this.renderer();
-//     },
-//     undo () {
-//       const rect = this.rects.pop();
-//       rect && this.poped.push(rect);
-//       rect && this.renderer();
-//     },
-//     redo () {
-//       const rect = this.poped.pop();
-//       rect && this.rects.push(rect);
-//       rect && this.renderer();
-//     }
-//   }
-// };
-</script>
-
-<!--<style lang="scss" scoped>-->
-
-<!--.pointer-canvas {-->
-<!--  position: fixed;-->
-<!--  top: 0;-->
-<!--  bottom: 0;-->
-<!--  left: 0;-->
-<!--  right: 0;-->
-<!--  width: 100vw;-->
-<!--  height: 100vh;-->
-<!--  z-index: 0;-->
-<!--}-->
-<!--</style>-->

+ 0 - 5
src/router/index.js

@@ -115,11 +115,6 @@ const routes = [
     path: "/exam/:examId/result/:resultId/commit/:commitId/record/:recordId",
     name: "RecordDetail-Second",
     component: () => import("../views/ExamPage/ResultPage/CommitPage/RecordPage/RecordDetail")
-  },
-  {
-    path: "/courseWare/:courseWareId/:page",
-    name: "courseWare",
-    component: () => import("../views/CourseWarePage/CourseWarePage")
   }
 ];
 

+ 0 - 42
src/style/set-theme.scss

@@ -1,42 +0,0 @@
-@mixin theme() {} // 本行无必要,只是为了让之后的代码不报错
-
-@mixin setTheme() {
-  @include theme(blue, $theme-blue, $theme-blue-transparent);
-  @include theme(green, $theme-green, $theme-green-transparent);
-  @include theme(orange, $theme-orange, $theme-orange-transparent);
-  @include theme(red, $theme-red, $theme-red-transparent);
-  @include theme(normal, $icon-normal-color, $theme-background-grey);
-}
-
-$theme-blue: #5588e5;
-$theme-orange: darken(#ffaa44, 4);
-$theme-red: #f44336;
-$theme-green: #4caf50;
-
-$theme-blue-transparent: rgba(84, 133, 229, .1);
-$theme-orange-transparent: rgba(255, 170, 68, .12);
-$theme-red-transparent: rgba(244, 67, 54, .1);
-$theme-green-transparent: rgba(76, 175, 80, .1);
-
-
-$theme-blue-light: lighten(rgb(84, 133, 229), 33);
-$theme-orange-light: lighten(rgb(255, 170, 68), 30);
-$theme-red-light: lighten(rgb(244, 67, 54), 37);
-$theme-green-light: lighten(rgb(76, 175, 80), 42);
-
-$theme-background-grey: rgba(160, 180, 200, .1);
-$theme-background-grey-darker: rgba(160, 180, 200, .2);
-
-$theme-black: #3a4a5a;
-$theme-grey: #5a6a7a;
-
-$icon-normal-color: #7a8a9a;
-$icon-hover-color: lighten($theme-blue, 10);
-
-$input-background-color: rgba(235, 242, 245, 0.5);
-$input-hover-background-color: rgba(230, 237, 240, 0.5);
-
-$card-background: rgba(237, 244, 247, 0.6);
-
-$white-transparent: rgba(255, 255, 255, .5);
-

+ 0 - 25
src/utils/pdf.js

@@ -1,25 +0,0 @@
-// import pdfjs from "pdfjs-dist";
-//
-// // import pdfMake from "pdfmake/build/pdfmake";
-// // import pdfFonts from "pdfmake/build/vfs_fonts";
-// // import { Document, Page, pdfjs } from "react-pdf";
-// // pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/@2.16.105/pdf.worker.js`;
-//
-// pdfjs.GlobalWorkerOptions.workerSrc = "node_modules/pdfjs-dist/build/pdf.worker.js";
-// // // pdfjs.GlobalWorkerOptions.workerSrc = "https://cdn.jsdelivr.net/npm/pdfjs-dist@3.0.279/build/pdf.worker.min.js";
-// // pdfjs.GlobalWorkerOptions.workerSrc = "https://cdn.jsdelivr.net/npm/pdfjs-dist@2.16.105/build/pdf.worker.js";
-//
-// export default pdfjs;
-
-
-//import pdfjs from "pdfjs";
-
-//pdfjs.GlobalWorkerOptions.workerSrc = "D:\\Desktop\\seecoder\\SEEC-Portal-Front\\node_modules\\pdfjs-dist\\build\\pdf.worker.js";
-
-
-const pdfjs = await import("pdfjs-dist/build/pdf");
-const pdfjsWorker = await import("pdfjs-dist/build/pdf.worker.entry");
-
-pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker;
-
-export default pdfjs;

+ 265 - 223
src/views/CoursePage/tabs/CoursewareTab.vue

@@ -1,29 +1,19 @@
 <template>
   <div class="courseware-tab">
-      <el-row>
-          <el-col :span="3.5">
-              <el-button
-                      @click="uploadDialogVisible = true"
-                      type="primary"
-                      icon="el-icon-circle-plus-outline"
-                      plain>新建</el-button>
-          </el-col>
-          <el-col :span="15">
-              <span style="font-size: smaller; position: absolute; bottom: 25%">(支持拓展名:.pdf .ppt .pptx .doc .docx .xls .jpg .jpeg .png,单次只可上传一个文件)</span>
-          </el-col>
-      </el-row>
-      <el-dialog v-model="uploadDialogVisible" :before-close="handleFormCancel" :width="700">
-      <el-form ref="formRef" :model="form"  label-width="100px">
-<!--          :rules="formRules"-->
-<!--          <el-form-item label="使用时间" required>-->
-<!--              <el-select v-model="form.useTime" placeholder="时间">-->
-<!--                  <el-option key="1" label="课前" value="BEFORE_CLASS"></el-option>-->
-<!--                  <el-option key="2" label="课中" value="IN_CLASS"></el-option>-->
-<!--                  <el-option key="3" label="课后" value="AFTER_CLASS"></el-option>-->
-<!--                  <el-option key="4" label="期末" value="FINISH_CLASS"></el-option>-->
-<!--              </el-select>-->
-<!--          </el-form-item>-->
-
+    <el-row v-if="isCreator">
+      <el-col :span="3.5">
+          <el-button
+                  @click="uploadDialogVisible = true"
+                  type="primary"
+                  icon="el-icon-circle-plus-outline"
+                  plain>新建</el-button>
+      </el-col>
+      <el-col :span="15">
+          <span style="font-size: smaller; position: absolute; bottom: 25%">(支持拓展名:.pdf .ppt .pptx .doc .docx .xls .jpg .jpeg .png,单次只可上传一个文件)</span>
+      </el-col>
+    </el-row>
+    <el-dialog v-model="uploadDialogVisible" :before-close="handleCancelUpload" :width="700">
+        <el-form ref="formRef" :model="form"  label-width="100px">
           <el-form-item label="使用类型" required>
               <el-select v-model="form.useMethod" placeholder="类型">
                   <el-option key="1" label="浏览" value="SCAN"></el-option>
@@ -34,7 +24,7 @@
           <el-form-item label="文件" required>
               <el-upload
                   :file-list="fileList"
-                  :on-change="handleChange"
+                  :on-change="handleUploadFile"
                   action=""
                   class="upload-demo"
                   :auto-upload="false"
@@ -45,24 +35,36 @@
                       type="primary"
                       class="tabs-function-button"
                       icon="el-icon-upload"
-                        >上传文件</el-button>(请选择单个文件)
+                        >上传文件</el-button>(仅支持上传单个文件)
               </el-upload>
               <el-tag
-                      v-if="isUnique"
-                      :key="tag"
+                      v-if="isNameUnique"
+                      :key="fileTag"
                       color="white"
                       closable
-                      @close="handleCloseTag(tag)">
-                  {{file.name}}</el-tag>
+                      @close="handleCloseFileTag(fileTag)">
+                  {{file.name}}
+              </el-tag>
+              <el-icon :size="20" style="color: #337ecc; position: absolute; bottom: 10%; margin-left: 5px"
+                                v-if="isNameUnique" @click="handleChangeNameWhenUpload()">
+                <Edit />
+              </el-icon>
           </el-form-item>
-      </el-form>
-      <div style="margin: auto;width: fit-content">
-          <el-button type="primary" @click="handleFormConfirm">确定</el-button>
-          <el-button @click="handleFormCancel">取消</el-button>
-      </div>
+          <el-form-item v-if="isChangeNameWhenUpload">
+              <el-input v-model="this.newName" placeholder="请输入新课件名称" style="width: 70%">
+                  <template #append>{{nameAppend}}</template>
+              </el-input>
+          </el-form-item>
+        </el-form>
+        <div style="margin: auto;width: fit-content">
+          <el-button type="primary" @click="handleConfirmUpload">确定</el-button>
+          <el-button @click="handleCancelUpload">取消</el-button>
+        </div>
     </el-dialog>
 
-    <el-table :data="fileEntryList">
+
+
+      <el-table :data="fileEntryList">
         <el-table-column
             type="index"
             width="30">
@@ -74,11 +76,10 @@
           <template #default="scope">
             <el-icon v-if="scope.row['courseWareVO'].useMethod === 'SCAN'" style="color: #337ecc" class="myicon"><Reading /></el-icon>
             <el-icon v-if="scope.row['courseWareVO'].useMethod === 'ATTACHMENT'" style="color: green" class="myicon"><Paperclip /></el-icon>
-            {{scope.row["courseWareVO"].name}}
-<!--            <el-tag v-if="scope.row['courseWareVO'].useTime === 'BEFORE_CLASS'" type="success" class="mytag" size="mini"> {{getUseTimeTransition(scope.row["courseWareVO"].useTime)}} </el-tag>-->
-<!--            <el-tag v-else-if="scope.row['courseWareVO'].useTime === 'IN_CLASS'" type="warning" class="mytag" size="mini"> {{getUseTimeTransition(scope.row["courseWareVO"].useTime)}} </el-tag>-->
-<!--            <el-tag v-else-if="scope.row['courseWareVO'].useTime === 'AFTER_CLASS'" class="mytag" size="mini"> {{getUseTimeTransition(scope.row["courseWareVO"].useTime)}} </el-tag>-->
-<!--            <el-tag v-else type="danger" class="mytag" size="mini"> {{getUseTimeTransition(scope.row["courseWareVO"].useTime)}} </el-tag>-->
+              {{scope.row['courseWareVO'].name}}
+              <el-icon :size="20" style="color: #337ecc; position: absolute; bottom: 35%; margin-left: 5px" @click="handleChangeName(scope.row['courseWareVO'].id, scope.row['courseWareVO'].name)">
+                  <Edit />
+              </el-icon>
           </template>
       </el-table-column>
       <el-table-column
@@ -92,9 +93,13 @@
       <el-table-column
         prop="created_time"
         label="上传时间"
-        width="160">
+        width="160"
+        :sortable="true"
+        :sort-method="sortByDate2"
+        >
           <template #default="scope">
-            {{timestampToTime(scope.row["courseWareVO"].createdTime)}}
+<!--            {{timestampToTime(scope.row["courseWareVO"].createdTime)}}-->
+              {{timestampToTime(scope.row["courseWareVO"].createdTime)}}
           </template>
       </el-table-column>
       <el-table-column
@@ -107,34 +112,46 @@
                        size="mini" type="primary" plain style="margin-right: 5px">预览</el-button>
             </a>
             <el-button v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PDF'"
-                 @click="handleCheck(scope.row['courseWareVO'].fileUrl)"
+                 @click="handlePreviewFile(scope.row['courseWareVO'].fileUrl)"
                    size="mini" type="primary" plain style="margin-right: 5px">预览</el-button>
             <el-button v-if="scope.row['courseWareVO'].useMethod === 'SCAN' && isPdfOrPicture(scope.row['courseWareVO'].name) === 'PICTURE'"
-                 @click="handleCheckPicture(scope.row['courseWareVO'])"
+                 @click="handlePreviewPicture(scope.row['courseWareVO'])"
                  size="mini" type="primary" plain style="margin-right: 5px">预览</el-button>
             <a :href="scope.row['courseWareVO'].fileUrl">
               <el-button size="mini" type="success" plain style="margin-right: 5px">下载</el-button>
             </a>
             <el-button v-if="Number(scope.row['courseWareVO'].senderId) === Number(this.$store.state.user.id)"
-                       size="mini" type="danger" @click="handleRemove(scope.row['courseWareVO'].id)" plain>删除</el-button>
+                       size="mini" type="danger" @click="handleRemoveCourseWare(scope.row['courseWareVO'].id)" plain>删除</el-button>
           </template>
       </el-table-column>
     </el-table>
       <el-dialog
-              v-model = "pictureDialogVisible"
-              width = "80%"
-              :before-close = "handleClosePicture"
+              v-model="picturePreviewDialogVisible"
+              width="80%"
+              :before-close="handleClosePreviewPicture"
       >
           <img :src="pictureUrl" alt="" style="width: 100%" class="image" />
 <!--          <el-image style="width: 100px; height: 100px" :src="getPictureUrl" />-->
           <template #footer>
       <span class="dialog-footer">
-        <el-button type="primary" @click="pictureDialogVisible = false" plain>
-          关闭
-        </el-button>
+        <el-button type="primary" @click="handleClosePreviewPicture" plain>关闭</el-button>
       </span>
           </template>
       </el-dialog>
+      <el-dialog
+          v-model="nameChangeDialogVisible"
+          width="30%"
+          :before-close="handleCancelChangeName">
+          <el-input v-model="this.newName" placeholder="请输入新课件名称">
+              <template #append>{{nameAppend}}</template>
+          </el-input>
+          <template #footer>
+            <span class="dialog-footer">
+              <el-button @click="handleCancelChangeName">取消</el-button>
+              <el-button type="primary" @click="handleConfirmChangeName" plain>确定</el-button>
+            </span>
+          </template>
+      </el-dialog>
   </div>
 </template>
 
@@ -154,6 +171,7 @@ export default {
       required: true,
     },
   },
+
   data() {
     return {
       form: {
@@ -164,92 +182,156 @@ export default {
       fileList: [],
       fileEntryList: [],
       uploadDialogVisible: false,
-      pictureDialogVisible: false,
-      isUnique: false,
+      picturePreviewDialogVisible: false,
+      nameChangeDialogVisible: false,
+      isChangeNameWhenUpload: false,
+      isNameUnique: false,
       pictureUrl: null,
       pictureName: null,
-      fileNameTags: [],
-      tag: null,
-      num: 0,
+      idToBeChangeName: null,
+      newName: null,
+      nameAppend: null,
+      fileTag: null,
+      fileNum: 0,
+
+
     };
   },
   computed: {
-    // isCreator(senderId) {
-    //   return Number(senderId) === Number(this.$store.state.user.id);
-    // },
+    isCreator() {
+      return Number(this.teacherId) === Number(this.$store.state.user.id);
+    },
   },
   mounted() {
       this.init();
   },
   methods: {
-    async init() {
-        this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
-    },
+      sortByDate(obj1, obj2) {
+          console.log(obj1, obj2);
+          let val1 = obj1.deadline;
+          let val2 = obj2.deadline;
+          console.log(val1, val2);
+          console.log(val1 - val2);
+          return val1 - val2;
+      },
 
-    isCreator(senderId) {
-      return Number(senderId) === Number(this.$store.state.user.id);
-    },
+      sortByDate2(obj1, obj2) {
+          console.log(obj1.courseWareVO, obj2.courseWareVO);
+          let val1 = obj1.courseWareVO.createdTime;
+          let val2 = obj2.courseWareVO.createdTime;
+          console.log(val1, val2);
+          console.log(val2 > val1 ? 1 : -1);
+          return val2 > val1 ? 1 : -1;
+      },
 
-    timestampToTime: portal.functions.timestampToTime,
 
-    async handleChange(file, fileList) {
-        const fileType = file.name.substring(file.name.indexOf(".") + 1);
-        console.log(this.form.useMethod + " + " + file.name.substring(file.name.indexOf(".") + 1));
-        if (!(fileType === "pdf" || fileType === "ppt" || fileType === "pptx" || fileType === "xls"
-            || fileType === "doc" || fileType === "docx" || fileType === "png" || fileType === "jpeg" || fileType === "jpg")) {
-            this.$message({
-                message: "该文件类型不属于支持的课件类型",
-                type: "error"
-            });
-            return;
-        }
-        // if (this.form.useMethod === "SCAN") {
-        //     if (!(fileType === "pdf" || fileType === "ppt" || fileType === "pptx" || fileType === "xls"
-        //         || fileType === "doc" || fileType === "docx" || fileType === "txt")) {
-        //         this.$message({
-        //             message: "该文件类型不属于支持的可浏览课件类型",
-        //             type: "error"
-        //         });
-        //         return;
-        //     }
-        // }
-        if (this.num === 1) {
-            this.$message({
-                message: "一次只能选择上传一个课件",
-                type: "error"
-            });
-            return;
-        }
-        this.file = file;
-        this.fileList = fileList;
-        console.log(this.file.raw.type);
-        const isNameUnique = (await this.$apis.checkCourseWareNameUnique(this.courseId, this.file.name)).data.data;
-        if (!isNameUnique) {
-            console.log("notunique");
-            this.$message({
-                message: "该课程下已存在同名课件",
-                type: "error"
-            });
-        } else {
-            this.isUnique = true;
-            this.num = 1;
+      async init() {
+          this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
+          console.log(this.fileEntryList);
+      },
+
+      handleChangeNameWhenUpload() {
+          this.isChangeNameWhenUpload = true;
+          this.nameAppend = this.file.name.substring(this.file.name.lastIndexOf("."));
+      },
+
+      handleChangeName(id, oldName) {
+        this.nameChangeDialogVisible = true;
+        this.idToBeChangeName = id;
+        this.nameAppend = oldName.substring(oldName.lastIndexOf("."));
+      },
+
+      handleCancelChangeName() {
+          ElMessageBox.confirm("确定取消修改课件名称?")
+              .then(() => {
+                  this.newName = null;
+                  this.nameAppend = null;
+                  this.nameChangeDialogVisible = false;
+              });
+      },
+
+      handleConfirmChangeName() {
+          ElMessageBox.confirm("确定修改课件名称?")
+              .then(async () => {
+                  const isNameUnique = (await this.$apis.checkCourseWareNameUnique(this.courseId, this.newName + this.nameAppend)).data.data;
+                  if (!isNameUnique) {
+                      this.$message({
+                          message: "该课程下已存在同名课件",
+                          type: "error"
+                      });
+                      return;
+                  }
+
+                  this.$apis.changeCourseWareName(this.idToBeChangeName, this.newName + this.nameAppend)
+                      .then(async () => {
+                          console.log("1");
+                          this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
+                      });
+                  this.newName = null;
+                  this.nameAppend = null;
+                  this.nameChangeDialogVisible = false;
+              });
+      },
+
+      timestampToTime: portal.functions.timestampToTime,
+
+      async handleUploadFile(file, fileList) {
+          const fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
+          console.log(this.form.useMethod + " + " + file.name.substring(file.name.lastIndexOf(".") + 1));
+          if (!(fileType === "pdf" || fileType === "ppt" || fileType === "pptx" || fileType === "xls"
+                || fileType === "doc" || fileType === "docx" || fileType === "png" || fileType === "jpeg" || fileType === "jpg")) {
+              this.$message({
+                  message: "该文件类型不属于支持的课件类型",
+                  type: "error"
+              });
+              return;
+          }
+          if (this.fileNum === 1) {
+              this.$message({
+                  message: "一次只能选择上传一个课件",
+                  type: "error"
+              });
+              return;
+          }
+          this.file = file;
+          this.fileList = fileList;
+          const isNameUnique = (await this.$apis.checkCourseWareNameUnique(this.courseId, this.file.name)).data.data;
+          if (!isNameUnique) {
+              this.$message({
+                  message: "该课程下已存在同名课件",
+                  type: "error"
+              });
+          } else {
+              this.isNameUnique = true;
+              this.fileNum = 1;
+          }
+      },
+
+      async handleConfirmUpload() {
+        if (this.newName !== null) {
+          const isNameUnique = (await this.$apis.checkCourseWareNameUnique(this.courseId, this.newName + this.nameAppend)).data.data;
+          if (!isNameUnique) {
+              this.$message({
+                  message: "该课程下已存在同名课件",
+                  type: "error"
+              });
+              return;
+          }
         }
-    },
 
-    async handleFormConfirm() {
         if (this.file === null) {
             this.$message({
                 message: "尚未上传课件",
                 type: "error"
             });
         } else {
-            const fileUrl = (await this.$apis.uploadCourseWareFile(this.courseId + "/" + this.file.name, this.fileList[0].raw)).data.data;
+            const fileUrl = (await this.$apis.uploadCourseWareFile(this.courseId + "/" + (this.newName == null ? this.file.name : (this.newName + this.nameAppend)), this.fileList[0].raw)).data.data;
             this.$message({
                 message: "上传课件成功",
                 type: "success"
             });
             this.$apis.createCourseWare({
-                name: this.file.name,
+                name: this.newName === null ? this.file.name : (this.newName + this.nameAppend),
                 size: this.file.size,
                 senderId: this.$store.state.user.id,
                 courseId: this.courseId,
@@ -261,84 +343,90 @@ export default {
                 this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
             });
             this.uploadDialogVisible = false;
-            this.isUnique = false;
-            this.num = 0;
+            this.isChangeNameWhenUpload = false;
+            this.isNameUnique = false;
+            this.fileNum = 0;
+            this.newName = null;
+            this.nameAppend = null;
         }
-    },
+      },
 
-    handleFormCancel(done) {
-      ElMessageBox.confirm("是否确认退出?退出后将不保存表格信息。", "提示", {
+      handleCancelUpload(done) {
+        ElMessageBox.confirm("是否确认退出?退出后将不保存表格信息。", "提示", {
           confirmButtonText: "确认退出",
           cancelButtonText: "我再想想",
           type: "warning",
           center: true,
-      })
-          .then(() => {
-              this.uploadDialogVisible = false;
-              this.clearForm();
-              // Zhurui修改,关闭dialog
-              done();
-          })
-          .catch((err) => {
-              console.log(err);
-          });
-    },
+        })
+        .then(() => {
+          this.uploadDialogVisible = false;
+          this.isChangeNameWhenUpload = false;
+          this.isNameUnique = false;
+          this.fileNum = 0;
+          this.newName = null;
+          this.nameAppend = null;
+          this.clearForm();
+          // Zhurui修改,关闭dialog
+          done();
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+      },
 
-    handleCloseTag() {
+      handleCloseFileTag() {
         ElMessageBox.confirm("是否确认取消选择该课件?", "提示", {
             confirmButtonText: "确认取消",
             cancelButtonText: "我再想想",
             type: "warning",
             center: true,
         })
-            .then(() => {
-                this.isUnique = false;
-                this.file = null;
-                this.num = 0;
-                this.clearForm();
-                done();
-            })
-            .catch((err) => {
-                console.log(err);
-            });
-    },
+        .then(() => {
+            this.isNameUnique = false;
+            this.file = null;
+            this.fileNum = 0;
+            this.clearForm();
+            done();
+        })
+        .catch((err) => {
+            console.log(err);
+        });
+      },
 
-    handleRemove(id) {
+      handleRemoveCourseWare(id) {
         ElMessageBox.confirm("是否确认删除该课件?", "提示", {
             confirmButtonText: "确认删除",
             cancelButtonText: "我再想想",
             type: "warning",
             center: true,
         })
-            .then(() => {
-                this.$apis.deleteCourseWare(id).then(async () => {
-                    this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
-                });
-                this.uploadDialogVisible = false;
-                this.num = 0;
-                this.clearForm();
-                // Zhurui修改,关闭dialog
-                done();
-            })
-            .catch((err) => {
-                console.log(err);
+        .then(() => {
+            this.$apis.deleteCourseWare(id).then(async () => {
+                this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
             });
-    },
+            this.uploadDialogVisible = false;
+            this.fileNum = 0;
+            this.clearForm();
+            // Zhurui修改,关闭dialog
+            done();
+        })
+        .catch((err) => {
+            console.log(err);
+        });
+      },
 
-    handleCheck(fileUrl) {
-        console.log("check" + fileUrl);
-        //this.$router.push({ name: "courseWare", params: { courseWareId: id, page: "1"} });
+      handlePreviewFile(fileUrl) {
         window.open(fileUrl);
-    },
+      },
 
-    handleCheckPicture(courseWareVO) {
-        this.pictureDialogVisible = true;
+      handlePreviewPicture(courseWareVO) {
+        this.picturePreviewDialogVisible = true;
         this.pictureUrl = courseWareVO.fileUrl;
         this.pictureName = courseWareVO.name;
-    },
+      },
 
-    isPdfOrPicture(name) {
-        const fileType = name.substring(name.indexOf(".") + 1);
+      isPdfOrPicture(name) {
+        const fileType = name.substring(name.lastIndexOf(".") + 1);
         if (fileType === "pdf") {
             return "PDF";
         } else if (fileType === "png" || fileType === "jpg" || fileType === "jpeg") {
@@ -346,68 +434,22 @@ export default {
         } else {
             return "OTHER";
         }
-    },
-
-    getUseTimeTransition(useTime) {
-      switch (useTime) {
-        case "BEFORE_CLASS":
-          return "课前";
-        case "IN_CLASS":
-          return "课中";
-        case "AFTER_CLASS":
-          return "课后";
-        case "FINISH_CLASS":
-          return "期末";
-      }
-    },
-
-    getSizeTransition(size) {
-    if (size < 1000000) {
-        return (size * 1.0 / 1000).toFixed(2) + " MB";
-    } else {
-        return (size * 1.0 / 1000000).toFixed(2) + " GB";
-    }
-    },
+      },
 
-    handleClosePicture() {
-      ElMessageBox.confirm("Are you sure to close this dialog?")
-          .then(() => {
-              this.pictureDialogVisible = false;
-          });
-    },
+      getSizeTransition(size) {
+        if (size < 1024 * 1024) {
+            return (size * 1.0 / 1024).toFixed(2) + " KB";
+        } else {
+            return (size * 1.0 / 1024 / 1024).toFixed(2) + " MB";
+        }
+      },
 
-    Previewf(file) {
-      console.log(file);
-      // window.open(file.response)
-      if (file) {
-          const addTypeArray = file.name.split(".");
-          const addType = addTypeArray[addTypeArray.length - 1];
-          console.log(addType);
-          if (addType === "pdf") {
-              let routeData = this.$router.resolve({
-                  path: "/insurancePdf",
-                  query: { url: file.response, showBack: false },
-              });
-              window.open(routeData.href, "_blank");
-          }
-          //".rar, .zip, .doc, .docx, .xls, .txt, .pdf, .jpg,  .png, .jpeg,"
-          else if (addType === "doc" || addType === "docx" || addType === "xls") {
-              window.open(
-                  "http://view.officeapps.live.com/op/view.aspx?src=" + file.response
-              );
-          } else if (addType === "txt") {
-              window.open(file.response);
-          } else if (["png", "jpg", "jpeg"].includes(addType)) {
-              window.open(file.response);
-          } else if (addType === "rar" || addType === "zip") {
-              this.$message({
-                  message: "该文件类型暂不支持预览",
-                  type: "warning",
-              });
-              return false;
-          }
-      }
-    }
+      handleClosePreviewPicture() {
+          ElMessageBox.confirm("确定关闭图片预览?")
+            .then(() => {
+                this.picturePreviewDialogVisible = false;
+            });
+      },
 
     // handleDownload(id) {
     //   this.$apis.downloadCourseWare(id, {responseType: "blob"})

+ 0 - 201
src/views/CourseWarePage/CourseWarePage.vue

@@ -1,201 +0,0 @@
-<template>
-<el-row id="manage-page-body">
-    <el-col :span="3">
-        <el-menu background-color="#f8f9fb" default-active="1" style="position: fixed;"
-                 @select="handleSelect">
-            <el-menu-item index="0">
-                <el-icon>
-                    <Back/>
-                </el-icon>
-                <span style="padding-left: 20px">返回首页</span>
-            </el-menu-item>
-            <el-menu-item index="1">
-                <el-icon>
-                    <Document/>
-                </el-icon>
-                <span style="padding-left: 20px">全部课程</span>
-            </el-menu-item>
-        </el-menu>
-    </el-col>
-    <el-col :span="1"/>
-    <el-col :span="18">
-        <div class="pdf-reader">
-            <pdf-viewer></pdf-viewer>
-            <pointer-canvas ref="pointerCanvas" :no-pointer="!pointer" :no-box="!box"></pointer-canvas>
-            <div class="pointer-actions">
-                <c-button text :theme="pointer ? 'red' : ''" @click="pointer = !pointer">
-                    <i class="el-icon-edit"/> 指针</c-button>
-                <c-button text :left="8" :theme="box ? 'blue' : ''" @click="box = !box">
-                    <i class="el-icon-crop"/> 框选</c-button>
-                <c-button text :left="8" theme="orange" @click="cleanCanvas">
-                    <i class="el-icon-refresh-left"/> 清除</c-button>
-            </div>
-        </div>
-    </el-col>
-</el-row>
-
-</template>
-
-<script>
-import PdfViewer from "@/components/PDF/PdfViewer";
-import { mapState } from "vuex";
-import {
-    FOCUS_ON_INPUT,
-    NEXT_PAGE,
-    PREVIOUS_PAGE,
-    RESET, SET_CURRENT_PAGE,
-    SET_SRC,
-    TOGGLE_SHOW_DISCUSSION,
-    USE_FOCUS
-} from "@/store/types/pdf-types";
-import PointerCanvas from "@/components/PDF/PointerCanvas";
-import CButton from "@/components/Basic/CButton";
-
-export default {
-    components: {CButton, PointerCanvas, PdfViewer},
-    computed: {
-        ...mapState({
-            src: state => state.pdf.src,
-            focus: state => state.pdf.focus
-        })
-    },
-    data () {
-        return {
-            pointer: false,
-            box: false,
-            slide: {}
-        };
-    },
-    mounted () {
-        console.log("coursewarepage");
-        this.$store.commit(RESET);
-        let { page } = this.$route.params;
-        if (page) {
-            this.$store.commit(SET_CURRENT_PAGE, { currentPage: parseInt(page) });
-        }
-        const _slideId = this.$route.params.slideId;
-        this.$apis.getSlideInfo({ slideId: _slideId }).then(res => {
-            this.slide = res;
-        }).catch(err => {
-            //this.$setErrorMessage(err.response.data.msg)
-        });
-        this.$apis.getSlideUrl({ slideId: _slideId }).then(res => {
-            console.log(this.$apis.getSlideUrl({ slideId: _slideId }));
-            this.$store.commit(SET_SRC, { src: res });
-        }).catch(err => {
-            //this.$setErrorMessage('获取课件链接的过程中:' + err.response.data.msg)
-        });
-        window.addEventListener("keydown", this.handleKey);
-    },
-    beforeUnmount () {
-        window.removeEventListener("keydown", this.handleKey);
-    },
-    methods: {
-        handleSelect(index) {
-            if (index === "0") {
-                this.$router.push("portal");
-            }
-            if (index === "1") {
-                document.getElementById("app").scrollIntoView({behavior: "smooth"});
-            }
-        },
-        handleKey (e) {
-            if (e.key === "Enter") {
-                !this.showDiscussion && this.$store.commit(TOGGLE_SHOW_DISCUSSION);
-                !this.focus && this.$store.commit(FOCUS_ON_INPUT);
-                return;
-            }
-            if (e.key === "Escape") {
-                if (this.focus) {
-                    this.$store.commit(USE_FOCUS);
-                } else {
-                    this.$store.commit(TOGGLE_SHOW_DISCUSSION);
-                }
-                return;
-            }
-            if (!this.showDiscussion || !this.focus) {
-                switch (e.key) {
-                    case "ArrowDown":
-                    case "ArrowRight":
-                    case "s":
-                    case "d":
-                    case " ":
-                        this.$store.commit(NEXT_PAGE);
-                        break;
-                    case "ArrowUp":
-                    case "ArrowLeft":
-                    case "w":
-                    case "a":
-                        this.$store.commit(PREVIOUS_PAGE);
-                        break;
-                    case "c":
-                        this.cleanCanvas();
-                        break;
-                    case "q":
-                    case "z":
-                        this.$refs.pointerCanvas.undo();
-                        break;
-                    case "e":
-                    case "y":
-                        this.$refs.pointerCanvas.redo();
-                        break;
-                    case "[":
-                    case "b":
-                        this.box = !this.box;
-                        break;
-                    case "p":
-                    case "v":
-                        this.pointer = !this.pointer;
-                        break;
-                }
-            }
-        },
-        cleanCanvas () {
-            this.$refs.pointerCanvas.cleanCanvas();
-        }
-    },
-};
-
-
-</script>
-
-<style lang="scss" scoped>
-    .pdf-reader {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        min-height: 100vh;
-    }
-
-    .icon-button {
-        z-index: 2;
-        position: absolute;
-        left: 16px;
-        top: 16px;
-        background-color: rgba(218, 234, 250, 0.4);
-        backdrop-filter: saturate(150%) blur(20px);
-
-        &:hover {
-            background-color: rgba(218, 234, 250, 0.67);
-        }
-    }
-
-    .show-discussion, .hide-discussion {
-        transition: .2s;
-    }
-
-    .hide-discussion {
-        transform: translateY(100%);
-        opacity: 0;
-    }
-
-    .pointer-actions {
-        position: fixed;
-        left: 6px;
-        bottom: 8px;
-
-        .c-button {
-            background-color: white;
-        }
-    }
-</style>