Skip to content

Commit

Permalink
feat: 附件页的page和size添加到url参数里 (#697)
Browse files Browse the repository at this point in the history
* feat: 附件页的page和size添加到url参数里

* optimize: episodes sort by seq in SubjectDetails.vue
  • Loading branch information
chivehao authored Oct 15, 2024
1 parent ecddab0 commit b2448e2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
## 新特性

- 管理控制台的关于页面右上角添加个复制环境信息的按钮 #691
- 附件页的page和size添加到url参数里

## 优化

- 条目详情页剧集序号排序

## 问题修复

Expand Down
1 change: 1 addition & 0 deletions console/src/modules/content/subject/SubjectDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const fetchSubjectById = async () => {
deleteMatchingSubjectButtonDisable.value = false;
}
if (subject.value.episodes) {
subject.value.episodes = subject.value.episodes.sort((a, b) => (a.sequence??0) - (b.sequence??0));
loadEpisodeGroupLabels();
}
}
Expand Down
16 changes: 16 additions & 0 deletions console/src/modules/content/subject/Subjects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const fetchSubjectByRouterQuery = () => {
| 'OTHER';
}
if (route.query.page !== undefined) {
findSubjectsCondition.value.page = route.query.page as unknown as number;
}
if (route.query.size !== undefined) {
findSubjectsCondition.value.size = route.query.size as unknown as number;
}
// console.log('findSubjectsCondition', findSubjectsCondition.value);
fetchSubjects();
};
Expand Down Expand Up @@ -120,6 +128,14 @@ watch(findSubjectsCondition.value, () => {
if (type !== route.query.type) {
query.type = type;
}
const page = findSubjectsCondition.value.page;
if (page !== query.page) {
query.page = page;
}
const size = findSubjectsCondition.value.size;
if (size !== query.size) {
query.size = size;
}
router.push({ path: route.path, query });
});
Expand Down

0 comments on commit b2448e2

Please sign in to comment.