|
@@ -47,16 +47,32 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const subjectCode: any[] = [];
|
|
|
- subjectList.value.forEach((subject: any) => {
|
|
|
- if (selectSubjectIds.value.includes(subject.id)) {
|
|
|
+ // subjectList.value.forEach((subject: any) => {
|
|
|
+ // if (selectSubjectIds.value.includes(subject.id)) {
|
|
|
+ // subjectCode.push({
|
|
|
+ // materialId: subject.id,
|
|
|
+ // coverImg: subjectImgs[subject.code] || subjectImgs.Panpipes,
|
|
|
+ // dataJson: null,
|
|
|
+ // title: subject.name,
|
|
|
+ // isCollect: false,
|
|
|
+ // isSelected: false,
|
|
|
+ // content: subject.code
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ selectSubjectIds.value.forEach((id: any) => {
|
|
|
+ const item = subjectList.value.find(
|
|
|
+ (subject: any) => subject.id === id
|
|
|
+ );
|
|
|
+ if (item) {
|
|
|
subjectCode.push({
|
|
|
- materialId: subject.id,
|
|
|
- coverImg: subjectImgs[subject.code] || subjectImgs.Panpipes,
|
|
|
+ materialId: item.id,
|
|
|
+ coverImg: subjectImgs[item.code] || subjectImgs.Panpipes,
|
|
|
dataJson: null,
|
|
|
- title: subject.name,
|
|
|
+ title: item.name,
|
|
|
isCollect: false,
|
|
|
isSelected: false,
|
|
|
- content: subject.code
|
|
|
+ content: item.code
|
|
|
});
|
|
|
}
|
|
|
});
|