lsc 6 meses atrás
pai
commit
10c7e885e0

+ 50 - 1
src/components/pages/synergyCourse/addCourse.vue

@@ -136,7 +136,7 @@
             </div>
             <div class="whiteBg" style="margin-top: 10px">
               <groupBox :cid="cid" :people="checkboxList3" :classList="classList" :courseDetail="courseDetail"
-                :userid="userid" :type="1" classId="" :oid="oid" v-if="cid"></groupBox>
+                :userid="userid" :type="1" classId="" :oid="oid" v-if="cid" @open2="open2"></groupBox>
               <div v-else class="tipsBox">请添加课程名称后才能设置分组</div>
             </div>
             <div class="whiteBg" style="border-radius: 0; background:#F0F2F5;" v-if="false">
@@ -5117,6 +5117,55 @@ export default {
           "*"
         );
     },
+    open2() {
+      if (this.courseDetail.userid == this.userid || top.US.userInfo.role==1) {
+        window.parent.postMessage(
+          {
+            tools: "opencCscl",
+            cid: this.cid,
+            gid: '',
+          },
+          "*"
+        );
+        return;
+      }
+      let params = {
+        cid: this.cid,
+        classid: '1',
+      };
+      this.ajax
+        .get(this.$store.state.api + "getCourseGroup", params)
+        .then((res) => {
+          if (res.data && res.data[1].length) {
+            let groupPerson = res.data[1]
+            let groupCid = ''
+            for (var i = 0; i < groupPerson.length; i++) {
+              if (groupPerson[i].userid == this.userid) {
+                groupCid = groupPerson[i].groupCid
+                break;
+              }
+            }
+            if (groupCid) {
+              window.parent.postMessage(
+                {
+                  tools: "opencCscl",
+                  cid: cid,
+                  gid: groupCid,
+                },
+                "*"
+              );
+            } else {
+              this.$message.error("没有加入分组请先加入分组");
+            }
+          } else {
+            this.$message.error("没有加入分组请先加入分组");
+          }
+        })
+        .catch((err) => {
+          this.$message.error("网络不佳");
+          console.error(err);
+        });
+    },
     guid() {
       var _num,
         i,

+ 13 - 1
src/components/pages/synergyCourse/group/group.vue

@@ -841,7 +841,18 @@ export default {
             });
         },
         selectGroup(gid) {
-            this.getCourseGroup(gid)
+            this.$confirm(
+                // "您确定要删除该分组吗? 分组删除后将被清空并且无法恢复。",
+                "确认加入分组?确认后将直接打开协同构建",
+                "提示",
+                {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                }
+            ).then(() => {
+                    this.getCourseGroup(gid)
+            }).catch(() => { });
         },
         joinGroup(gid) {
             if (this.groupJson.islock == 2) {
@@ -867,6 +878,7 @@ export default {
                 .post(this.$store.state.api + "joinCourseGroup", params)
                 .then((res) => {
                     this.$message.success("加入成功");
+                    this.$emit('open2')
                     this.$emit('getGroup')
                     this.getCourseGroup();
                 })