Commit dbe6c07e authored by ammeto's avatar ammeto

fix:课表课程展示问题

parent c34dc4b4
...@@ -134,39 +134,42 @@ export default { ...@@ -134,39 +134,42 @@ export default {
// }); // });
for (let i = 0, Length = weekdayschedules.length; i < Length; i++) { for (let i = 0, Length = weekdayschedules.length; i < Length; i++) {
const current = i; const current = i;
let next = i + 1; // let next = i + 1;
if (next == weekdayschedules.length) { // if (next == weekdayschedules.length) {
return; // return;
} // }
while (next < weekdayschedules.length) { weekdayschedules[current].relativeSchedules.sort((a, b) => {
const relativeSchedules1 = weekdayschedules[current].relativeSchedules; return a - b;
const relativeSchedules2 = weekdayschedules[next].relativeSchedules; });
let flaga = false; // while (next < weekdayschedules.length) {
relativeSchedules1.forEach((ele) => { // const relativeSchedules1 = weekdayschedules[current].relativeSchedules;
if (relativeSchedules2.indexOf(ele) != -1) { // const relativeSchedules2 = weekdayschedules[next].relativeSchedules;
flaga = true; // let flaga = false;
} // relativeSchedules1.forEach((ele) => {
}); // if (relativeSchedules2.indexOf(ele) != -1) {
if (flaga) { // flaga = true;
relativeSchedules2.forEach((ele) => { // }
if (relativeSchedules1.indexOf(ele) == -1) { // });
relativeSchedules1.push(ele); // if (flaga) {
relativeSchedules1.sort((a, b) => { // relativeSchedules2.forEach((ele) => {
return a - b; // if (relativeSchedules1.indexOf(ele) == -1) {
}); // relativeSchedules1.push(ele);
} // relativeSchedules1.sort((a, b) => {
}); // return a - b;
relativeSchedules1.forEach((ele) => { // });
if (relativeSchedules2.indexOf(ele) == -1) { // }
relativeSchedules2.push(ele); // });
relativeSchedules2.sort((a, b) => { // relativeSchedules1.forEach((ele) => {
return a - b; // if (relativeSchedules2.indexOf(ele) == -1) {
}); // relativeSchedules2.push(ele);
} // relativeSchedules2.sort((a, b) => {
}); // return a - b;
} // });
next++; // }
} // });
// }
// next++;
// }
} }
}); });
yield put({ yield put({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment