SanHQin 1 năm trước cách đây
mục cha
commit
39e0fcc7e2

+ 18 - 6
src/components/pages/test/add/components/course/courseDilog.vue

@@ -2,7 +2,7 @@
     <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"></courseIndexVue>
+            <courseIndexVue :courseArray="courseArray" @updateCourseArray="updateCourseArray"></courseIndexVue>
         </div>
         <span slot="footer" class="dialog-footer">
             <el-button @click="close()">关 闭</el-button>
@@ -22,19 +22,31 @@ export default {
             type: Boolean,
             default: false
         },
-        courseArray:{
-            type: Array,
-            default: () => []
-        }
+        // courseArray:{
+        //     type: Array,
+        //     default: () => []
+        // }
     },
     data() {
-        return {};
+        return {
+					courseArray:[]
+				};
     },
     methods: {
         handleClose(done) {
             this.close();
             done();
         },
+				updateCourseArray(newValue){
+					let 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);
         }

+ 46 - 26
src/components/pages/test/add/components/course/courseIndex.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="pb_content" style="height: auto; width: 94%; margin: 10px auto;background: unset;">
       <div style="width:100%;padding:0 21px;background:#fff;border-radius: 5px;box-sizing: border-box;">
-        <div class="pb_head top">
+        <!-- <div class="pb_head top">
           <div style="
       display: flex;
       align-items: center;
@@ -21,25 +21,25 @@
               ">评价管理</span>
           </div>
           <div class="student_button">
-            <!-- <el-button type="primary" class="bgColor" @click="openCourse">协同编辑</el-button> -->
-            <!-- <el-button type="primary" class="bgColor" @click="goToCourse3()">创建极简式课程</el-button>
+            <el-button type="primary" class="bgColor" @click="openCourse">协同编辑</el-button>
+            <el-button type="primary" class="bgColor" @click="goToCourse3()">创建极简式课程</el-button>
             <el-button type="primary" class="bgColor" @click="goToCourse2()">创建任务式课程</el-button>
-            <el-button type="primary" class="bgColor" @click="goToCourse()">创建阶段式课程</el-button> -->
+            <el-button type="primary" class="bgColor" @click="goToCourse()">创建阶段式课程</el-button>
             <button class="r_pub_button_course" @mouseenter="btnDisplay = true" @mouseleave="btnDisplay = false">
               <span>创建课程</span>
               <div v-show="btnDisplay" class="buttonBox">
                 <div type="primary" @click="goToCourse3()">极简式课程</div>
-                <!-- <div type="primary" @click="goToCourse2()">任务式课程</div> -->
+                <div type="primary" @click="goToCourse2()">任务式课程</div>
                 <div type="primary" @click="goToCourse()">阶段式课程</div>
               </div>
             </button>
           </div>
-        </div>
+        </div> -->
         <div class="reBox">
           <div class="reTop">
             <!-- <div>分类筛选</div> -->
             <div class="reTopCh">
-              <el-select v-model="groupA" @change="search" v-if="role == '1'">
+              <!-- <el-select v-model="groupA" @change="search" v-if="role == '1'">
                 <el-option value="4" label="全部"></el-option>
                 <el-option value="2" label="我的课程"></el-option>
                 <el-option value="3" label="协同课程"></el-option>
@@ -49,7 +49,7 @@
                 <el-option value="0" label="全部"></el-option>
                 <el-option value="2" label="我的课程"></el-option>
                 <el-option value="3" label="协同课程"></el-option>
-              </el-select>
+              </el-select> -->
               <div class="searchI">
                 <!-- @click="getCourse" -->
                 <div class="search">
@@ -96,7 +96,7 @@
                 </div>
               </div>
             </div>
-            <div class="all_choose" v-if="role == '1'">
+            <!-- <div class="all_choose" v-if="role == '1'">
               <span><span>所有者</span></span>
               <div class="typeCss">
                 <div class="cName" :class="groupA == '4' ? 'isCType' : ''" @click="groupA = '4'; search();">
@@ -126,7 +126,7 @@
                   协同课程
                 </div>
               </div>
-            </div>
+            </div> -->
           </div>
         </div>
       </div>
@@ -162,7 +162,7 @@
         </div>
         <div class="student_table">
           <div class="course_box">
-            <div class="out_box" v-for="(item, index) in course" :key="index">
+            <div :class="['out_box',courseArray.includes(item.courseId)?'out_boxActive':'']" v-for="(item, index) in course" :key="index" @click.stop="$emit('updateCourseArray',item.courseId)">
               <!-- <div class="myCourse" v-if="item.isCourseType == 1 && groupA == 0">
                 我的课程
               </div>
@@ -170,14 +170,14 @@
                 他人课程
               </div>
               <div class="xtCourse" v-else>协同课程</div> -->
-              <div class="myCourse" v-if="item.userid == userid">我的课程</div>
+              <!-- <div class="myCourse" v-if="item.userid == userid">我的课程</div>
               <div class="myCourse" style="background: #4187f0" v-else-if="!item.course_teacher ||
                 (item.course_teacher &&
                   item.course_teacher.indexOf(userid) == -1)
                 ">
                 他人课程
               </div>
-              <div class="xtCourse" v-else>协同课程</div>
+              <div class="xtCourse" v-else>协同课程</div> -->
               <div class="tup">
                 <img :src="item.cover != null && item.cover != ''
                   ? JSON.parse(item.cover).length > 0
@@ -194,11 +194,11 @@
                 <div class="kc_time">{{ item.time }}</div>
               </div> -->
               <div class="bottom_box">
-                <div>
+                <!-- <div>
                   <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
                     <span>{{ item.title }}</span>
                   </el-tooltip>
-                </div>
+                </div> -->
                 <!-- v-if="item.isCourseType == 2 || groupA == 1" -->
                 <div class="kc_t">
                   <span>{{ item.uname }}</span>
@@ -211,11 +211,11 @@
                   <span style="color: #717C8D">修改日期:</span>{{ item.utime }}
                 </div>
               </div>
-              <div class="three_bottom">
+              <!-- <div class="three_bottom"> -->
                 <!-- v-if="role == '1'" -->
-                <div @click="get(item)">预览</div>
+                <!-- <div @click="get(item)">预览</div> -->
                 <!-- <div @click="jump(item.courseId)" v-else>评课</div> -->
-                <div v-if="((item.userid == userid) ||
+                <!-- <div v-if="((item.userid == userid) ||
                   (item.course_teacher &&
                     item.course_teacher.indexOf(userid) !== -1) || role == '1') &&
                   item.state == 1
@@ -235,7 +235,7 @@
                   item.state == 3
                   " @click="goToCourse3(item.courseId)">
                   修改
-                </div>
+                </div> -->
                 <!-- <div v-if="groupA == '0'" @click="
                   goTo(
                     '/works?cid=' +
@@ -252,12 +252,12 @@
                   ">
                   评价
                 </div> -->
-                <div @click="copyCourse(item.courseId)">
+                <!-- <div @click="copyCourse(item.courseId)">
                   复制
                 </div>
                 <div v-if="item.isCourseType == 1 || role == '1'" @click="deleteCourse(item.courseId)">
                   删除
-                </div>
+                </div> -->
                 <!-- <div class="more">
                   <span style="font-size: 18px; font-weight: 700">...</span>
                   <div>
@@ -267,7 +267,7 @@
                     <span @click="getNT(item.courseId)">无终端</span>
                   </div>
                 </div> -->
-              </div>
+              <!-- </div> -->
             </div>
             <div class="course_empty" v-if="course.length == 0">暂无数据</div>
           </div>
@@ -341,6 +341,13 @@
   import CourseProblem from "../../../../components/courseProblem";
   export default {
     components: { EditorBar, CourseProblem },
+		props:{
+			courseArray:{
+				type:Array,
+				default:()=>[]
+			}
+		},
+		emit:['updateCourseArray'],
     data() {
       return {
         itemCount: 1,
@@ -390,7 +397,7 @@
         typed: "",
         pTypeCheck: [],
         pTypeCheckName: [],
-        btnDisplay: false
+        btnDisplay: false,
       };
     },
     methods: {
@@ -853,7 +860,8 @@
         console.log("typea", this.typea);
         this.isLoading = true;
         let params = {
-          type: this.groupA,
+          // type: this.groupA,
+					type: "4",
           uid: this.userid,
           oid: this.oid,
           org: this.org,
@@ -1338,12 +1346,14 @@
   .course_box {
     display: flex;
     flex-wrap: wrap;
+		background-color: white;
   }
   
   .student_page {
     width: 100%;
     margin: 0 auto;
-    background: #e6eaf0;
+    /* background: #e6eaf0; */
+		background-color: white;
   }
   
   .course_create_box {
@@ -1429,6 +1439,7 @@
     width: calc(100% / 5 - (15px * 4) / 5);
     /* width: 280px; */
     background: #fff;
+		/* background-color: white; */
     margin-right: 15px;
     /* border: 1px solid #ccc; */
     height: fit-content;
@@ -1441,7 +1452,15 @@
     box-sizing: border-box;
     overflow: hidden;
     border: 1px solid #3682fc00;
+		cursor: pointer;
+		border: 1px solid #6a9ff5;
   }
+
+	.out_boxActive{
+		box-sizing: border-box;
+		border: 3px solid #3681FC !important;
+
+	}
   
   .out_box:hover {
     border: 1px solid #3681FC;
@@ -1757,7 +1776,8 @@
   .line {
     width: 100%;
     height: 15px;
-    background: #e6eaf0;
+    /* background: #e6eaf0; */
+		background-color: white;
   }
   
   .reBox {