lsc 1 year ago
parent
commit
3e75e55694

BIN
src/assets/icon/test/icon_course.png


BIN
src/assets/icon/test/icon_course_check.png


+ 22 - 7
src/components/pages/library.vue

@@ -59,7 +59,7 @@
     </div>
     </div>
     <div class="l_file_box">
     <div class="l_file_box">
       <div class="l_none" v-if="pid != 'wu' && pid.split('-').length == 1">请添加二级分类</div>
       <div class="l_none" v-if="pid != 'wu' && pid.split('-').length == 1">请添加二级分类</div>
-      <fileBox :userid="userid" :typeArray="typeArray" :pid="pid" :type='type' @addFile="addFile" v-else></fileBox>
+      <fileBox :userid="userid" :typeArray="typeArray" :pid="pid" :type='type' @addFile="addFile" ref="fileBox" v-else></fileBox>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -109,22 +109,37 @@ export default {
           let pid = res.data[0];
           let pid = res.data[0];
           let child = res.data[1];
           let child = res.data[1];
           for (var i = 0; i < pid.length; i++) {
           for (var i = 0; i < pid.length; i++) {
-            pid[i].child = []
+            let pidChild = []
             pid[i].open = (this.typeArray.length && this.typeArray[i]) ? this.typeArray[i].open : false
             pid[i].open = (this.typeArray.length && this.typeArray[i]) ? this.typeArray[i].open : false
             for (var j = 0; j < child.length; j++) {
             for (var j = 0; j < child.length; j++) {
               if (pid[i].id == child[j].pid) {
               if (pid[i].id == child[j].pid) {
-                pid[i].child.push(child[j])
+                pidChild.push(child[j])
               }
               }
             }
             }
+            pid[i].child = pidChild
           }
           }
+          this.typeArray = pid
+          this.$forceUpdate()
 
 
           let _pid = this.pid.split('-')
           let _pid = this.pid.split('-')
           if (_pid.length === 1 && this.pid != 'wu') {
           if (_pid.length === 1 && this.pid != 'wu') {
-            pid[_pid[0]].open = true;
-            this.$forceUpdate()
-            this.checkType(this.pid + '-0');
+            if(pid[_pid[0]]){
+              pid[_pid[0]].open = true
+              this.pid = this.pid + '-0'
+            }else {
+              this.pid = 'wu'
+            };
+            this.checkType(this.pid);
+          }else if(_pid.length > 1){
+            if (this.typeArray[_pid[0]].child.length > 0 && (parseInt(_pid[1])+1) > this.typeArray[_pid[0]].child.length) {
+              this.pid = _pid[0] + '-0';
+              this.checkType(this.pid);
+            }else if((parseInt(_pid[1])+1) > this.typeArray[_pid[0]].child.length){
+              this.checkType(_pid[0]);
+            }
           }
           }
-          this.typeArray = pid
+          this.$refs['fileBox'].getData()
+          console.log(this.$refs['fileBox']);
         })
         })
         .catch((err) => {
         .catch((err) => {
           this.isLoading = false;
           this.isLoading = false;

+ 413 - 217
src/components/pages/testPerson/test/test.vue

@@ -19,14 +19,14 @@
             </div>
             </div>
         </div>
         </div>
         <div class="check_box" v-loading="loading">
         <div class="check_box" v-loading="loading">
-            <div class="noneData" v-if="!worksArray.length" style="text-align: center;">
+            <div class="noneData" v-if="!worksArray.length" style="text-align: center; margin-top: 20px;">
                 暂无数据
                 暂无数据
             </div>
             </div>
             <div class="test_panel" v-for="(item, index) in worksArray" :key="index">
             <div class="test_panel" v-for="(item, index) in worksArray" :key="index">
                 <div class="test_panel_title">
                 <div class="test_panel_title">
                     <div class="title">
                     <div class="title">
                         <span :class="{ is: item.array.length > 0, no: !item.array.length }">{{ item.array.length > 0 ?
                         <span :class="{ is: item.array.length > 0, no: !item.array.length }">{{ item.array.length > 0 ?
-                            "已完成" : "未完成" }}</span>
+                "已完成" : "未完成" }}</span>
                         <span>{{ item.title }}</span>
                         <span>{{ item.title }}</span>
                     </div>
                     </div>
                     <div class="time">
                     <div class="time">
@@ -40,20 +40,21 @@
                         <span>{{ item.brief ? item.brief : "暂无描述" }}</span>
                         <span>{{ item.brief ? item.brief : "暂无描述" }}</span>
                     </div>
                     </div>
                     <div class="test_add_box"
                     <div class="test_add_box"
-                        style="width: calc(100% - 350px - 20px);border: none;margin-right: 20px;padding: 0;" v-else>
+                        style="width: calc(100% - 350px - 20px);border: none;margin-right: 20px;padding: 0;"
+                        v-else-if="item.array">
                         <div class="test" v-for="test in item.array" :key="test.id">
                         <div class="test" v-for="test in item.array" :key="test.id">
                             <img :src="getImg(test.courseJson)
                             <img :src="getImg(test.courseJson)
-                                    ? getImg(test.courseJson)
-                                    : require('../../../../assets/icon/test/teacher.jpg')
-                                " />
+                ? getImg(test.courseJson)
+                : require('../../../../assets/icon/test/teacher.jpg')
+                " />
                             <div class="time">
                             <div class="time">
-                                <span>提交时间</span>
+                                <span>填写时间</span>
                                 <span>{{ test.time }}</span>
                                 <span>{{ test.time }}</span>
                                 <span>修改时间</span>
                                 <span>修改时间</span>
                                 <span>{{ test.utime }}</span>
                                 <span>{{ test.utime }}</span>
                             </div>
                             </div>
-                            <img @click="deleteTest(test.id)" class="delete" src="../../../../assets/icon/test/delete.png"
-                                alt="" />
+                            <img @click="deleteTest(test.id)" class="delete"
+                                src="../../../../assets/icon/test/delete.png" alt="" />
                             <div class="mask">
                             <div class="mask">
                                 <div @click="doTest(test.courseid, test.id)">
                                 <div @click="doTest(test.courseid, test.id)">
                                     <span></span><span>编辑</span>
                                     <span></span><span>编辑</span>
@@ -67,6 +68,16 @@
                             </div>
                             </div>
                         </div>
                         </div>
                     </div>
                     </div>
+                    <div class="test_add_box"
+                        style="width: calc(100% - 350px - 20px);border: none;margin-right: 20px;padding: 0;flex-direction: column;"
+                        v-else-if="item.carray">
+                        <div class="courseLength" v-for="(course, index) in item.carray" :key="index" @click="doTest3(item, course)">
+                            <span class="finish" :class="{is: course.array.length}"></span>
+                            <span>{{ index+1 }}、</span>
+                            <span>{{ course.title }}</span>
+                            <span>{{ course.username }}</span>
+                        </div>
+                    </div>
                     <div class="panel">
                     <div class="panel">
                         <div class="score">
                         <div class="score">
                             <div>
                             <div>
@@ -83,7 +94,7 @@
                         <div class="btn">
                         <div class="btn">
                             <!-- <div @click="doTest(item.courseid,item.id)"><span></span><span>编辑</span></div> -->
                             <!-- <div @click="doTest(item.courseid,item.id)"><span></span><span>编辑</span></div> -->
                             <div @click="doTest2(item.courseid)">
                             <div @click="doTest2(item.courseid)">
-                                <span></span><span>提交</span>
+                                <span></span><span>填写</span>
                             </div>
                             </div>
                             <!-- <div @click="checkTest(item.courseid,item.id)"><span></span><span>查看</span></div> -->
                             <!-- <div @click="checkTest(item.courseid,item.id)"><span></span><span>查看</span></div> -->
                             <!-- <div @click="copyTest(item.id)"><span></span><span>复制</span></div> -->
                             <!-- <div @click="copyTest(item.id)"><span></span><span>复制</span></div> -->
@@ -93,11 +104,11 @@
                 <div class="test_add_box" v-if="item.array.length > 0 && item.brief">
                 <div class="test_add_box" v-if="item.array.length > 0 && item.brief">
                     <div class="test" v-for="test in item.array" :key="test.id">
                     <div class="test" v-for="test in item.array" :key="test.id">
                         <img :src="getImg(test.courseJson)
                         <img :src="getImg(test.courseJson)
-                                ? getImg(test.courseJson)
-                                : require('../../../../assets/icon/test/teacher.jpg')
-                            " />
+                ? getImg(test.courseJson)
+                : require('../../../../assets/icon/test/teacher.jpg')
+                " />
                         <div class="time">
                         <div class="time">
-                            <span>提交时间</span>
+                            <span>填写时间</span>
                             <span>{{ test.time }}</span>
                             <span>{{ test.time }}</span>
                             <span>修改时间</span>
                             <span>修改时间</span>
                             <span>{{ test.utime }}</span>
                             <span>{{ test.utime }}</span>
@@ -117,6 +128,14 @@
                         </div>
                         </div>
                     </div>
                     </div>
                 </div>
                 </div>
+                <div class="test_add_box" v-if="item.carray.length > 0 && item.brief" style="flex-direction: column;">
+                    <div class="courseLength" v-for="(course, index) in item.carray" :key="index" @click="doTest3(item, course)">
+                            <span class="finish" :class="{is: course.array.length}"></span>
+                            <span>{{ index+1 }}、</span>
+                            <span>{{ course.title }}</span>
+                            <span>{{ course.username }}</span>
+                        </div>
+                </div>
             </div>
             </div>
         </div>
         </div>
     </div>
     </div>
@@ -126,10 +145,10 @@
 export default {
 export default {
     props: {
     props: {
         userid: {
         userid: {
-        type: String,
+            type: String,
         },
         },
         oid: {
         oid: {
-        type: String,
+            type: String,
         },
         },
     },
     },
     data() {
     data() {
@@ -283,9 +302,9 @@ export default {
                 .get(this.$store.state.api + "selectTestType", params)
                 .get(this.$store.state.api + "selectTestType", params)
                 .then(res => {
                 .then(res => {
                     this.typeArray = res.data[0];
                     this.typeArray = res.data[0];
-                    if(this.typeArray.length){
+                    if (this.typeArray.length) {
                         this.type = this.typeArray[0].id;
                         this.type = this.typeArray[0].id;
-                    }else{
+                    } else {
                         this.type = '0';
                         this.type = '0';
                     }
                     }
                     this.getWorks()
                     this.getWorks()
@@ -303,7 +322,6 @@ export default {
             this.ajax
             this.ajax
                 .get(this.$store.state.api + "getTestWorksPerson", params)
                 .get(this.$store.state.api + "getTestWorksPerson", params)
                 .then(res => {
                 .then(res => {
-                    this.loading = false;
                     let array = res.data[0];
                     let array = res.data[0];
                     let array2 = res.data[1];
                     let array2 = res.data[1];
                     // 用于存储归类后的数据的对象
                     // 用于存储归类后的数据的对象
@@ -321,20 +339,53 @@ export default {
                             overtime: item.overtime,
                             overtime: item.overtime,
                             chapters: item.chapters,
                             chapters: item.chapters,
                             brief: item.brief,
                             brief: item.brief,
-                            array: []
+                            typeid: item.typeid,
+                            array: item.typeid == 'dda9728e-5f11-469e-89ee-aca518daf123' ? 0 : [],
+                            carray: [],
                         };
                         };
                     });
                     });
                     worksArray = Object.values(worksArray);
                     worksArray = Object.values(worksArray);
-                    worksArray.forEach(el => {
+                    worksArray.forEach(async el => {
+                        if (el.typeid == 'dda9728e-5f11-469e-89ee-aca518daf123') {
+                            let courseJson = this.returnCourseJSON(el.chapters)
+                            if(courseJson && courseJson.courses.length){
+                                let courses = courseJson.courses.join(',')
+                                let _res = await this.getAllCourse(courses)
+                                console.log(_res);
+                                let _carray = []
+                                for(var i=0;i<_res.length;i++){
+                                    _carray.push({
+                                        courseid: _res[i].courseId,
+                                        title: _res[i].title,
+                                        username: _res[i].username,
+                                        array: []
+                                    })
+                                }
+                                el.carray = _carray
+                            }
+                        }
+
                         array.forEach(el2 => {
                         array.forEach(el2 => {
-                            if (el.courseid == el2.courseid) {
+                            if (el.courseid == el2.courseid && el.typeid != 'dda9728e-5f11-469e-89ee-aca518daf123') {
                                 el.array.push(el2);
                                 el.array.push(el2);
                             }
                             }
+
+                            if(el.courseid == el2.courseid && el.typeid == 'dda9728e-5f11-469e-89ee-aca518daf123'){
+                                let courseid = this.returnCourseId(el2.courseJson)
+                                for(var c = 0; c<el.carray.length;c++){
+                                    if(el.carray[c].courseid == courseid){
+                                        el.carray[c].array.push(el2);
+                                        break
+                                    }
+                                }
+                            }
                         });
                         });
                     });
                     });
                     // worksArray[item.courseid].array.push(item);
                     // worksArray[item.courseid].array.push(item);
 
 
                     this.worksArray = worksArray;
                     this.worksArray = worksArray;
+                    this.loading = false;
+
                     this.$forceUpdate();
                     this.$forceUpdate();
                 })
                 })
                 .catch(err => {
                 .catch(err => {
@@ -403,6 +454,41 @@ export default {
                 this.role
                 this.role
             );
             );
         },
         },
+        doTest3(item, course){
+            if(course.array.length){
+                this.$router.push(
+                    "/doTest?cid=" +
+                    item.courseid +
+                    "&tid=" +
+                    course.array[0].id +
+                    "&userid=" +
+                    this.userid +
+                    "&oid=" +
+                    this.oid +
+                    "&org=" +
+                    this.org +
+                    "&type=3" +
+                    "&role=" +
+                    this.role
+                );
+            }else{
+                this.$router.push(
+                    "/doTest?cid=" +
+                    item.courseid +
+                    "&userid=" +
+                    this.userid +
+                    "&oid=" +
+                    this.oid +
+                    "&org=" +
+                    this.org +
+                    "&type=3" +
+                    "&courseid=" +
+                    course.courseid +
+                    "&role=" +
+                    this.role
+                ); 
+            }
+        },
         copyTest(tid) {
         copyTest(tid) {
             let params = [
             let params = [
                 {
                 {
@@ -423,7 +509,7 @@ export default {
         deleteTest(tid) {
         deleteTest(tid) {
             let _this = this;
             let _this = this;
             _this
             _this
-                .$confirm("确定删除此提交的表单么?", "提示", {
+                .$confirm("确定删除此填写的表单么?", "提示", {
                     confirmButtonText: "确定",
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
                     cancelButtonText: "取消",
                     type: "warning"
                     type: "warning"
@@ -447,7 +533,96 @@ export default {
                 .catch(() => {
                 .catch(() => {
                     return;
                     return;
                 });
                 });
-        }
+        },
+        returnCourseJSON(array) {
+            let _array = JSON.parse(array);
+            let courseJson = '';
+            s: for (var j = 0; j < _array.length; j++) {
+                let el = _array[j];
+                if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
+                    for (var k2 = 0; k2 < el.array.length; k2++) {
+                        let item = el.array[k2];
+                        console.log(k2);
+                        if (item.ttype == 2 && item.array.length > 0) {
+                            for (var z = 0; z < item.array.length; z++) {
+                                let item2 = item.array[z];
+                                if (
+                                    item2.ttype == 1 &&
+                                    item2.type == 6 &&
+                                    item2.json 
+                                ) {
+                                    courseJson = item2.json
+                                    break s;
+                                }
+                            }
+                        } else if (
+                            item.ttype == 1 &&
+                            item.type == 6 &&
+                            item.json
+                        ) {
+                            courseJson = item.json
+                                    break s;
+                        }
+                    }
+                } else if (
+                    el.ttype == 1 &&
+                    el.type == 6 &&
+                    el.json 
+                ) {
+                    courseJson = el.json
+                                    break s;
+                }
+            }
+            return courseJson;
+        },
+        returnCourseId(array) {
+            let _array = JSON.parse(array);
+            let courseJson = '';
+            s: for (var j = 0; j < _array.length; j++) {
+                let el = _array[j];
+                if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
+                    for (var k2 = 0; k2 < el.array.length; k2++) {
+                        let item = el.array[k2];
+                        console.log(k2);
+                        if (item.ttype == 2 && item.array.length > 0) {
+                            for (var z = 0; z < item.array.length; z++) {
+                                let item2 = item.array[z];
+                                if (
+                                    item2.ttype == 1 &&
+                                    item2.type == 6 &&
+                                    item2.json && item2.json.answer2
+                                ) {
+                                    courseJson = item2.json.answer2
+                                    break s;
+                                }
+                            }
+                        } else if (
+                            item.ttype == 1 &&
+                            item.type == 6 &&
+                            item.json && item.json.answer2
+                        ) {
+                            courseJson = item.json.answer2
+                                    break s;
+                        }
+                    }
+                } else if (
+                    el.ttype == 1 &&
+                    el.type == 6 &&
+                    el.json  && el.json.answer2
+                ) {
+                    courseJson = el.json.answer2
+                                    break s;
+                }
+            }
+            return courseJson;
+        },
+        async getAllCourse(id) {
+            let params = {
+                cid: id,
+            };
+            let res = await this.ajax.get(this.$store.state.api + "getCourseInfoTestAll", params)
+            return res.data[0]
+        },
     },
     },
     mounted() {
     mounted() {
         this.selectTestType();
         this.selectTestType();
@@ -458,35 +633,35 @@ export default {
 
 
 <style scoped>
 <style scoped>
 .i_body_box {
 .i_body_box {
-  height: calc(100% - 30px);
-  padding: 30px 0 0;
-  box-sizing: border-box;
+    height: calc(100% - 30px);
+    padding: 30px 0 0;
+    box-sizing: border-box;
 }
 }
 
 
 .check_nav {
 .check_nav {
-  display: flex;
-  height: 50px;
-  align-items: center;
-  padding: 0;
-  box-sizing: border-box;
-  width: 100%;
+    display: flex;
+    height: 50px;
+    align-items: center;
+    padding: 0;
+    box-sizing: border-box;
+    width: 100%;
 }
 }
 
 
 .check_nav>.nav {
 .check_nav>.nav {
-  width: 120px;
-  height: 100%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  color: rgb(167, 167, 167);
-  /* background: #000000; */
-  cursor: pointer;
+    width: 120px;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: rgb(167, 167, 167);
+    /* background: #000000; */
+    cursor: pointer;
 }
 }
 
 
 .check_nav>.active {
 .check_nav>.active {
-  color: #3681fc;
-  background: rgb(248, 250, 254);
-  border-radius: 10px 10px 0 0;
+    color: #3681fc;
+    background: rgb(248, 250, 254);
+    border-radius: 10px 10px 0 0;
 }
 }
 
 
 .check_nav>.all::before,
 .check_nav>.all::before,
@@ -495,330 +670,330 @@ export default {
 .check_nav>.jy::before,
 .check_nav>.jy::before,
 .check_nav>.bj::before,
 .check_nav>.bj::before,
 .check_nav>.yy::before {
 .check_nav>.yy::before {
-  content: "";
-  display: block;
-  width: 18px;
-  height: 18px;
-  background-size: 100% 100%;
-  margin-right: 5px;
+    content: "";
+    display: block;
+    width: 18px;
+    height: 18px;
+    background-size: 100% 100%;
+    margin-right: 5px;
 }
 }
 
 
 .check_nav>.all::before {
 .check_nav>.all::before {
 
 
-  background-image: url('../../../../assets/icon/test/all_icon.png');
+    background-image: url('../../../../assets/icon/test/all_icon.png');
 }
 }
 
 
 .check_nav>.active.all::before {
 .check_nav>.active.all::before {
-  background-image: url('../../../../assets/icon/test/all_icon_active.png');
+    background-image: url('../../../../assets/icon/test/all_icon_active.png');
 }
 }
 
 
 .check_nav>.gr::before {
 .check_nav>.gr::before {
-  background-image: url('../../../../assets/icon/test/gr_icon.png');
+    background-image: url('../../../../assets/icon/test/gr_icon.png');
 }
 }
 
 
 .check_nav>.active.gr::before {
 .check_nav>.active.gr::before {
-  background-image: url('../../../../assets/icon/test/gr_icon_active.png');
+    background-image: url('../../../../assets/icon/test/gr_icon_active.png');
 }
 }
 
 
 .check_nav>.md::before {
 .check_nav>.md::before {
-  background-image: url('../../../../assets/icon/test/md_icon.png');
+    background-image: url('../../../../assets/icon/test/md_icon.png');
 }
 }
 
 
 .check_nav>.active.md::before {
 .check_nav>.active.md::before {
-  background-image: url('../../../../assets/icon/test/md_icon_active.png');
+    background-image: url('../../../../assets/icon/test/md_icon_active.png');
 }
 }
 
 
 .check_nav>.jy::before {
 .check_nav>.jy::before {
-  background-image: url('../../../../assets/icon/test/jy_icon.png');
+    background-image: url('../../../../assets/icon/test/jy_icon.png');
 }
 }
 
 
 .check_nav>.active.jy::before {
 .check_nav>.active.jy::before {
-  background-image: url('../../../../assets/icon/test/jy_icon_active.png');
+    background-image: url('../../../../assets/icon/test/jy_icon_active.png');
 }
 }
 
 
 .check_nav>.yy::before {
 .check_nav>.yy::before {
-  background-image: url('../../../../assets/icon/test/yy_icon.png');
+    background-image: url('../../../../assets/icon/test/yy_icon.png');
 }
 }
 
 
 .check_nav>.active.yy::before {
 .check_nav>.active.yy::before {
-  background-image: url('../../../../assets/icon/test/yy_icon_active.png');
+    background-image: url('../../../../assets/icon/test/yy_icon_active.png');
 }
 }
 
 
 .check_nav>.bj::before {
 .check_nav>.bj::before {
-  background-image: url('../../../../assets/icon/test/bj_icon.png');
+    background-image: url('../../../../assets/icon/test/bj_icon.png');
 }
 }
 
 
 .check_nav>.active.bj::before {
 .check_nav>.active.bj::before {
-  background-image: url('../../../../assets/icon/test/bj_icon_active.png');
+    background-image: url('../../../../assets/icon/test/bj_icon_active.png');
 }
 }
 
 
 
 
 .check_box {
 .check_box {
-  height: calc(100% - 50px);
-  overflow: auto;
-  padding: 20px 0;
-  box-sizing: border-box;
-  background: rgb(248, 250, 254);
+    height: calc(100% - 50px);
+    overflow: auto;
+    padding: 0 0 20px;
+    box-sizing: border-box;
+    background: rgb(248, 250, 254);
 }
 }
 
 
 .test_panel {
 .test_panel {
-  width: calc(100% - 40px);
-  margin: 0 auto;
-  background: #fff;
-  border-radius: 10px;
-  /* height: 300px; */
-  overflow: hidden;
+    width: calc(100% - 40px);
+    margin: 20px auto 0;
+    background: #fff;
+    border-radius: 10px;
+    /* height: 300px; */
+    overflow: hidden;
 }
 }
 
 
 .test_panel+.test_panel {
 .test_panel+.test_panel {
-  margin-top: 20px;
+    margin-top: 20px;
 }
 }
 
 
 .test_panel_title {
 .test_panel_title {
-  height: 60px;
-  display: flex;
-  align-items: center;
-  width: 100%;
-  justify-content: space-between;
-  padding: 0 20px;
-  box-sizing: border-box;
-  border-bottom: 2px solid #f0f0f0;
+    height: 60px;
+    display: flex;
+    align-items: center;
+    width: 100%;
+    justify-content: space-between;
+    padding: 0 20px;
+    box-sizing: border-box;
+    border-bottom: 2px solid #f0f0f0;
 }
 }
 
 
 .test_panel_title>.title {
 .test_panel_title>.title {
-  display: flex;
-  align-items: center;
+    display: flex;
+    align-items: center;
 }
 }
 
 
 .test_panel_title>.title>span:nth-child(1) {
 .test_panel_title>.title>span:nth-child(1) {
-  font-size: 12px;
-  padding: 3px 5px;
-  border-radius: 5px;
-  margin-right: 10px;
+    font-size: 12px;
+    padding: 3px 5px;
+    border-radius: 5px;
+    margin-right: 10px;
 }
 }
 
 
 .test_panel_title>.title>.is:nth-child(1) {
 .test_panel_title>.title>.is:nth-child(1) {
-  color: rgb(100, 215, 155);
-  background: rgb(241, 255, 248);
-  border: 1px solid rgb(100, 215, 155);
+    color: rgb(100, 215, 155);
+    background: rgb(241, 255, 248);
+    border: 1px solid rgb(100, 215, 155);
 }
 }
 
 
 .test_panel_title>.title>.no:nth-child(1) {
 .test_panel_title>.title>.no:nth-child(1) {
-  color: rgb(240, 66, 66);
-  background: rgb(255, 241, 241);
-  border: 1px solid rgb(240, 66, 66);
+    color: rgb(240, 66, 66);
+    background: rgb(255, 241, 241);
+    border: 1px solid rgb(240, 66, 66);
 }
 }
 
 
 .test_panel_title>.title>span:nth-child(2) {
 .test_panel_title>.title>span:nth-child(2) {
-  font-size: 18px;
-  font-weight: 600;
+    font-size: 18px;
+    font-weight: 600;
 }
 }
 
 
 .test_panel_title>.time {
 .test_panel_title>.time {
-  font-size: 14px;
-  color: #a1a1a1;
+    font-size: 14px;
+    color: #a1a1a1;
 }
 }
 
 
 .test_panel_title>.time>span+span {
 .test_panel_title>.time>span+span {
-  margin-left: 10px;
+    margin-left: 10px;
 }
 }
 
 
 .test_panel_box {
 .test_panel_box {
-  width: 100%;
-  display: flex;
-  align-items: center;
-  padding: 20px 20px;
-  box-sizing: border-box;
+    width: 100%;
+    display: flex;
+    align-items: center;
+    padding: 20px 20px;
+    box-sizing: border-box;
 }
 }
 
 
 .test_panel_box>.detail {
 .test_panel_box>.detail {
-  width: calc(100% - 350px - 20px);
-  margin-right: 20px;
-  color: #a1a1a1;
-  font-size: 14px;
-  line-height: 24px;
-  word-break: break-all;
-  display: -webkit-box;
-  -webkit-line-clamp: 4;
-  -webkit-box-orient: vertical;
-  overflow: hidden;
+    width: calc(100% - 350px - 20px);
+    margin-right: 20px;
+    color: #a1a1a1;
+    font-size: 14px;
+    line-height: 24px;
+    word-break: break-all;
+    display: -webkit-box;
+    -webkit-line-clamp: 4;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
 }
 }
 
 
 .test_panel_box>.panel {
 .test_panel_box>.panel {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  width: 350px;
-  min-width: 350px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    width: 350px;
+    min-width: 350px;
 }
 }
 
 
 .test_panel_box>.panel>.score {
 .test_panel_box>.panel>.score {
-  height: 110px;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-  border: 1px solid #dbdbdb;
-  background: rgb(252, 252, 252);
-  width: 120px;
-  border-radius: 5px;
+    height: 110px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    border: 1px solid #dbdbdb;
+    background: rgb(252, 252, 252);
+    width: 120px;
+    border-radius: 5px;
 }
 }
 
 
 .test_panel_box>.panel>.score:nth-child(1) {
 .test_panel_box>.panel>.score:nth-child(1) {
-  display: flex;
+    display: flex;
 }
 }
 
 
 .test_panel_box>.panel>.score>div:nth-child(1)>span:nth-child(1) {
 .test_panel_box>.panel>.score>div:nth-child(1)>span:nth-child(1) {
-  font-size: 30px;
-  font-weight: 700;
+    font-size: 30px;
+    font-weight: 700;
 }
 }
 
 
 .test_panel_box>.panel>.score>div:nth-child(1)>span:nth-child(2) {
 .test_panel_box>.panel>.score>div:nth-child(1)>span:nth-child(2) {
-  margin-left: 5px;
+    margin-left: 5px;
 }
 }
 
 
 .test_panel_box>.panel>.score>div:nth-child(2) {
 .test_panel_box>.panel>.score>div:nth-child(2) {
-  font-size: 14px;
-  margin-top: 10px;
-  color: #a1a1a1;
+    font-size: 14px;
+    margin-top: 10px;
+    color: #a1a1a1;
 }
 }
 
 
 .test_panel_box>.panel>.btn {
 .test_panel_box>.panel>.btn {
-  height: 100px;
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
+    height: 100px;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
 }
 }
 
 
 .test_panel_box>.panel>.btn>div {
 .test_panel_box>.panel>.btn>div {
-  display: flex;
-  color: rgb(69, 141, 255);
-  align-items: center;
-  cursor: pointer;
-  font-size: 14px;
+    display: flex;
+    color: rgb(69, 141, 255);
+    align-items: center;
+    cursor: pointer;
+    font-size: 14px;
 }
 }
 
 
 /* .test_panel_box > .panel >.btn > div + div{
 /* .test_panel_box > .panel >.btn > div + div{
       margin: 15px 0 0 0;
       margin: 15px 0 0 0;
     } */
     } */
 .test_panel_box>.panel>.btn>div>span:nth-child(1) {
 .test_panel_box>.panel>.btn>div>span:nth-child(1) {
-  display: block;
-  width: 13px;
-  height: 13px;
-  background-size: 100% 100%;
-  margin-right: 7px;
+    display: block;
+    width: 13px;
+    height: 13px;
+    background-size: 100% 100%;
+    margin-right: 7px;
 }
 }
 
 
 .test_panel_box>.panel>.btn>div:nth-child(1)>span:nth-child(1) {
 .test_panel_box>.panel>.btn>div:nth-child(1)>span:nth-child(1) {
-  background-image: url('../../../../assets/icon/test/edit_icon.png');
+    background-image: url('../../../../assets/icon/test/edit_icon.png');
 }
 }
 
 
 .test_panel_box>.panel>.btn>div:nth-child(2)>span:nth-child(1) {
 .test_panel_box>.panel>.btn>div:nth-child(2)>span:nth-child(1) {
-  background-image: url('../../../../assets/icon/test/check_icon.png');
+    background-image: url('../../../../assets/icon/test/check_icon.png');
 }
 }
 
 
 .test_panel_box>.panel>.btn>div:nth-child(3)>span:nth-child(1) {
 .test_panel_box>.panel>.btn>div:nth-child(3)>span:nth-child(1) {
-  background-image: url('../../../../assets/icon/test/paste_icon.png');
+    background-image: url('../../../../assets/icon/test/paste_icon.png');
 }
 }
 
 
 .test_add_box {
 .test_add_box {
-  height: 160px;
-  width: 100%;
-  padding: 0 20px;
-  border-top: 2px solid #f0f0f0;
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  overflow: auto;
+    height: 160px;
+    width: 100%;
+    padding: 0 20px;
+    border-top: 2px solid #f0f0f0;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    overflow: auto;
 }
 }
 
 
 
 
 .test_add_box>.test {
 .test_add_box>.test {
-  width: 120px;
-  min-width: 120px;
-  height: 120px;
-  border-radius: 5px;
-  /* overflow: hidden; */
-  position: relative;
+    width: 120px;
+    min-width: 120px;
+    height: 120px;
+    border-radius: 5px;
+    /* overflow: hidden; */
+    position: relative;
 }
 }
 
 
 .test_add_box>.test:hover .mask {
 .test_add_box>.test:hover .mask {
-  display: flex;
+    display: flex;
 }
 }
 
 
 .test_add_box>.test:hover .delete {
 .test_add_box>.test:hover .delete {
-  display: block;
+    display: block;
 }
 }
 
 
 .test_add_box>.test>img {
 .test_add_box>.test>img {
-  width: 100%;
-  height: 100%;
-  object-fit: cover;
-  border-radius: 5px;
+    width: 100%;
+    height: 100%;
+    object-fit: cover;
+    border-radius: 5px;
 }
 }
 
 
 .test_add_box>.test+.test {
 .test_add_box>.test+.test {
-  margin-left: 10px;
+    margin-left: 10px;
 }
 }
 
 
 .test_add_box>.test>.time {
 .test_add_box>.test>.time {
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  flex-direction: column;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  top: 0;
-  left: 0;
-  color: #fff;
-  background: rgba(0, 0, 0, 0.5);
-  font-size: 14px;
-  text-align: center;
-  border-radius: 5px;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    flex-direction: column;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    top: 0;
+    left: 0;
+    color: #fff;
+    background: rgba(0, 0, 0, 0.5);
+    font-size: 14px;
+    text-align: center;
+    border-radius: 5px;
 }
 }
 
 
 .test_add_box>.test>.time>span {
 .test_add_box>.test>.time>span {
-  margin-top: 5px;
+    margin-top: 5px;
 }
 }
 
 
 .test_add_box>.test>.mask {
 .test_add_box>.test>.mask {
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  background: rgba(0, 0, 0, 0.5);
-  /* display: flex; */
-  flex-direction: column;
-  justify-content: center;
-  align-items: center;
-  top: 0;
-  left: 0;
-  color: rgb(69, 141, 255);
-  display: none;
-  border-radius: 5px;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.5);
+    /* display: flex; */
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    top: 0;
+    left: 0;
+    color: rgb(69, 141, 255);
+    display: none;
+    border-radius: 5px;
 }
 }
 
 
 .test_add_box>.test>.delete {
 .test_add_box>.test>.delete {
-  position: absolute;
-  width: 20px;
-  height: 20px;
-  right: -5px;
-  top: -5px;
-  cursor: pointer;
-  z-index: 2;
-  display: none;
+    position: absolute;
+    width: 20px;
+    height: 20px;
+    right: -5px;
+    top: -5px;
+    cursor: pointer;
+    z-index: 2;
+    display: none;
 }
 }
 
 
 .test_add_box>.test>.mask>div {
 .test_add_box>.test>.mask>div {
-  display: flex;
-  color: #fff;
-  align-items: center;
-  cursor: pointer;
-  font-size: 14px;
+    display: flex;
+    color: #fff;
+    align-items: center;
+    cursor: pointer;
+    font-size: 14px;
 }
 }
 
 
 .test_add_box>.test>.mask>div+div {
 .test_add_box>.test>.mask>div+div {
-  margin: 10px 0 0 0;
+    margin: 10px 0 0 0;
 }
 }
 
 
 /* 
 /* 
@@ -843,5 +1018,26 @@ export default {
 } */
 } */
 
 
 .bgColor {
 .bgColor {
-  background: #466b99;
-}</style>
+    background: #466b99;
+}
+
+.courseLength{
+    width: 100%;
+    cursor: pointer;
+    margin-bottom: 10px;
+    display: flex;
+    align-items: center;
+}
+.courseLength > span + span{
+    margin-left: 10px;
+}
+.courseLength > .finish{
+    width: 15px;
+    height: 15px;
+    background-image: url('../../../../assets/icon/test/icon_course.png');
+    background-size: 100% 100%;
+}
+.courseLength > .finish.is{
+    background-image: url('../../../../assets/icon/test/icon_course_check.png');
+}
+</style>

+ 7 - 3
src/components/pages/testStudent/view/component/topic.vue

@@ -129,6 +129,10 @@ export default {
     tid: {
     tid: {
       type: String,
       type: String,
       default: ''
       default: ''
+    },
+    gcourseid: {
+      type: String,
+      default: ''
     }
     }
   },
   },
   components: {
   components: {
@@ -250,7 +254,7 @@ export default {
               if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item.type != 7) {
               if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type != 6 && item.type != 7) {
                 item2.json.answer2 = [];
                 item2.json.answer2 = [];
               } else if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type == 6) {
               } else if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.type == 6) {
-                item2.json.answer2 = item2.json.courses[0];
+                item2.json.answer2 = this.gcourseid ? this.gcourseid : item2.json.courses[0];
               } else if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.json.answer2 !== 0 && item2.type == 7) {
               } else if (item2.ttype == 1 && item2.json && !item2.json.answer2 && item2.json.answer2 !== 0 && item2.type == 7) {
                 item2.json.answer2 = '';
                 item2.json.answer2 = '';
               }
               }
@@ -259,7 +263,7 @@ export default {
                   if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7) {
                   if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type != 6 && item3.type != 7) {
                     item3.json.answer2 = [];
                     item3.json.answer2 = [];
                   } else if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type == 6) {
                   } else if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.type == 6) {
-                    item3.json.answer2 = item3.json.courses[0];
+                    item3.json.answer2 = this.gcourseid ? this.gcourseid : item3.json.courses[0];
                   } else if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.json.answer2 !== 0 && item3.type == 7) {
                   } else if (item3.ttype == 1 && item3.json && !item3.json.answer2 && item3.json.answer2 !== 0 && item3.type == 7) {
                     item3.json.answer2 = '';
                     item3.json.answer2 = '';
                   }
                   }
@@ -274,7 +278,7 @@ export default {
           if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 7) {
           if (item.ttype == 1 && item.json && !item.json.answer2 && item.type != 6 && item.type != 7) {
             item.json.answer2 = [];
             item.json.answer2 = [];
           } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.type == 6) {
           } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.type == 6) {
-            item.json.answer2 = item.json.courses[0];
+            item.json.answer2 = this.gcourseid ? this.gcourseid : item.json.courses[0];
           } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.json.answer2 !== 0 && item.type == 7) {
           } else if (item.ttype == 1 && item.json && !item.json.answer2 && item.json.answer2 !== 0 && item.type == 7) {
             item.json.answer2 = '';
             item.json.answer2 = '';
           }
           }

+ 3 - 2
src/components/pages/testStudent/view/preview.vue

@@ -44,7 +44,7 @@
             </div>
             </div>
           </div>
           </div>
           <topicVue :cJson.sync="cJson" :title="title" :brief="brief" ref="topicVue" v-if="!loading"
           <topicVue :cJson.sync="cJson" :title="title" :brief="brief" ref="topicVue" v-if="!loading"
-            @getTestWorkByCid="getTestWorkByCid" @publish2="publish2" :tid="tid"></topicVue>
+            @getTestWorkByCid="getTestWorkByCid" @publish2="publish2" :tid="tid" :gcourseid="gcourseid"></topicVue>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -78,7 +78,8 @@ export default {
       look: "",
       look: "",
       isReset: false,
       isReset: false,
       isloading: false,
       isloading: false,
-      courseid: ''
+      courseid: '',
+      gcourseid: this.$route.query.courseid
     }
     }
   },
   },
   methods: {
   methods: {