//周排序
const handleSort = (arr) => {
arr.sort(function (a, b) {
if (a.whatDay === b.whatDay) {
return b.whatDay - a.whatDay;
} else {
return a.whatDay - b.whatDay;
}
});
return arr;
};
//排序
const handleSort = (dataArray, property) => {
return dataArray.sort((a, b) => {
return b.dataNum[property] - a.dataNum[property];
});
}
//默认数据和返回数据去重,取返回数据
const _week = JSON.parse(JSON.stringify(defaultWeekArr));
let arr = res.result?.timeConfigDtoList || [];
let data = handleSort([
...new Set([
...arr,
..._week.filter((item) => !arr.some((a) => a.whatDay === item.whatDay)),
]),
]);
默认数据和返回数据去重,取返回数据,,,,周排序
最新推荐文章于 2024-08-29 22:25:44 发布