This commit is contained in:
libowei 2023-12-12 11:35:27 +08:00
commit 5ea72f897a
9 changed files with 1770 additions and 1601 deletions

View File

@ -42,7 +42,7 @@ const install = (Vue, vm) => {
// 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值 // 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token'); // const token = uni.getStorageSync('token');
const token = " Bearer 0b34feaf02224ccb9d4e09730ab68c35" const token = " Bearer e465eb9d9ae74b4dad7a63dbe0e54587"
// console.log("我是token", token) // console.log("我是token", token)
config.header.Authorization = token; config.header.Authorization = token;

View File

@ -62,8 +62,8 @@
} }
}, },
onLoad(option) { onLoad(option) {
// this.classid=option.id this.classid=option.id
this.classid=15 // this.classid=15
this.getallstu() this.getallstu()
}, },
methods: { methods: {

View File

@ -95,8 +95,8 @@ export default {
} }
}, },
onLoad(option) { onLoad(option) {
// this.classid=option.id this.classid=option.id
this.classid=15 // this.classid=15
}, },
onShow() { onShow() {

View File

@ -47,7 +47,7 @@
</view> </view>
<view class="info_box"> <view class="info_box">
<view class="info_cont" <view class="info_cont"
style="width:90rpx ;"> style="width:80rpx ;">
<view class="info_cont_top"> <view class="info_cont_top">
学生人数 学生人数
</view> </view>

View File

@ -131,8 +131,8 @@
} }
}, },
onLoad(option) { onLoad(option) {
/* > */ // this.classid=option.id this.classid=option.id
this.classid=15 // this.classid=15
}, },
onShow(){ onShow(){

View File

@ -37,7 +37,7 @@
shape="circle"></u-checkbox> shape="circle"></u-checkbox>
</view> </view>
</view> </view>
<view class="partshow" v-if="tk==partitem.id"> <view class="partshow" v-if="selectedItems.includes(partitem.id)">
<view class="Part2" v-for="(quesitem,quesindex) in partitem.modules" :key="quesindex"> <view class="Part2" v-for="(quesitem,quesindex) in partitem.modules" :key="quesindex">
<view class="imaflex"> <view class="imaflex">
<view>{{quesitem.number}} {{quesitem.typeText}}</view> <view>{{quesitem.number}} {{quesitem.typeText}}</view>
@ -66,6 +66,8 @@
image: true, image: true,
tk: null, tk: null,
selectwrite: [], selectwrite: [],
selectedItems: [],
} }
}, },
@ -93,6 +95,23 @@
this.itemActive = activeindex; this.itemActive = activeindex;
this.updateSubsetsInListHearing() this.updateSubsetsInListHearing()
console.log(this.listHearing, "this.itemActivethis.itemActive"); console.log(this.listHearing, "this.itemActivethis.itemActive");
const uniquePartIds = new Set();
// Loop through listHearing and collect unique part IDs
this.listHearing.forEach((paper) => {
paper.tests.forEach((test) => {
test.parts.forEach((part) => {
const hasSelectedQuesitem = part.modules.some((quesitem) => quesitem.subsets);
if (hasSelectedQuesitem) {
uniquePartIds.add(part.id);
}
});
});
});
// Convert the Set to an array and update selectedItems
this.selectedItems = Array.from(uniquePartIds);
}); });
}, },
Bages_addActive(TextIndex, id) { Bages_addActive(TextIndex, id) {
@ -100,14 +119,14 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
icon(id) { icon(id) {
this.image = !this.image; this.image = !this.image;
this.tk = id; if (this.image) {
if (this.image == false) { this.selectedItems = this.selectedItems.filter(item => item !== id);
this.tk = id; } else {
} else { this.selectedItems.push(id);
this.tk = null; }
} console.log(this.selectedItems,'this.selectedItemsthis.selectedItems');
}, },
checkboxChange(partitem, e) { checkboxChange(partitem, e) {
if (e.value) { if (e.value) {
this.listHearing.forEach((paper) => { this.listHearing.forEach((paper) => {

View File

@ -37,7 +37,7 @@
shape="circle"></u-checkbox> shape="circle"></u-checkbox>
</view> </view>
</view> </view>
<view class="partshow" v-if="tk==partitem.id"> <view class="partshow" v-if="selectedItems.includes(partitem.id)">
<view class="Part2" v-for="(quesitem,quesindex) in partitem.modules" :key="quesindex"> <view class="Part2" v-for="(quesitem,quesindex) in partitem.modules" :key="quesindex">
<view class="imaflex"> <view class="imaflex">
<view>{{quesitem.number}}{{quesitem.typeText}}</view> <view>{{quesitem.number}}{{quesitem.typeText}}</view>
@ -66,6 +66,7 @@
image: true, image: true,
tk: null, tk: null,
selectwrite: [], selectwrite: [],
selectedItems: [],
} }
}, },
@ -91,6 +92,24 @@
} }
this.itemActive = activeindex this.itemActive = activeindex
this.updateSubsetsInListHearing() this.updateSubsetsInListHearing()
const uniquePartIds = new Set();
// Loop through listHearing and collect unique part IDs
this.listHearing.forEach((paper) => {
paper.tests.forEach((test) => {
test.parts.forEach((part) => {
const hasSelectedQuesitem = part.modules.some((quesitem) => quesitem.subsets);
if (hasSelectedQuesitem) {
uniquePartIds.add(part.id);
}
});
});
});
// Convert the Set to an array and update selectedItems
this.selectedItems = Array.from(uniquePartIds);
console.log( this.selectedItems ,' this.selectedItems ');
}) })
}, },
// test // test
@ -99,15 +118,15 @@
this.$forceUpdate() this.$forceUpdate()
}, },
// //
icon(id) { icon(id) {
this.image = !this.image this.image = !this.image;
this.tk = id if (this.image) {
if (this.image == false) { this.selectedItems = this.selectedItems.filter(item => item !== id);
this.tk = id } else {
} else { this.selectedItems.push(id);
this.tk = null }
} console.log(this.selectedItems,'this.selectedItemsthis.selectedItems');
}, },
checkboxChange(partitem, e) { checkboxChange(partitem, e) {
if (e.value) { if (e.value) {
this.listHearing.forEach((paper) => { this.listHearing.forEach((paper) => {
@ -200,6 +219,8 @@
}); });
}); });
}); });
console.log(this.selectwrite,'selectwriteselectwrite');
}, },
// selectwrite // selectwrite

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff