优化代码
This commit is contained in:
parent
c8b1ccc1da
commit
2769cd98c2
|
@ -101,7 +101,7 @@ export function sortWeeks(weeks) {
|
|||
//将weeks清空并将排序好的值赋给weeks
|
||||
const weeksData = []
|
||||
if (isContinuityNum(_weeks.map((item) => item.id)) && _weeks.length > 1) {
|
||||
weeksData.push(`${_weeks[0].name} 至 ${_weeks[_weeks.length - 1].name}`)
|
||||
weeksData.push(`${_weeks[0].name} 至 ${_weeks.slice(-1)[0].name}`)
|
||||
} else {
|
||||
for (var i = 0; i < _weeks.length; i++) {
|
||||
weeksData.push(_weeks[i].name)
|
||||
|
|
Loading…
Reference in New Issue