-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修复默认attachment翻页无效问题 #518
base: master
Are you sure you want to change the base?
修复默认attachment翻页无效问题 #518
Conversation
📝 Walkthrough变更概览步骤说明本次变更主要涉及两个文件: 变更
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
web/src/utils/http.ts (1)
77-84
: 建议避免在箭头函数中直接赋值,以提升可读性并消除 lint 告警目前
setTimeout(() => isLogout = false, 5000)
会触发 Biome 工具的警告。可通过在回调中使用花括号来赋值,增强可读性,同时遵循无赋值表达式的最佳实践:- setTimeout(() => isLogout = false, 5000) + setTimeout(() => { + isLogout = false + }, 5000)🧰 Tools
🪛 Biome (1.9.4)
[error] 81-81: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web/src/components/ma-resource-picker/panel.vue
(3 hunks)web/src/utils/http.ts
(2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
web/src/utils/http.ts
[error] 81-81: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.
(lint/suspicious/noAssignInExpressions)
🔇 Additional comments (4)
web/src/utils/http.ts (1)
55-56
: 在全局作用域中引入共享状态需谨慎使用
isLogout
为全局变量,若在多标签或并发场景下使用,需要注意并发访问及同步问题,避免出现不一致或重复登出。建议在登出流程完成后适时进行重置或基于更细粒度的状态管理方案。web/src/components/ma-resource-picker/panel.vue (3)
135-140
: 结构化参数处理便于扩展通过解构
params
获取pageNo
、pageSize
并合并到queryParams
,逻辑清晰且便于后期拓展其他查询参数。实现良好。
371-375
: 分页事件处理函数设计合理引入
handleChangePage
函数集中管理页码与页面大小的变更,并进行数据刷新,符合单一职责原则。
487-487
: 分页组件参数映射一致将
page-size
同步绑定到queryParams.pageSize
,与其他参数命名对齐,便于维护。
@@ -362,7 +368,11 @@ function executeContextmenu(e: MouseEvent, resource: Resource) { | |||
], | |||
}) | |||
} | |||
|
|||
function handleChangePage(currentPage: number, pageSize: number) { | |||
queryParams.value.pageNo = currentPage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pageNo 是什么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前端代码之前翻页标记就是pageNo 我怕直接改了影响其他用调用就在只在请求这里替换了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
所有的翻页统一都用 page(当前页码) page_size (每页页数) 之前是 pageNo 那应该是写错了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那等周末X.Mo提吧
Summary by CodeRabbit
新功能
Bug 修复
性能优化