lsc 11 months ago
parent
commit
26fcdace9e

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 1 - 1
dist/report.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-1c2d9d84.9f607ecf.css


+ 0 - 0
dist/static/css/chunk-168d0294.01fa89b1.css → dist/static/css/chunk-2a8fbba6.01fa89b1.css


+ 1 - 0
dist/static/css/chunk-5542237d.b9d00ab7.css

@@ -0,0 +1 @@
+.navTitle[data-v-4e39bdca]{font-size:.42667rem;color:#fff}.home-container[data-v-4e39bdca]{height:100vh;overflow:hidden}.home-container .step_box[data-v-4e39bdca]{margin-top:1.5rem;width:100%;height:calc(100vh - 2.83333rem);overflow:auto;position:relative}.home-container .edit_top[data-v-4e39bdca]{width:100%;margin:0 auto}.home-container .edit_top[data-v-4e39bdca] .el-button{width:100%;height:1.33333rem;text-align:center;font-size:.42667rem}

+ 0 - 1
dist/static/css/chunk-645a185b.0ecdbe93.css

@@ -1 +0,0 @@
-.navTitle[data-v-72b8a854]{font-size:.42667rem;color:#fff}.home-container[data-v-72b8a854]{height:100vh;overflow:hidden}.home-container .step_box[data-v-72b8a854]{margin-top:1.5rem;width:100%;height:calc(100vh - 2.83333rem);overflow:auto;position:relative}.home-container .edit_top[data-v-72b8a854]{width:100%;margin:0 auto}.home-container .edit_top[data-v-72b8a854] .el-button{width:100%;height:1.33333rem;text-align:center;font-size:.42667rem}

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-74d2c414.eda42f98.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.7d8afc0d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-168d0294.3600a941.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-1c2d9d84.0e3b9a6d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-2a8fbba6.3e2f7005.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5542237d.6242875c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-645a185b.9703bd36.js


+ 20 - 0
src/api/home.js

@@ -19,3 +19,23 @@ export function selectTypeCourse2(params) {
     hideloading: false
   })
 }
+
+// 查询课程2
+export function selectCourseNew2(params) {
+  return request({
+    url: '/selectCourseNew2',
+    method: 'get',
+    params,
+    hideloading: false
+  })
+}
+
+// 查询课程
+export function getCourseInfoTestAll(params) {
+  return request({
+    url: '/getCourseInfoTestAll',
+    method: 'get',
+    params,
+    hideloading: false
+  })
+}

+ 146 - 0
src/views/home/components/courseItem2.vue

@@ -0,0 +1,146 @@
+<template>
+  <div @click="updateCourseArray(c)">
+    <div class="cDetail">
+      <div class="courseImg">
+        <img :src="c.cover ? JSON.parse(c.cover)[0].url : require('../../../assets/images/home/wheel.png')" alt="" />
+      </div>
+      <div class="cRight">
+        <div>{{ c.title }}</div>
+        <div>创建者:{{ c.uname }}</div>
+        <div class="jdBox">
+          <div class="jdImg"><img src="../../../assets/images/home/jd.png" alt="" /></div>
+          <div>{{ JSON.parse(c.chapters).length }}阶段</div>
+        </div>
+        <div class="typeCss">{{ c.typename ? c.typename : '暂无分类' }}</div>
+      </div>
+    </div>
+    <div class="cButtonBox" v-show="false">
+      <div class="cButton">
+        <div class="bImg"><img src="../../../assets/images/home/courseEvaIcon.png" alt="" /></div>
+        <div>评课</div>
+      </div>
+      <div class="cButton">
+        <div class="bImg"><img src="../../../assets/images/home/evaIcon.png" alt="" /></div>
+        <div>评价</div>
+      </div>
+      <div class="cButton">
+        <div class="bImg"><img src="../../../assets/images/home/analysisIcon.png" alt="" /></div>
+        <div>分析</div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    c: {
+      type: Object
+    }
+  },
+  methods: {
+    updateCourseArray(c) {
+      this.$emit('updateCourseArray', c)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.cDetail {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+  .courseImg {
+    width: 120px;
+    height: 100px;
+    min-width: 120px;
+    min-height: 100px;
+    > img {
+      width: 100%;
+      height: 100%;
+      border-radius: 5px;
+      object-fit: cover;
+    }
+  }
+  .cRight {
+    padding: 0 10px;
+    display: flex;
+    flex-direction: column;
+    flex-wrap: nowrap;
+    align-items: flex-start;
+    justify-content: center;
+    > div {
+      margin: 4px 0;
+      font-size: 14px;
+    }
+    > div:nth-child(1) {
+      font-size: 16.5px;
+      font-weight: bold;
+      max-width: 220px;
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      word-break: break-word;
+      margin: 0 0 4px 0;
+    }
+    > div:last-child {
+      margin: 0;
+    }
+    .jdBox {
+      display: flex;
+      flex-direction: row;
+      flex-wrap: nowrap;
+      align-items: center;
+      justify-content: flex-start;
+      .jdImg {
+        width: 20px;
+        height: 20px;
+        > img {
+          width: 100%;
+          height: 100%;
+        }
+      }
+    }
+    .typeCss {
+      display: -webkit-box;
+      overflow: hidden;
+      white-space: normal !important;
+      text-overflow: ellipsis;
+      word-wrap: break-word;
+      -webkit-line-clamp: 1;
+      -webkit-box-orient: vertical;
+    }
+  }
+}
+.cButtonBox {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  padding: 10px 0 0 0;
+  .cButton {
+    width: 100px;
+    height: 30px;
+    margin: 0 10px 0 0;
+    display: flex;
+    flex-direction: row;
+    flex-wrap: nowrap;
+    align-items: center;
+    border: 1px solid #587ff3;
+    color: #587ff3;
+    border-radius: 5px;
+    justify-content: center;
+    .bImg {
+      width: 20px;
+      height: 20px;
+      > img {
+        width: 100%;
+        height: 100%;
+      }
+    }
+  }
+}
+</style>

+ 117 - 0
src/views/testDetail/components/components/courseDilog.vue

@@ -0,0 +1,117 @@
+<template>
+  <el-dialog
+    title="课程选择"
+    :visible.sync="dialogVisibleCourse"
+    :append-to-body="true"
+    width="95%"
+    :before-close="handleClose"
+    class="dialog_diy"
+  >
+    <div style="height: 100%;overflow: auto;">
+      <courseIndexVue :courseArray="courseArray" @updateCourseArray="updateCourseArray"></courseIndexVue>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="close()">关 闭</el-button>
+      <el-button @click="submit()" type="primary">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import courseIndexVue from './courseIndex.vue'
+export default {
+  components: {
+    courseIndexVue
+  },
+  props: {
+    dialogVisibleCourse: {
+      type: Boolean,
+      default: false
+    },
+    courses: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      courseArray: []
+    }
+  },
+  watch: {
+    courses: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.courseArray = JSON.parse(JSON.stringify(this.courses))
+        this.$forceUpdate()
+      }
+    }
+  },
+  mounted() {
+    this.courseArray = JSON.parse(JSON.stringify(this.courses))
+    this.$forceUpdate()
+  },
+  methods: {
+    handleClose(done) {
+      this.close()
+      done()
+    },
+    updateCourseArray(newValue) {
+      const index = this.courseArray.findIndex(i => i === newValue)
+      if (index != -1) {
+        this.courseArray.splice(index, 1)
+      } else {
+        // 给courseArray添加课程id
+        this.courseArray.push(newValue)
+      }
+    },
+    close() {
+      this.$emit('update:dialogVisibleCourse', false)
+    },
+    submit() {
+      this.$emit('setCourse', this.courseArray)
+      this.close()
+    }
+  }
+}
+</script>
+
+<style scoped>
+.dialog_diy >>> .el-dialog {
+  height: 100%;
+  margin: 0 auto !important;
+}
+
+.dialog_diy >>> .el-dialog__header {
+  background: #454545 !important;
+  padding: 15px 20px;
+}
+
+.dialog_diy >>> .el-dialog__body {
+  height: calc(100% - 124px);
+  box-sizing: border-box;
+  padding: 0px;
+}
+
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn {
+  top: 19px;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__body,
+.dialog_diy >>> .el-dialog__footer {
+  background: #fff;
+}
+</style>

+ 244 - 0
src/views/testDetail/components/components/courseIndex.vue

@@ -0,0 +1,244 @@
+<template>
+  <div class="home-container">
+    <head-bar :isBack="false" style="position: unset;">
+      <template #title>
+        <div style="width: 90%">
+          <div class="rightSearch">
+            <div class="searchImg" @click="search(undefined)">
+              <img src="../../../../assets/images/home/search.png" alt="" />
+            </div>
+            <el-input
+              v-model="courseName"
+              auto-complete="off"
+              placeholder="搜索课程..."
+              @input="search(undefined)"
+            ></el-input>
+          </div>
+        </div>
+        <!-- <div class="exit" @click="exitLogin">退出</div> -->
+      </template>
+    </head-bar>
+    <div class="home-box">
+      <class-filter @getAll="search" :zoneClass.sync="zoneClass"> </class-filter>
+      <van-pull-refresh v-model="isLoading" @refresh="onRefresh" class="rheight">
+        <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" class="vheight">
+          <!-- <course-all :courseList="zoneClass"></course-all> -->
+          <van-empty description="暂无课程" v-if="!zoneClass.length" />
+          <course-item
+            :class="[courseArray.includes(c.courseId) ? 'out_boxActive' : '']"
+            @updateCourseArray="clickCourse"
+            v-for="(c, cIndex) in zoneClass"
+            :key="cIndex"
+            class="courseItem"
+            :c="c"
+          ></course-item>
+        </van-list>
+      </van-pull-refresh>
+    </div>
+  </div>
+</template>
+
+<script>
+import { selectCourseNew2 } from '@/api/home'
+import { loginOut } from '@/api/user'
+import { mapGetters } from 'vuex'
+import headBar from '@/components/headBar.vue'
+import classFilter from '../../../home/components/classFilter.vue'
+import courseItem from '../../../home/components/courseItem2.vue'
+// import courseAll from './components/courseAll.vue'
+export default {
+  components: {
+    headBar,
+    classFilter,
+    courseItem
+  },
+  props: {
+    courseArray: {
+      type: Array,
+      default: () => []
+    }
+  },
+  emit: ['updateCourseArray'],
+  data() {
+    return {
+      courseName: '',
+      zoneClass: [],
+      typea: '',
+      typeb: '',
+      typec: '',
+      page: 1,
+      isLoading: false,
+      loading: false,
+      finished: true
+    }
+  },
+  computed: {
+    ...mapGetters(['userinfo'])
+  },
+  methods: {
+    search(tList) {
+      this.page = 1
+      if (tList !== undefined) {
+        var typeList = Object.values(tList)
+        this.typea = typeList[0]
+        this.typeb = typeList[2]
+        this.typec = typeList[1]
+      }
+      this.selectAll(true)
+    },
+    onRefresh() {
+      this.page = 1
+      this.finished = false
+      this.selectAll(true)
+    },
+    onLoad() {
+      this.page++
+      this.selectAll()
+    },
+    async selectAll(isRefresh) {
+      const params = {
+        type: '0',
+        uid: this.userinfo.userid,
+        oid: this.userinfo.organizeid,
+        org: this.userinfo.org,
+        typea: this.typea !== undefined ? this.typea : '',
+        typeb: this.typeb !== undefined ? this.typeb : '',
+        typec: '',
+        typed: this.typed !== undefined ? this.typed : '',
+        typeE: '', // this.typeE.join(',')
+        cu: '',
+        cn: this.courseName,
+        page: this.page,
+        pageSize: 10
+      }
+      const res = await selectCourseNew2(params)
+      if (isRefresh) {
+        this.isLoading = false
+        // 下拉刷新
+        this.zoneClass = res[0]
+      } else {
+        this.loading = false
+        // 上拉加载
+        this.zoneClass = [...this.zoneClass, ...res[0]]
+      }
+      this.$emit('update:list', this.zoneClass)
+      if (res[0].length === 0) {
+        // 证明没有下一页数据了
+        this.finished = true
+      } else {
+        this.finished = false
+      }
+    },
+    exitLogin() {
+      this.$dialog({
+        message: '是否退出' + this.userinfo.username + '账号',
+        showCancelButton: true,
+        beforeClose: (action, done) => {
+          if (action === 'confirm') {
+            loginOut()
+              .then(res => {
+                this.$toast({
+                  message: '退出成功',
+                  type: 'success'
+                })
+                this.$store.dispatch('user/logout')
+                window.location.reload()
+                done()
+              })
+              .catch(err => {
+                console.error(err)
+                done()
+              })
+          } else {
+            // 拦截取消操作
+            done()
+          }
+        }
+      })
+    },
+    clickCourse(c) {
+      console.log(c)
+      this.$emit('updateCourseArray', c.courseId)
+    }
+  },
+  mounted() {
+    this.selectAll()
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.home-container {
+  height: 100%;
+  overflow: hidden;
+  .home-box {
+    height: calc(100% - 55px);
+    // margin-top: 55px;
+    overflow: hidden;
+  }
+  .rheight {
+    height: calc(100% - 40px);
+    overflow: auto;
+    background: #e8ebf2;
+
+    /deep/.van-pull-refresh__track {
+      height: 100%;
+    }
+  }
+  .vheight {
+    padding: 10px 0;
+    // height: 100%;
+    // overflow: auto;
+  }
+
+  // .courseBox {
+  // background: #e8ebf2;
+  // padding: 15px 0;
+  .courseItem {
+    background: #fff;
+    width: 90%;
+    margin: 0 auto 15px;
+    border-radius: 10px;
+    box-shadow: 0 0 10px 1px #dcdfe6;
+    padding: 10px;
+  }
+  .exit {
+    color: #fff;
+    margin-left: 10px;
+    font-size: 15px;
+    min-width: 40px;
+  }
+  // }
+}
+
+/deep/.rightSearch {
+  display: flex;
+  flex-direction: row;
+  width: 100%;
+  height: 30px;
+  position: relative;
+
+  .searchImg {
+    width: 20px;
+    height: 20px;
+    position: absolute;
+    z-index: 9;
+    top: 5px;
+    left: 5px;
+    > img {
+      width: 100%;
+      height: 100%;
+    }
+  }
+  .el-input__inner {
+    width: 100%;
+    height: 30px;
+    text-indent: 15px;
+    line-height: 30px;
+  }
+}
+
+.out_boxActive {
+  border: 3px solid #3681fc !important;
+}
+</style>

+ 240 - 0
src/views/testDetail/components/course2.vue

@@ -0,0 +1,240 @@
+<template>
+  <div class="c_box">
+    <div class="choice_box" v-loading="isloading">
+      <div class="title" style="display: flex;">
+        <span style="min-width: fit-content;">{{ tindex + 1 + '、' }}</span>
+        <span>{{ checkJson.title }}</span>
+      </div>
+      <div
+        class="detail"
+        v-if="checkJson.detail"
+        v-html="checkJson.detail"
+        style="color: #00000099;margin-top: 5px;"
+      ></div>
+      <div class="choices">
+        <el-button type="primary" size="small" @click="openCourseD">选择课程</el-button>
+      </div>
+      <div class="choices" v-if="checkJson.answer2.length">
+        <div class="course" @click="openCourse(course.courseId)" v-for="(course, index) in courseDetail" :key="index">
+          <div class="banner">
+            <img :src="course.cover" alt="" />
+          </div>
+          <div class="content">
+            <div class="c_c">
+              <span>课程名字:</span>
+              <span>{{ course.title }}</span>
+            </div>
+            <div class="c_c">
+              <span>课程类型:</span>
+              <span>{{ course.name ? course.name : '暂无' }}</span>
+            </div>
+            <div class="c_c">
+              <span>创建人:</span>
+              <span>{{ course.username }}</span>
+            </div>
+            <div class="c_c">
+              <span>协作者:</span>
+              <span>{{ course.xieName ? course.xieName : '暂无' }}</span>
+            </div>
+          </div>
+        </div>
+        <!-- <div class="page" v-if="checktype == '1'">
+                    <el-button type="primary" size="mini" :disabled="page == 0" @click="setPage('-1')">上一个</el-button>
+                    <div class="p_page"><span>{{ page + 1 }}</span><span>/</span><span>{{ checkJson.courses.length }}</span>
+                    </div>
+                    <el-button type="primary" size="mini" :disabled="page == (checkJson.courses.length - 1)"
+                        @click="setPage('1')">下一个</el-button>
+                </div> -->
+      </div>
+    </div>
+    <courseDilogVue :dialogVisibleCourse.sync="dialogVisibleCourse" :courses="checkJson.answer2" @setCourse="setCourse">
+    </courseDilogVue>
+  </div>
+</template>
+
+<script>
+import courseDilogVue from './components/courseDilog.vue'
+import { getCourseInfoTestAll } from '@/api/home'
+export default {
+  components: {
+    courseDilogVue
+  },
+  props: {
+    tindex: {
+      type: Number
+    },
+    cJson: {
+      type: Object
+    },
+    checktype: {
+      type: Number,
+      default: 1
+    },
+    see: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      option: {
+        1: { name: '附件' }
+      },
+      userid: this.$route.query.userid,
+      checkJson: undefined,
+      progress: 0,
+      isFinishSize: 0,
+      proVisible: false,
+      isAllSize: 0,
+      wurl: '',
+      isTong: false,
+      page: 0,
+      isloading: false,
+      courseDetail: [],
+      dialogVisibleCourse: false
+    }
+  },
+  computed: {},
+  watch: {
+    checkJson: {
+      handler(newValue) {
+        this.$emit('update:cJson', newValue)
+      },
+      deep: true
+    }
+  },
+  methods: {
+    setCourse(courses) {
+      this.checkJson.answer2 = courses
+      this.getCourse(this.checkJson.answer2)
+      this.$forceUpdate()
+    },
+    depthCopy(s) {
+      return JSON.parse(JSON.stringify(s))
+    },
+    openFileBox() {
+      this.dialogVisiblefile = true
+    },
+    setPage(index) {
+      if (index == '1') {
+        this.page++
+      } else if (index == '-1') {
+        this.page--
+      }
+      this.checkJson.answer2 = this.checkJson.courses[this.page]
+      this.getCourse(this.checkJson.answer2)
+    },
+    openCourse(cid) {
+      top.postMessage({ cid: cid, screenType: '3' }, '*')
+    },
+    getCourse(id) {
+      this.isloading = true
+      const params = {
+        cid: id.join(',')
+      }
+      getCourseInfoTestAll(params)
+        .then(res => {
+          this.isloading = false
+          this.courseDetail = res[0]
+          this.courseDetail.forEach(element => {
+            element.cover = JSON.parse(element.cover)[0].url
+          })
+        })
+        .catch(err => {
+          this.isloading = false
+          console.error(err)
+        })
+    },
+    openCourseD() {
+      this.dialogVisibleCourse = true
+    }
+  },
+  mounted() {
+    this.checkJson = this.cJson ? this.depthCopy(this.cJson) : undefined
+    if (this.checkJson.answer2.length) {
+      // this.page = this.checkJson.courses.indexOf(this.checkJson.answer2)
+      this.getCourse(this.checkJson.answer2)
+    }
+  }
+}
+</script>
+
+<style scoped>
+.c_box {
+  width: 100%;
+  position: relative;
+}
+
+/* .mask {
+    position: absolute;
+    height: 100%;
+    width: 100%;
+    z-index: 2;
+} */
+
+.choice_box {
+  white-space: pre-line;
+}
+
+.choice_box > .title {
+  font-weight: bold;
+  width: 100%;
+  word-break: break-all;
+}
+
+.choice_box > .choices {
+  margin-top: 10px;
+}
+
+.choices > .page {
+  margin-top: 10px;
+  display: flex;
+  align-items: center;
+}
+
+.p_page {
+  margin: 0 10px;
+}
+
+.course {
+  display: flex;
+  align-items: center;
+  cursor: pointer;
+}
+
+.course + .course {
+  margin-top: 10px;
+}
+
+.course > .banner {
+  min-width: 100px;
+  width: 100px;
+  height: 100px;
+  border-radius: 5px;
+  overflow: hidden;
+  border: 1px solid #3896fc;
+  box-sizing: border-box;
+  padding: 5px;
+  margin-right: 15px;
+}
+.course > .banner > img {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
+.course > .content {
+  max-width: calc(100% - 100px - 15px);
+}
+.course > .content > .c_c {
+  display: flex;
+}
+.course > .content > .c_c + .c_c {
+  margin-top: 5px;
+}
+.course > .content > .c_c span:nth-child(1) {
+  min-width: fit-content;
+}
+.course > .content > .c_c span:nth-child(2) {
+  word-break: break-word;
+}
+</style>

+ 124 - 17
src/views/testDetail/components/file.vue

@@ -19,6 +19,16 @@
           <span>{{ checkJson.score2 }}分</span><span style="margin: 0 10px">/</span><span>{{ checkJson.score }}分</span>
         </div>
       </div>
+      <div class="choices">
+        <div class="file_box" v-if="checkJson.mobanFile && checkJson.mobanFile.length" v-loading="loading">
+          <div class="file_item" v-for="(item, index) in checkJson.mobanFile" :key="index">
+            <div class="file_name">{{ item.name }}</div>
+            <div class="file_btns">
+              <div class="file_btn" @click="downloadMobanFile(index)">下载</div>
+            </div>
+          </div>
+        </div>
+      </div>
       <div class="choices">
         <div class="binfo_input">
           <div class="fileBox" v-if="checkJson.file && checkJson.file.length">
@@ -108,6 +118,41 @@ import wpdf from '../file/wPdf2.vue'
 import wVideo from '../file/wVideo.vue'
 import wOffice from '../file/wOffice.vue'
 
+const getFile = url => {
+  return new Promise((resolve, reject) => {
+    var credentials = {
+      accessKeyId: 'AKIATLPEDU37QV5CHLMH',
+      secretAccessKey: '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'
+    } // 秘钥形式的登录上传
+    window.AWS.config.update(credentials)
+    window.AWS.config.region = 'cn-northwest-1' // 设置区域
+    const url2 = url
+    let _url2 = ''
+    if (url2.indexOf('https://view.officeapps.live.com/op/view.aspx?src=') != -1) {
+      _url2 = url2.split('https://view.officeapps.live.com/op/view.aspx?src=')[1]
+    } else {
+      _url2 = url2
+    }
+    var s3 = new window.AWS.S3({ params: { Bucket: 'ccrb' } })
+    const name = decodeURIComponent(
+      _url2.split('https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/')[1].replace(/\+/g, ' ')
+    )
+    var params = {
+      Bucket: 'ccrb',
+      Key: name
+    }
+    s3.getObject(params, function(err, data) {
+      if (err) {
+        console.log(err, err.stack)
+        resolve({ data: 1 })
+      } else {
+        resolve({ data: data.Body })
+        console.log(data)
+      } // sxuccessful response
+    })
+    // axios({
+  })
+}
 export default {
   components: {
     wpdf,
@@ -206,11 +251,11 @@ export default {
       var credentials = {
         accessKeyId: 'AKIATLPEDU37QV5CHLMH',
         secretAccessKey: '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'
-      } //秘钥形式的登录上传
+      } // 秘钥形式的登录上传
       window.AWS.config.update(credentials)
-      window.AWS.config.region = 'cn-northwest-1' //设置区域
+      window.AWS.config.region = 'cn-northwest-1' // 设置区域
 
-      var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } }) //选择桶
+      var bucket = new window.AWS.S3({ params: { Bucket: 'ccrb' } }) // 选择桶
       var _this = this
 
       _this.progress = 0
@@ -229,7 +274,7 @@ export default {
           Body: file,
           'Access-Control-Allow-Credentials': '*',
           ACL: 'public-read'
-        } //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+        } // key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
         var options = {
           partSize: 2048 * 1024 * 1024,
           queueSize: 2,
@@ -238,7 +283,7 @@ export default {
         bucket
           .upload(params, options)
           .on('httpUploadProgress', function(evt) {
-            //这里可以写进度条
+            // 这里可以写进度条
             // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
             _this.progress = parseInt((evt.loaded / evt.total) * 100)
             _this.isFinishSize = (evt.loaded / 1024 / 1024).toFixed(2)
@@ -311,21 +356,21 @@ export default {
               if (
                 fileA.indexOf(data.Location.split('.')[data.Location.split('.').length - 1].toLocaleUpperCase()) != -1
               ) {
-                _type = 1 //word 文件
+                _type = 1 // word 文件
               } else if (
                 videoA.indexOf(data.Location.split('.')[data.Location.split('.').length - 1].toLocaleUpperCase()) != -1
               ) {
-                _type = 2 //视频
+                _type = 2 // 视频
               } else if (
                 imgA.indexOf(data.Location.split('.')[data.Location.split('.').length - 1].toLocaleLowerCase()) != -1
               ) {
-                _type = 3 //图片
+                _type = 3 // 图片
               } else if (
                 'pdf'.indexOf(data.Location.split('.')[data.Location.split('.').length - 1].toLocaleLowerCase()) != -1
               ) {
-                _type = 4 //pdf
+                _type = 4 // pdf
               } else {
-                _type = 5 //文件
+                _type = 5 // 文件
               }
               if (_this.checkJson.file) {
                 _this.checkJson.file.push({
@@ -350,25 +395,48 @@ export default {
           })
       }
     },
+    downloadMobanFile(index) {
+      this.loading = true
+      const file = this.checkJson.mobanFile[index]
+      getFile(file.url).then(data => {
+        this.loading = false
+        if (data.data !== 1) {
+          // 下载文件, 并存成ArrayBuffer对象
+          const file_name = file.name // 获取文件名
+          const file_data = data.data // 获取文件数据
+          const url = window.URL.createObjectURL(new Blob([file_data]))
+          const a = document.createElement('a')
+          a.name = file_name
+          a.href = url
+          a.download = file_name
+          a.click()
+          console.log(data)
+          this.$message.success('下载成功')
+        } else {
+          this.$message.error('下载失败')
+        }
+      })
+    },
+
     downloadFile(f) {
       var credentials = {
         accessKeyId: 'AKIATLPEDU37QV5CHLMH',
         secretAccessKey: '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'
-      } //秘钥形式的登录上传
+      } // 秘钥形式的登录上传
       window.AWS.config.update(credentials)
-      window.AWS.config.region = 'cn-northwest-1' //设置区域
-      let url2 = f.url
+      window.AWS.config.region = 'cn-northwest-1' // 设置区域
+      const url2 = f.url
       let _url2 = ''
       if (url2.indexOf('https://view.officeapps.live.com/op/view.aspx?src=') != -1) {
         _url2 = url2.split('https://view.officeapps.live.com/op/view.aspx?src=')[1]
       } else {
         _url2 = url2
       }
-      let _this = this
+      const _this = this
 
       _this.downLoading = _url2
       var s3 = new window.AWS.S3({ params: { Bucket: 'ccrb' } })
-      let name = decodeURIComponent(_url2.split('https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/')[1])
+      const name = decodeURIComponent(_url2.split('https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/')[1])
       var params = {
         Bucket: 'ccrb',
         Key: name
@@ -378,8 +446,8 @@ export default {
         if (err) console.log(err, err.stack)
         // an error occurred
         else {
-          let url = window.URL.createObjectURL(new Blob([data.Body]))
-          let a = document.createElement('a')
+          const url = window.URL.createObjectURL(new Blob([data.Body]))
+          const a = document.createElement('a')
           a.name = f.name
           a.href = url
           a.download = f.name
@@ -598,5 +666,44 @@ export default {
       }
     }
   }
+
+  .file_box {
+    /* padding: 0 0 0 15px; */
+    width: 100%;
+    box-sizing: border-box;
+    margin: 10px 0;
+    .file_item {
+      display: flex;
+      width: 100%;
+      padding: 5px;
+      box-sizing: border-box;
+      border-radius: 5px;
+
+      + .file_item {
+        margin-top: 5px;
+      }
+
+      &:hover {
+        background: #eee;
+      }
+      .file_name {
+        color: #747474;
+      }
+
+      .file_btns {
+        margin-left: auto;
+        display: flex;
+        align-items: center;
+
+        .file_btn {
+          color: #3681fc;
+          cursor: pointer;
+          + .file_btn {
+            margin-left: 5px;
+          }
+        }
+      }
+    }
+  }
 }
 </style>

+ 57 - 5
src/views/testDetail/components/topic.vue

@@ -70,6 +70,18 @@
               :see="see"
               :isTeacher="isTeacher"
             ></timeV>
+            <courseV2
+              :tindex="index"
+              :cJson.sync="item.json"
+              :checktype="checktype"
+              v-else-if="item.type == 11"
+              :see="see"
+              :isTeacher="isTeacher"
+              @getTestWorkByCid="getTestWorkByCid"
+              @publish2="publish2"
+              :issetPage.sync="issetPage"
+              :tid="tid"
+            ></courseV2>
             <!-- <span v-else>暂未设置题目</span> -->
           </div>
           <div v-for="(item2, index2) in item.array" :key="`${index}-${index2}`" class="check_box_xia">
@@ -133,6 +145,18 @@
                 :see="see"
                 :isTeacher="isTeacher"
               ></timeV>
+              <courseV2
+                :tindex="index2"
+                :cJson.sync="item2.json"
+                :checktype="checktype"
+                v-else-if="item2.type == 11"
+                :see="see"
+                :isTeacher="isTeacher"
+                @getTestWorkByCid="getTestWorkByCid"
+                @publish2="publish2"
+                :issetPage.sync="issetPage"
+                :tid="tid"
+              ></courseV2>
               <!-- <span v-else>暂未设置题目</span> -->
             </div>
           </div>
@@ -200,6 +224,18 @@
               :see="see"
               :isTeacher="isTeacher"
             ></timeV>
+            <courseV2
+              :tindex="index"
+              :cJson.sync="item.json"
+              :checktype="checktype"
+              v-else-if="item.type == 11"
+              :see="see"
+              :isTeacher="isTeacher"
+              @getTestWorkByCid="getTestWorkByCid"
+              @publish2="publish2"
+              :issetPage.sync="issetPage"
+              :tid="tid"
+            ></courseV2>
             <!-- <span v-else>暂未设置题目</span> -->
           </div>
           <div v-for="(item2, index2) in item.array" :key="`${index}-${index2}`" class="check_box_xia">
@@ -263,6 +299,18 @@
                 :see="see"
                 :isTeacher="isTeacher"
               ></timeV>
+              <coursev2
+                :tindex="index2"
+                :cJson.sync="item2.json"
+                :checktype="checktype"
+                v-else-if="item2.type == 11"
+                :see="see"
+                :isTeacher="isTeacher"
+                @getTestWorkByCid="getTestWorkByCid"
+                @publish2="publish2"
+                :issetPage.sync="issetPage"
+                :tid="tid"
+              ></coursev2>
               <!-- <span v-else>暂未设置题目</span> -->
             </div>
           </div>
@@ -275,7 +323,8 @@
           <span>{{ page + 1 }}</span
           ><span>/</span><span>{{ checkArray.length }}</span>
         </div>
-        <el-button type="primary" size="mini" :disabled="page == checkArray.length - 1" @click="setPage('1')"
+        <el-button type="primary" size="mini"
+:disabled="page == checkArray.length - 1" @click="setPage('1')"
           >下一页</el-button
         >
       </div>
@@ -290,6 +339,7 @@ import fileV from './file.vue'
 import courseV from './course.vue'
 import evaV from './eva.vue'
 import timeV from './time.vue'
+import courseV2 from './course2.vue'
 
 export default {
   props: {
@@ -333,7 +383,8 @@ export default {
     fileV,
     courseV,
     evaV,
-    timeV
+    timeV,
+    courseV2
   },
   data() {
     return {
@@ -347,7 +398,8 @@ export default {
         4: '添加文档',
         5: '附件',
         6: '课程',
-        7: '评分'
+        7: '评分',
+        11: '课程'
       },
       isloading: true,
       issetPage: false
@@ -439,9 +491,9 @@ export default {
     },
     setJson(json) {
       if (json.length > 0) {
-        let _json = this.depthCopy(json)
+        const _json = this.depthCopy(json)
         this.type = _json[0].ttype
-        let checkArray = _json.filter(item => {
+        const checkArray = _json.filter(item => {
           if (item.array) {
             item.array = item.array.filter(item2 => {
               if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item.type != 7) {

+ 23 - 23
src/views/testDetail/index.vue

@@ -76,7 +76,7 @@ export default {
           this.title = res[0][0].title
           this.brief = res[0][0].brief
 
-          this.see = res[0][0].open == 1 ? true : false
+          this.see = res[0][0].open == 1
 
           this.testType = []
           for (var i = 0; i < res[1].length; i++) {
@@ -97,24 +97,24 @@ export default {
     },
     getTestWorkByCid(courseid) {
       this.courseid = courseid
-      let params = {
+      const params = {
         cid: this.cid,
-        uid: this.userid
+        uid: this.userinfo.userid
       }
       console.log('getTestWorkByCidparams', params)
-      let _courseid = courseid
+      const _courseid = courseid
       selectTestWorksCid(params)
         .then(res => {
           console.log('selectTestWorksCid', res)
           if (res[0].length) {
-            let rData = res[0]
+            const rData = res[0]
             this.tid = ''
             // eslint-disable-next-line no-labels
             aa: for (var i = 0; i < rData.length; i++) {
-              let rDataJson = this.JSONSetting(JSON.parse(rData[i].courseJson))
-              let _json = JSON.parse(rData[i].courseJson)
+              const rDataJson = this.JSONSetting(JSON.parse(rData[i].courseJson))
+              const _json = JSON.parse(rData[i].courseJson)
               for (var j = 0; j < rDataJson.length; j++) {
-                let _param = rDataJson[j]
+                const _param = rDataJson[j]
                 if (_param.type == 6 && _param.json.answer2 && _param.json.answer2 == _courseid) {
                   this.cJson = _json
                   console.log(this.cJson)
@@ -143,9 +143,9 @@ export default {
         })
     },
     setJson2(json) {
-      let _json = json
+      const _json = json
       // this.type = _json[0].ttype;
-      let checkArray = _json.filter(item => {
+      const checkArray = _json.filter(item => {
         if (item.array) {
           item.array = item.array.filter(item2 => {
             if (item2.ttype == 1 && item2.json && !item2.json.answer2) {
@@ -172,9 +172,9 @@ export default {
       return checkArray
     },
     setCourseid(json) {
-      let _json = json
+      const _json = json
       // this.type = _json[0].ttype;
-      let checkArray = _json.filter(item => {
+      const checkArray = _json.filter(item => {
         if (item.array) {
           item.array = item.array.filter(item2 => {
             if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item2.type != 7) {
@@ -213,8 +213,8 @@ export default {
       return checkArray
     },
     JSONSetting(json) {
-      let _json = json
-      let array = []
+      const _json = json
+      const array = []
       _json.filter(item => {
         if (item.array) {
           item.array = item.array.filter(item2 => {
@@ -276,10 +276,10 @@ export default {
       var pan = 0
       for (var i = 0; i < array.length; i++) {
         if (array[i].type != 6) {
-          let param = array[i].json
+          const param = array[i].json
           if (array[i].type == 5 && param.file && param.file.length > 0) {
             pan++
-          } else if (param.answer2.length || typeof param.answer2 == 'number') {
+          } else if (param.answer2.length || typeof param.answer2 === 'number') {
             pan++
           }
         }
@@ -292,18 +292,18 @@ export default {
     },
     publish2() {
       console.log('publish2')
-      let cjson = this.$refs['topicVue'].checkArray
-      let _cjson = this.JSONSetting(JSON.parse(JSON.stringify(cjson)))
-      let pan = this.panJSON(_cjson)
+      const cjson = this.$refs['topicVue'].checkArray
+      const _cjson = this.JSONSetting(JSON.parse(JSON.stringify(cjson)))
+      const pan = this.panJSON(_cjson)
       if (!pan) {
         setTimeout(() => {
           this.isloading = false
         }, 500)
         return
       }
-      let params = [
+      const params = [
         {
-          uid: this.tid ? this.tid : this.userid,
+          uid: this.tid ? this.tid : this.userinfo.userid,
           cid: this.cid,
           cjson: encodeURIComponent(JSON.stringify(cjson)),
           type: '2'
@@ -330,11 +330,11 @@ export default {
     publish() {
       console.log('publish')
 
-      let cjson = this.$refs['topicVue'].checkArray
+      const cjson = this.$refs['topicVue'].checkArray
 
       const params = [
         {
-          uid: this.tid ? this.tid : this.userid,
+          uid: this.tid ? this.tid : this.userinfo.userid,
           cid: this.cid,
           cjson: encodeURIComponent(JSON.stringify(cjson)),
           type: 2

Some files were not shown because too many files changed in this diff