lsc 2 years ago
parent
commit
e96d1bf43f

+ 1 - 1
dist/index.html

@@ -18,7 +18,7 @@
       border-radius: 10px;
       -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
       background-color: rgba(0, 0, 0, 0.1);
-    }</style><link href=./static/css/app.79dfaed9acdddf99cb5006b7077f0a83.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.8d7171b1fe858bda1433.js></script><script type=text/javascript src=./static/js/app.65450b286e63aa5d7520.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.2a6617a50831ac86e2b6f636ea32642a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.8d7171b1fe858bda1433.js></script><script type=text/javascript src=./static/js/app.7c572f3f8935eb61c6c2.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.2a6617a50831ac86e2b6f636ea32642a.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.2a6617a50831ac86e2b6f636ea32642a.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.79dfaed9acdddf99cb5006b7077f0a83.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.79dfaed9acdddf99cb5006b7077f0a83.css.map


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


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


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 4 - 4
src/components/courseDetail.vue

@@ -83,9 +83,9 @@
                 <div class="now_study" @click="dialogVisible = true">
                   立即学习
                 </div>
-              <!-- <div class="now_study" @click="dialogVisibleGroup = true">
-                设置分组
-              </div> -->
+              <div class="now_study" @click="dialogVisibleGroup = true">
+                 {{courseDetail.userid != userid ? '加入分组' : '设置分组'}}
+              </div>
             </div>
             </div>
           </div>
@@ -539,7 +539,7 @@
             </div>
           </div>
         </el-dialog>
-        <Group :dialogVisibleGroup.sync="dialogVisibleGroup" :classList="classList" :cid="id" :courseDetail="courseDetail" :userid="userid"></Group>
+        <Group :dialogVisibleGroup.sync="dialogVisibleGroup" :classList="classList" :cid="id" :courseDetail="courseDetail" :userid="userid" :type="tType" :classId="classId"></Group>
       </div>
     </div>
   </div>

+ 240 - 5
src/components/group/group.vue

@@ -4,7 +4,12 @@
             :before-close="handleClose2" class="dialog_diy">
             <div v-if="dialogVisibleGroup">
                 <div class="g_d_btnBox">
-                    <div class="btn_left">
+                    <div class="btn_left" v-if="type == 1">
+                        <div @click="setClassid('1')" :class="{ active: classid == '1' }" v-if="!classList.length">全部</div>
+                        <div @click="setClassid(item.id)" :class="{ active: classid == item.id }"
+                            v-for="(item, index) in classList" :key="index">{{ item.name }}</div>
+                    </div>
+                    <div class="btn_left" v-if="type == 2">
                         <div @click="setClassid('1')" :class="{ active: classid == '1' }" v-if="!classList.length">全部</div>
                         <div @click="setClassid(item.id)" :class="{ active: classid == item.id }"
                             v-for="(item, index) in classList" :key="index">{{ item.name }}</div>
@@ -145,7 +150,9 @@
                                         " v-else-if="groupStudentUid && groupStudentUid[g.id].indexOf(userid) != -1">
                                             退出分组
                                         </div>
-                                        <div style="margin-top:10px" v-if="courseDetail.userid == userid && groupJson.islock == 2">
+                                        <div style="margin-top:10px"
+                                            v-if="courseDetail.userid == userid && groupJson.islock == 2 && groupStudent[g.id].length < groupJson.number"
+                                            @click="addGroupStudent(g.id)">
                                             添加组员
                                         </div>
                                     </div>
@@ -319,12 +326,58 @@
                 <el-button type="primary" @click="updateChair">确定</el-button>
             </span>
         </el-dialog>
+        <el-dialog title="添加学生" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
+            :before-close="handleClose" class="addNewPP">
+            <div class="people">
+                <div class="people_top">
+                    <div class="people_top_right">
+                        <div class="people_search">
+                            <el-input placeholder="搜索学生的姓名" v-model="searchTN" @keyup.enter.native="getStudent"></el-input>
+                            <div class="search_img" @click="getStudent">
+                                <img src="../../assets/icon/search.png" alt />
+                            </div>
+                        </div>
+                    </div>
+                    <div class="people_nav">选择成员</div>
+                </div>
+                <div class="t_j_box" style="
+                        padding: 20px 0 0 25px;
+                        width: calc(100% - 55px);
+                        margin-left: 25px;
+                      ">
+                    <span>姓名</span>
+                    <span>账号</span>
+                </div>
+                <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="classJuri.length">
+                    <el-checkbox v-for="item in classJuri" :key="item.userid" :label="item.userid">
+                        <div class="t_j_box">
+                            <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
+                                <span>{{ item.name ? item.name : "暂无姓名" }}</span>
+                            </el-tooltip>
+                            <el-tooltip placement="top" :content="item.username">
+                                <span>{{ item.username }}</span>
+                            </el-tooltip>
+                        </div>
+                    </el-checkbox>
+                </el-checkbox-group>
+                <div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
+            </div>
+            <div style="margin-top: 10px;">
+                <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
+                    v-if="page && classJuri.length" style="padding-bottom: 20px"
+                    @current-change="handleCurrentChange"></el-pagination>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisibleMember = false">取 消</el-button>
+                <el-button type="primary" @click="joinGroup2">确定</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
 <script>
 export default {
-    props: ['cid', 'dialogVisibleGroup', 'classList', 'courseDetail', 'userid'],
+    props: ['cid', 'dialogVisibleGroup', 'classList', 'courseDetail', 'userid',"type","classId"],
     data() {
         return {
             groupJson2: {},
@@ -339,6 +392,7 @@ export default {
             timer: null,
             groupStudent: {},
             groupStudentUid: {},
+            allGroupStudentUid: [],
             dialogVisibleGroup2: false,
             checkDeleteGroup: [],
             deleteGroupUser: [],
@@ -348,6 +402,13 @@ export default {
             updateGroupArray: [],
             updateGroupUser: {},
             dialogVisibleUpdateGroup: false,
+            classJuri: [],
+            checkboxList3: [],
+            pageSize: 20,
+            total: 0,
+            page: 1,
+            dialogVisibleMember: false,
+            searchTN: "",
         }
     },
     methods: {
@@ -358,6 +419,35 @@ export default {
         handleClose(done) {
             done();
         },
+        getStudent() {
+            this.page = 1
+            this.selectCStudent();
+        },
+        handleCurrentChange(val) {
+            this.page = val;
+            this.selectCStudent();
+        },
+        selectCStudent() {
+            let params = {
+                cid: this.classid,
+                cn: this.searchTN,
+                page: this.page,
+                num: this.pageSize
+            };
+            this.ajax
+                .get(this.$store.state.api + "selectSnameByCidPage", params)
+                .then((res) => {
+                    this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+                    if (res.data && res.data[0].length) {
+                        this.classJuri = res.data[0].filter((el) => {
+                            return this.allGroupStudentUid.indexOf(el.userid) == -1
+                        });
+                    }
+                })
+                .catch((err) => {
+                    console.error(err);
+                });
+        },
         setClassid(cid) {
             this.classid = cid
             this.groupid = ''
@@ -419,7 +509,7 @@ export default {
             }
             for (var i = 0; i < this.groupJson2.group.length; i++) {
                 if (
-                    this.groupStudentUid[this.groupJson2.group[i].id].length >
+                    this.groupStudentUid[this.groupJson2.group[i].id] && this.groupStudentUid[this.groupJson2.group[i].id].length >
                     this.groupJson2.number
                 ) {
                     this.$message.error("已经有小组比你设置的人数多,请重新设置");
@@ -472,6 +562,10 @@ export default {
                                 }
                             }
                         }
+                        this.allGroupStudentUid = []
+                        for (var j = 0; j < groupPerson.length; j++) {
+                            this.allGroupStudentUid.push(groupPerson[j].userid)
+                        }
                         this.groupStudent = groupStudent
                         this.groupStudentUid = groupStudentUid
                         this.$forceUpdate();
@@ -606,6 +700,30 @@ export default {
                     console.error(err);
                 });
         },
+        async joinGroup2() {
+            if (
+                this.groupStudent[this.gid].length + this.checkboxList3.length >
+                this.groupJson.number
+            ) {
+                this.$message.error("位置已满,无法加入");
+                return;
+            }
+            for (let i = 0; i < this.checkboxList3.length; i++) {
+                let params = [
+                    {
+                        gid: this.groupid,
+                        g: this.gid,
+                        uid: this.checkboxList3[i],
+                    },
+                ];
+                const res = await this.ajax.post(this.$store.state.api + "joinCourseGroup", params)
+                if (i == this.checkboxList3.length - 1) {
+                    this.$message.success("加入成功");
+                    this.dialogVisibleMember = false
+                    this.getCourseGroup();
+                }
+            }
+        },
         exitGroup(id) {
             if (this.groupJson.islock == 2) {
                 this.$message.error("位置已被锁定,无法退出");
@@ -627,11 +745,27 @@ export default {
                     console.error(err);
                 });
         },
+        addGroupStudent(groupid) {
+            this.gid = groupid
+            this.page = 1
+            this.searchTN = ""
+            this.checkboxList3 = []
+            this.selectCStudent()
+            this.getCourseGroup();
+            this.dialogVisibleMember = true
+        }
     },
     watch: {
         dialogVisibleGroup(newValue, oldValue) {
             if (this.classList.length) {
-                this.classid = this.classList[0].id
+                if(this.type == 2){
+                    this.classList = this.classList.filter(el =>{
+                        return this.classId.indexOf(el.id) != -1
+                    })
+                    this.classid = this.classList[0].id
+                }else{
+                    this.classid = this.classList[0].id
+                }
             } else {
                 this.classid = '1'
             }
@@ -911,4 +1045,105 @@ export default {
     border-radius: 5px;
     font-size: 14px;
 }
+
+.addNewPP>>>.el-dialog__body {
+    padding: 5px 20px;
+}
+
+.people {
+    border: 1px solid rgb(229 229 229);
+    height: 495px;
+    border-radius: 5px;
+    width: 100%;
+    overflow: auto;
+}
+
+.people_top {
+    display: flex;
+    width: 100%;
+    /* justify-content: space-between; */
+    /* align-items: center; */
+    flex-direction: column;
+    padding: 10px 25px 0;
+    box-sizing: border-box;
+}
+
+.people_nav,
+.people_top_right {
+    /* padding: 20px 0 0 20px; */
+}
+
+.people_top_right {
+    height: 40px;
+    margin-bottom: 10px;
+}
+
+.people_search {
+    display: flex;
+    position: relative;
+}
+
+.people_search>>>.el-input__inner {
+    /* height: 25px; */
+    width: 95%;
+}
+
+.search_img {
+    width: 20px;
+    height: 20px;
+    position: absolute;
+    right: 30px;
+    top: 50%;
+    transform: translateY(-50%);
+}
+
+.search_img>img {
+    width: 100%;
+    height: 100%;
+}
+
+.people_name {
+    display: flex;
+    justify-content: flex-start;
+    padding: 10px 0 0 25px;
+    flex-direction: column;
+    flex-wrap: nowrap;
+    height: calc(100% - 140px);
+    overflow-y: auto;
+    overflow-x: hidden;
+    flex-direction: column;
+}
+
+.people_name>>>.el-checkbox {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    margin-bottom: 10px;
+}
+
+.people_name>>>.el-checkbox__label {
+    text-overflow: ellipsis;
+    overflow: hidden;
+    width: 100%;
+}
+
+.t_j_box {
+    display: flex;
+}
+
+.t_j_box span:nth-child(1) {
+    width: 50%;
+    overflow: hidden;
+    margin-right: 10px;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+.t_j_box span:nth-child(2) {
+    width: 50%;
+    overflow: hidden;
+    margin-right: 10px;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
 </style>

+ 4 - 4
src/components/student/studyStudent.vue

@@ -1646,7 +1646,7 @@ export default {
         courseId: this.id,
       };
       this.ajax
-        .get(this.$store.state.api + "selectStudentCourseDetail", params)
+        .get(this.$store.state.api + "selectStudentCourseDetail3", params)
         .then((res) => {
           if (type != 2) {
             loading.close();
@@ -1720,7 +1720,7 @@ export default {
             }
 
             let unitJson = this.chapInfoList;
-            let works = res.data[3];
+            let works = res.data[1];
             console.log(unitJson);
             for (var i = 0; i < unitJson.length; i++) {
               let task = unitJson[i].chapterInfo[0].taskJson;
@@ -1847,7 +1847,7 @@ export default {
             // this.chapInfoList = JSON.parse(this.courseDetail.chapters);
 
             let unitJson = this.chapInfoList;
-            let works = res.data[3];
+            let works = res.data[1];
 
             for (var i = 0; i < unitJson.length; i++) {
               let task = unitJson[i].chapterInfo[0].taskJson;
@@ -1979,7 +1979,7 @@ export default {
             // if (_this.tType == 4) {
             //   _this.selectPz();
             // }
-          }, 5000);
+          }, 60000);
         })
         .catch((err) => {
           loading.close();

File diff suppressed because it is too large
+ 468 - 247
src/components/studyStudent.vue


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