diff --git a/pages/Mystudent/addclassforwork.vue b/pages/Mystudent/addclassforwork.vue index f277030..50e8a14 100644 --- a/pages/Mystudent/addclassforwork.vue +++ b/pages/Mystudent/addclassforwork.vue @@ -106,6 +106,12 @@ export default { const filteredList = JSON.parse(JSON.stringify(this.changeclasslist)).filter(item => item.name.includes(this.searchKeyword)); // 更新 this.classlist 为过滤后的列表 this.classlist = filteredList; + this.selectclass.forEach(selectedItem => { + const index = this.classlist.findIndex(item => item.id === selectedItem.id); + if (index !== -1) { + this.$set(this.classlist, index, { ...this.classlist[index], isSelected: true }); + } + }); }else{ this.fuwei() } @@ -122,6 +128,12 @@ export default { fuwei() { this.classlist = JSON.parse(JSON.stringify(this.changeclasslist)); + this.selectclass.forEach(selectedItem => { + const index = this.classlist.findIndex(item => item.id === selectedItem.id); + if (index !== -1) { + this.$set(this.classlist, index, { ...this.classlist[index], isSelected: true }); + } + }); }, getclassList() { this.$u.get("https://api.admin-v2.langsi.online/admin-api/classroom/page").then(res => { diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 9a7caf4..040281b 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -57,12 +57,27 @@ }, // 获取上传七牛云token getQiniuToken() { - this.$u.get('https://v2.ielts.langsi.online/file/getToken').then(res => { - console.log(res.data); - this.token = res.data.token - }).catch(err => { - console.log(err) - }) + wx.request({ + url: 'https://v2.ielts.langsi.online/file/getToken', + method: 'get', // Adjust the request method as needed + // data: yourData, + header: { + 'Authorization': 'eyJhbGciOiJIUzUxMiJ9.eyJub3RfeWJzX3VzZXJfa2V5IjoiNWZiYzA4YmUtNDZlMi00NDUzLThmYjQtMjFlNzhjZDIxY2EyIn0.jw2fyMnlNEW-zx8cH6aPh_H-WqEAHDQdh4oCpYg3qBIJZEmw6L4oNWJPvKHM9edmRdLO0p2z7_vlCYoY00NqxA ' + }, + success: (res) => { + console.log(res); + this.token = res.data.data.token + }, + fail: (err) => { + console.log(err); + } + }); + // this.$u.get('https://v2.ielts.langsi.online/file/getToken').then(res => { + // console.log(res.data); + // this.token = res.data.token + // }).catch(err => { + // console.log(err) + // }) }, } diff --git a/pages_teacher/pages_add/add_studentsforwork.vue b/pages_teacher/pages_add/add_studentsforwork.vue index 59e3b63..6ced2bc 100644 --- a/pages_teacher/pages_add/add_studentsforwork.vue +++ b/pages_teacher/pages_add/add_studentsforwork.vue @@ -111,6 +111,12 @@ }); // 更新 this.classlist 为过滤后的列表 this.stulist = filteredList; + this.selectedIds.forEach(selectedItem => { + const index = this.stulist.findIndex(item => item.id === selectedItem.id); + if (index !== -1) { + this.$set(this.stulist, index, { ...this.stulist[index], isSelected: true }); + } + }); } else { this.fuwei(); } @@ -118,6 +124,12 @@ fuwei() { this.stulist = JSON.parse(JSON.stringify(this.orgstulist)); + this.selectedIds.forEach(selectedItem => { + const index = this.stulist.findIndex(item => item.id === selectedItem.id); + if (index !== -1) { + this.$set(this.stulist, index, { ...this.stulist[index], isSelected: true }); + } + }); }, highlightSearch(name) { // 使用正则表达式替换匹配到的 searchKeyword 为带有颜色的文字 diff --git a/pages_teacher/teacher_teachers/teacher_addOperation.vue b/pages_teacher/teacher_teachers/teacher_addOperation.vue index 0d42a84..69e9398 100644 --- a/pages_teacher/teacher_teachers/teacher_addOperation.vue +++ b/pages_teacher/teacher_teachers/teacher_addOperation.vue @@ -31,7 +31,10 @@ - + + + + @@ -62,7 +65,10 @@ - + + + + @@ -312,6 +318,12 @@ } }, methods:{ + delcls(id){ + this.classinfo = this.classinfo.filter(item => item.id !== id); + }, + delstu(id){ + this.stuinfo = this.stuinfo.filter(item => item.id !== id); + }, toaddstu(){ uni.navigateTo({ url: "/pages_teacher/pages_add/add_studentsforwork?stuinfo=" + encodeURIComponent(JSON.stringify(this.stuinfo))