Skip to content

Commit

Permalink
Merge pull request #240 from mgz0227/dev_2008
Browse files Browse the repository at this point in the history
书架书单分组、书籍、管理页面均可以操作书单分组、编辑、新增、书单中的书籍增删改操作
  • Loading branch information
MaoXiaoone authored Aug 3, 2024
2 parents cd4f08b + 58b63d2 commit 42cf726
Show file tree
Hide file tree
Showing 17 changed files with 310 additions and 939 deletions.
13 changes: 10 additions & 3 deletions entry/src/main/ets/common/utils/WorksListsUtils.ets
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@ export class WorksListsUtils{
worksListsDao.deleteWorks(ids)
}
//获取书单中的bookId
getBookIds(worksBookList:WorksBookList[]){
return worksBookList
getBookIds(worksBookList: WorksBookList[]): number[] {
const bookIds = worksBookList
.filter(item => item !== undefined) // 过滤掉 undefined 的 item
.map(item => item.bookId)
.filter(bookId => bookId !== undefined); // 过滤掉 undefined 的 bookId
.filter(bookId => bookId !== undefined);

// 如果 bookIds 长度为 0,直接返回空数组
if (bookIds.length === 0) {
return [];
}

return bookIds.toString().split(',').map(Number);
}
}
const worksListsUtils = new WorksListsUtils()
Expand Down
172 changes: 0 additions & 172 deletions entry/src/main/ets/pages/view/bookShelf/BookInfo.ets

This file was deleted.

136 changes: 0 additions & 136 deletions entry/src/main/ets/pages/view/bookShelf/BookInfoGrid.ets

This file was deleted.

Loading

0 comments on commit 42cf726

Please sign in to comment.