Explorar o código

fix: 添加了一次只能上传一个课件功能,暂时注释了查看pdf相关的代码,以防止scss报错

chillqi %!s(int64=4) %!d(string=hai) anos
pai
achega
dde77397e3

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

@@ -1,190 +1,190 @@
-<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--" + this.theme : "c-button-standout--normal")
-          : (
-            this.text
-              ? (this.theme ? "c-button-text--" + this.theme : "c-button-text--normal")
-              : (this.theme ? "c-button--" + this.theme : "c-button--normal")
-          ),
-        this.large ? "c-button--large" : "",
-        this.small ? "c-button--small" : "",
-        this.noClickWarn ? "c-button--disabled" : "",
-        this.block ? "c-button--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--block {
-  display: flex;
-  width: 100%;
-}
-
-@mixin theme($name, $color, $backgroundColor) {
-  .c-button--#{$name} {
-    color: $color;
-    background: $backgroundColor;
-
-    &:hover {
-      background: darken($backgroundColor, 5);
-    }
-
-    &:active {
-      background: darken($backgroundColor, 10);
-    }
-
-    .icon {
-      color: $color;
-    }
-  }
-  .c-button-text--#{$name} {
-    color: $color;
-    border-radius: 1000px;
-    background: transparent;
-    transition: .3s;
-
-    &:hover {
-      background: $backgroundColor;
-    }
-
-    &:active {
-      background: darken($backgroundColor, 5);
-    }
-
-    .icon {
-      color: $color;
-    }
-  }
-  .c-button-standout--#{$name} {
-    color: white;
-    background: $color;
-
-    &:hover {
-      background: lighten($color, 5);
-    }
-
-    &:active {
-      background: lighten($color, 10);
-    }
-
-    .icon {
-      color: white;
-    }
-  }
-}
-
-@include setTheme();
-
-.c-button--disabled {
-  opacity: .3;
-  cursor: not-allowed;
-}
-</style>
+<!--<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>-->

+ 68 - 69
src/components/Basic/CIcon.vue

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

+ 67 - 67
src/components/Basic/CInput.vue

@@ -1,74 +1,74 @@
-<template>
-  <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>
+<!--<template>-->
+<!--  <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";
+<!--<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;
+<!--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;
-  }
+<!--  &:hover {-->
+<!--    background: $input-hover-background-color;-->
+<!--  }-->
 
-  &::placeholder {
-    color: #8a9aaa;
-  }
-}
+<!--  &::placeholder {-->
+<!--    color: #8a9aaa;-->
+<!--  }-->
+<!--}-->
 
-textarea {
-  min-height: 96px;
-  height: 100%;
-  padding: 6px 12px;
-  resize: none;
-}
+<!--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::-webkit-outer-spin-button,-->
+<!--input::-webkit-inner-spin-button {-->
+<!--  -webkit-appearance: none;-->
+<!--  margin: 0;-->
+<!--}-->
 
-input[type=number] {
-  -moz-appearance: textfield;
-}
-</style>
+<!--input[type=number] {-->
+<!--  -moz-appearance: textfield;-->
+<!--}-->
+<!--</style>-->

+ 42 - 42
src/components/Basic/CTag.vue

@@ -1,47 +1,47 @@
-<template>
-  <div class="c-tag" :class="classList">
-    <slot></slot>
-  </div>
-</template>
+<!--<template>-->
+<!--  <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>
+<!--<script>-->
+<!--export default {-->
+<!--  props: {-->
+<!--    theme: {-->
+<!--      type: String,-->
+<!--      default: "normal"-->
+<!--    }-->
+<!--  },-->
+<!--  computed: {-->
+<!--    classList () {-->
+<!--      return [this.theme ? "c-tag&#45;&#45;" + this.theme : ""];-->
+<!--    }-->
+<!--  }-->
+<!--};-->
+<!--</script>-->
 
-<style lang="scss" scoped>
-@import "src/style/set-theme.scss";
+<!--<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;
-}
+<!--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--#{$name} {
-    color: $color;
-    background: $backgroundColor;
-  }
-}
+<!--@mixin theme($name, $color, $backgroundColor) {-->
+<!--  .c-tag&#45;&#45;#{$name} {-->
+<!--    color: $color;-->
+<!--    background: $backgroundColor;-->
+<!--  }-->
+<!--}-->
 
-@include setTheme()
-</style>
+<!--@include setTheme()-->
+<!--</style>-->

+ 94 - 94
src/components/Basic/IconButton.vue

@@ -1,108 +1,108 @@
-<template>
-  <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>
+<!--<template>-->
+<!--  <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";
+<!--<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: "按钮"
-    },
+<!--export default {-->
+<!--  components: { Ripple, CIcon },-->
+<!--  // props: ['title', 'ripple', 'small']-->
+<!--  props: {-->
+<!--    title: {-->
+<!--      type: String,-->
+<!--      default: "按钮"-->
+<!--    },-->
 
-    // 可以直接传入 6 位颜色值,将覆盖 theme 设置的颜色
-    color: {
-      type: String,
-      default: ""
-    },
+<!--    // 可以直接传入 6 位颜色值,将覆盖 theme 设置的颜色-->
+<!--    color: {-->
+<!--      type: String,-->
+<!--      default: ""-->
+<!--    },-->
 
-    // 这个值需要在下方 scss 中有相应的定义,否则无效
-    theme: {
-      type: String,
-      default: "normal"
-    },
+<!--    // 这个值需要在下方 scss 中有相应的定义,否则无效-->
+<!--    theme: {-->
+<!--      type: String,-->
+<!--      default: "normal"-->
+<!--    },-->
 
-    noBold: {
-      type: Boolean,
-      default: false
-    },
+<!--    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>
+<!--    // icon button 大小-->
+<!--    size: Number,-->
+<!--    left: Number,-->
+<!--    right: Number-->
+<!--  },-->
+<!--  computed: {-->
+<!--    classList () {-->
+<!--      return [this.theme ? "icon-button&#45;&#45;" + 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";
+<!--<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;
+<!--.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;
-  }
+<!--  &:hover {-->
+<!--    background: $theme-background-grey;-->
+<!--  }-->
 
-  &:active {
-    color: darken($icon-hover-color, 10);
-  }
-}
+<!--  &:active {-->
+<!--    color: darken($icon-hover-color, 10);-->
+<!--  }-->
+<!--}-->
 
-@mixin theme($name, $color, $backgroundColor) {
-  .icon-button--#{$name} {
-    color: $color;
+<!--@mixin theme($name, $color, $backgroundColor) {-->
+<!--  .icon-button&#45;&#45;#{$name} {-->
+<!--    color: $color;-->
 
-    &:hover {
-      background: $backgroundColor;
-    }
+<!--    &:hover {-->
+<!--      background: $backgroundColor;-->
+<!--    }-->
 
-    &:active {
-      color: darken($color, 10);
-    }
-  }
-}
+<!--    &:active {-->
+<!--      color: darken($color, 10);-->
+<!--    }-->
+<!--  }-->
+<!--}-->
 
-@include setTheme()
-</style>
+<!--@include setTheme()-->
+<!--</style>-->

+ 94 - 94
src/components/Basic/Ripple.vue

@@ -1,104 +1,104 @@
-<template>
-  <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>
+<!--<template>-->
+<!--  <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>
+<!--<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";
+<!--<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;
-}
+<!--$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;
-}
+<!--.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;
-}
+<!--.show {-->
+<!--  opacity: $opacity;-->
+<!--  animation: ripple .5s forwards ease-out;-->
+<!--}-->
 
-.red {
-  .ripple {
-    background: $theme-red-transparent;
-  }
-}
+<!--.red {-->
+<!--  .ripple {-->
+<!--    background: $theme-red-transparent;-->
+<!--  }-->
+<!--}-->
 
-.orange {
-  .ripple {
-    background: $theme-orange-transparent;
-  }
-}
+<!--.orange {-->
+<!--  .ripple {-->
+<!--    background: $theme-orange-transparent;-->
+<!--  }-->
+<!--}-->
 
-.green {
-  .ripple {
-    background: $theme-green-transparent;
-  }
-}
+<!--.green {-->
+<!--  .ripple {-->
+<!--    background: $theme-green-transparent;-->
+<!--  }-->
+<!--}-->
 
-.blue {
-  .ripple {
-    background: $theme-blue-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>
+<!--@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>-->

+ 125 - 125
src/components/PDF/Pdf.vue

@@ -1,137 +1,137 @@
-<template>
-  <div class="pdf">
-    <canvas class="pdf pdf-canvas" id="pdf-canvas" :class="classList"></canvas>
-    <div v-if="loading" class="loading">加载中...</div>
-    <fade-transition>
-      <div v-if="focus" class="focus-mask">禁用快捷键中...<br>点击空白出退出</div>
-    </fade-transition>
-  </div>
-</template>
+<!--<template>-->
+<!--  <div class="pdf">-->
+<!--    <canvas class="pdf pdf-canvas" id="pdf-canvas" :class="classList"></canvas>-->
+<!--    <div v-if="loading" class="loading">加载中...</div>-->
+<!--    <fade-transition>-->
+<!--      <div v-if="focus" class="focus-mask">禁用快捷键中...<br>点击空白出退出</div>-->
+<!--    </fade-transition>-->
+<!--  </div>-->
+<!--</template>-->
 
-<script>
-import pdfjs from "@/utils/pdf";
-import { mapState } from "vuex";
-import { SET_TOTAL_PAGES } from "@/store/types/pdf-types";
-import FadeTransition from "@/animations/FadeTransition";
+<!--<script>-->
+<!--import pdfjs from "@/utils/pdf";-->
+<!--import { mapState } from "vuex";-->
+<!--import { SET_TOTAL_PAGES } from "@/store/types/pdf-types";-->
+<!--import FadeTransition from "@/animations/FadeTransition";-->
 
-export default {
-  components: { FadeTransition },
-  data () {
-    return {
-      loading: true
-    };
-  },
-  mounted () {
-    console.log("hhh");
-    this.loading = true;
-    this._canvas = document.getElementById("pdf-canvas");
-    this._context = this._canvas.getContext("2d");
+<!--export default {-->
+<!--  components: { FadeTransition },-->
+<!--  data () {-->
+<!--    return {-->
+<!--      loading: true-->
+<!--    };-->
+<!--  },-->
+<!--  mounted () {-->
+<!--    console.log("hhh");-->
+<!--    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;
+<!--    // Default size-->
+<!--    this._canvas.height = 1080;-->
+<!--    this._canvas.width = 1440;-->
 
-    console.log(this.src);
-    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) {
-      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 });
+<!--    console.log(this.src);-->
+<!--    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) {-->
+<!--      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;
+<!--        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>
+<!--        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/theme.scss';
+<!--<style lang="scss" scoped>-->
+<!--@import 'src/style/theme.scss';-->
 
-.pdf {
-  z-index: -1;
-  position: relative;
-}
+<!--.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;
-}
+<!--.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);
-}
+<!--.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;
-}
+<!--.pdf-canvas {-->
+<!--  z-index: 0;-->
+<!--  outline: none;-->
+<!--  display: block;-->
+<!--  direction: ltr;-->
+<!--  margin: 0 auto;-->
+<!--  background-color: white;-->
+<!--  max-width: 100vw;-->
+<!--  max-height: 100vh;-->
+<!--}-->
 
-</style>
+<!--</style>-->

+ 164 - 164
src/components/PDF/PdfController.vue

@@ -1,164 +1,164 @@
-<template>
-  <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/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>
+<!--<template>-->
+<!--  <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/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>-->

+ 27 - 27
src/components/PDF/PdfViewer.vue

@@ -1,29 +1,29 @@
-<template>
-  <div>
-    <pdf></pdf>
-    <pdf-controller></pdf-controller>
-  </div>
-</template>
+<!--<template>-->
+<!--  <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", "discussion"],
-  data () {
-    return {
-      currentPage: 1,
-      fullSize: !this.discussion
-    };
-  },
-  watch: {
-    discussion (newValue) {
-      this.fullSize = !newValue;
-    }
-  }
-};
-</script>
+<!--<script>-->
+<!--import Pdf from "@/components/PDF/Pdf";-->
+<!--import PdfController from "@/components/PDF/PdfController";-->
+<!--export default {-->
+<!--  components: { PdfController, Pdf },-->
+<!--  props: ["src", "discussion"],-->
+<!--  data () {-->
+<!--    return {-->
+<!--      currentPage: 1,-->
+<!--      fullSize: !this.discussion-->
+<!--    };-->
+<!--  },-->
+<!--  watch: {-->
+<!--    discussion (newValue) {-->
+<!--      this.fullSize = !newValue;-->
+<!--    }-->
+<!--  }-->
+<!--};-->
+<!--</script>-->
 
-<style lang="scss" scoped>
-</style>
+<!--<style lang="scss" scoped>-->
+<!--</style>-->

+ 184 - 184
src/components/PDF/PointerCanvas.vue

@@ -1,192 +1,192 @@
-<template>
-  <canvas :width="width" :height="height" class="pointer-canvas" ref="pointerCanvas" @click="handleFocus">
-  </canvas>
-</template>
+<!--<template>-->
+<!--  <canvas :width="width" :height="height" class="pointer-canvas" ref="pointerCanvas" @click="handleFocus">-->
+<!--  </canvas>-->
+<!--</template>-->
 
-<script>
-import { mapState } from "vuex";
-import { USE_FOCUS } from "@/store/types/pdf-types";
+<!--<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");
+<!--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 };
+<!--    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._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.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>
+<!--      // 线条-->
+<!--      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>
+<!--<style lang="scss" scoped>-->
 
-.pointer-canvas {
-  position: fixed;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  width: 100vw;
-  height: 100vh;
-  z-index: 0;
-}
-</style>
+<!--.pointer-canvas {-->
+<!--  position: fixed;-->
+<!--  top: 0;-->
+<!--  bottom: 0;-->
+<!--  left: 0;-->
+<!--  right: 0;-->
+<!--  width: 100vw;-->
+<!--  height: 100vh;-->
+<!--  z-index: 0;-->
+<!--}-->
+<!--</style>-->

+ 33 - 1
src/style/set-theme.scss

@@ -1,4 +1,3 @@
-@import "./theme.scss";
 @mixin theme() {} // 本行无必要,只是为了让之后的代码不报错
 
 @mixin setTheme() {
@@ -8,3 +7,36 @@
   @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 - 31
src/style/theme.scss

@@ -1,31 +0,0 @@
-$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);

+ 1 - 1
src/views/CoursePage/CourseDetail.vue

@@ -64,7 +64,7 @@
                       :teacher-id="courseInfo.teacher.id"
                       :course-id="courseInfo.id"/>
           </el-tab-pane>
-          <el-tab-pane label="课件(暂未启用)" name="courseware">
+          <el-tab-pane label="课件" name="courseware">
             <courseware-tab ref="coursewareTab"
                             v-if="coursewareTabVisible"
                             :teacher-id="courseInfo.teacher.id"

+ 46 - 22
src/views/CoursePage/tabs/CoursewareTab.vue

@@ -28,7 +28,7 @@
                   class="upload-demo"
                   :auto-upload="false"
                   :show-file-list="false">
-                  <el-button plain type="primary" class="tabs-function-button">上传文件<i class="el-icon-upload"></i></el-button>
+                  <el-button plain type="primary" class="tabs-function-button">上传文件<i class="el-icon-upload"></i></el-button>(请选择单个文件)
               </el-upload>
               <el-tag
                       v-if="isUnique"
@@ -55,10 +55,13 @@
         label="文件名"
         width="220">
           <template #default="scope">
-            <c-icon style="color: blue" class="el-icon-video-camera" v-if="scope.row['courseWareVO'].useMethod === 'SCAN'"></c-icon>
-            <c-icon style="color: green" class="el-icon-paperclip" v-if="scope.row['courseWareVO'].useMethod === 'ATTACHMENT'"></c-icon>
+            <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}}
-            <c-tag :theme="getUseTimeColor(scope.row['courseWareVO'].useTime)"> {{getUseTimeTransition(scope.row["courseWareVO"].useTime)}} </c-tag>
+            <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>
           </template>
       </el-table-column>
       <el-table-column
@@ -97,18 +100,11 @@
 
 <script>
 import portal from "@/utils/portal";
-import {ElMessageBox} from "element-plus";
-import CTag from "@/components/Basic/CTag";
-import CIcon from "@/components/Basic/CIcon";
-
-
+import {ElMessage, ElMessageBox} from "element-plus";
 
 export default {
   name: "CoursewareTab",
   components: {
-    // FileEntry
-    CTag,
-    CIcon
   },
   props: {
     courseId: {
@@ -131,6 +127,7 @@ export default {
       isUnique: false,
       fileNameTags: [],
       tag: null,
+      num: 0,
     };
   },
   computed: {
@@ -153,6 +150,13 @@ export default {
     timestampToTime: portal.functions.timestampToTime,
 
     async handleChange(file, fileList) {
+        if (this.num === 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;
@@ -169,6 +173,7 @@ export default {
             });
         } else {
             this.isUnique = true;
+            this.num = 1;
         }
     },
 
@@ -193,7 +198,7 @@ export default {
                 useTime: this.form.useTime,
                 useMethod: this.form.useMethod,
                 fileUrl: fileUrl,
-            }).then(async (res) => {
+            }).then(async () => {
                 this.fileEntryList = (await this.$apis.getCourseWaresByCourseId(this.courseId)).data.data;
             });
             this.uploadDialogVisible = false;
@@ -219,7 +224,7 @@ export default {
           });
     },
 
-    handleCloseTag(tag) {
+    handleCloseTag() {
         ElMessageBox.confirm("是否确认取消选择该课件?", "提示", {
             confirmButtonText: "确认取消",
             cancelButtonText: "我再想想",
@@ -229,6 +234,7 @@ export default {
             .then(() => {
                 this.isUnique = false;
                 this.file = null;
+                this.num = 0;
                 this.clearForm();
                 done();
             })
@@ -245,10 +251,11 @@ export default {
             center: true,
         })
             .then(() => {
-                this.$apis.deleteCourseWare(id).then(async (res) => {
+                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();
@@ -259,10 +266,16 @@ export default {
     },
 
     handleCheck(id) {
-    console.log("check" + id);
-    this.$router.push({ name: "courseWare", params: { courseWareId: id, page: "1"} });
+        console.log("check" + id);
+        this.$router.push({ name: "courseWare", params: { courseWareId: id, page: "1"} });
     },
 
+    // handleExceed(files) {
+    //     console.log(files);
+    //     ElMessage.error("一次只能上传一个文件");
+    //     this.fileList = null;
+    // },
+
     getUseTimeTransition(useTime) {
       switch (useTime) {
         case "BEFORE_CLASS":
@@ -327,15 +340,26 @@ export default {
 <style scoped>
 @import "tabs.css";
 
-.c-icon {
+.myicon {
     position: relative;
-    top: 3px;
-    font-size: 16px;
+    top: 2px;
+    font-size: 14px;
+    margin-right: 2px;
     transform: scale(1.2);
 }
 
-.c-tag {
-    margin-left: -4px;
+.mytag {
+    transition: .2s;
+    display: inline-block;
+    padding: 3px;
+    border-radius: 4px;
+    margin-left: 2px;
+    font-size: 12px;
+    font-weight: bold;
+    line-height: 1;
+    vertical-align: middle;
+    position: relative;
+    bottom: 2px;
 }
 
 </style>