删除修改
This commit is contained in:
parent
33f9ef440d
commit
317c54a1cf
|
@ -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 => {
|
||||
|
|
|
@ -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)
|
||||
// })
|
||||
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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 为带有颜色的文字
|
||||
|
|
|
@ -31,7 +31,10 @@
|
|||
<view class="class_bj">
|
||||
|
||||
<view class="class_images" >
|
||||
<view class="class_ys" v-for="(item,index) in classinfo" :key="index">
|
||||
<view class="class_ys" v-for="(item,index) in classinfo" :key="index" style="position: relative;">
|
||||
<view class="close" style="position: absolute;top: 0rpx;right: 8rpx;width: 20rpx;height: 20rpx;" @click="delcls(item.id)">
|
||||
<image src="https://file.langsi.online/yasiimg/web/static/ueH3qwYazyVXmiYoVPJE" mode=""></image>
|
||||
</view>
|
||||
<view class="class_tp">
|
||||
<image src="https://file.langsi.online/yasiimg/web/static/u4T48EWFfk5p6yrV3gOw" mode=""></image>
|
||||
</view>
|
||||
|
@ -62,7 +65,10 @@
|
|||
</view>
|
||||
<view class="class_bj" >
|
||||
<view class="class_images">
|
||||
<view class="class_ys" v-for="(item,index) in stuinfo" :key="index">
|
||||
<view class="class_ys" v-for="(item,index) in stuinfo" :key="index" style="position: relative;">
|
||||
<view class="close" style="position: absolute;top: 0rpx;right: 8rpx;width: 20rpx;height: 20rpx;" @click="delstu(item.id)">
|
||||
<image src="https://file.langsi.online/yasiimg/web/static/ueH3qwYazyVXmiYoVPJE" mode=""></image>
|
||||
</view>
|
||||
<view class="class_tp">
|
||||
<image :src="item.avatar" mode=""></image>
|
||||
</view>
|
||||
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user