Repository navigation
perf: sidebar #7922
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
perf: sidebar #7922
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,6 @@ const getSystemMenuIcon = (systemMenuItem: LayoutMenuItem) => | |
| :collapse-transition="false" | ||
| :default-active="systemActiveMenuPath" | ||
| router | ||
| :persistent="false" | ||
| > | ||
| <template v-for="item in systemMenuItems" :key="item.name"> | ||
| <template v-if="item.permission ? item.permission() : true"> | ||
|
|
@@ -129,7 +128,6 @@ const getSystemMenuIcon = (systemMenuItem: LayoutMenuItem) => | |
|
|
||
| &__title { | ||
| border-radius: var(--el-border-radius-base); | ||
| color: var(--el-text-color-primary); | ||
| height: auto; | ||
| line-height: 18px; | ||
| padding: 11px calc(var(--spacing) * 2) !important; | ||
|
|
@@ -138,6 +136,12 @@ const getSystemMenuIcon = (systemMenuItem: LayoutMenuItem) => | |
| background-color: var(--mk-N900-transparent-10); | ||
| } | ||
| } | ||
| &.is-active { | ||
| .el-sub-menu__title { | ||
| color: var(--el-color-primary); | ||
| font-weight: 500; | ||
| } | ||
| } | ||
|
|
||
| .el-icon { | ||
| margin-right: calc(var(--spacing) * 2); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are my observations on the diff: 1. Removal of
2. Color variable removal from
3. New
Minor suggestions
Summary: The most likely real bug is selector scoping ( |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ export const systemRoutes: RouteRecordRaw = { | |
| meta: { | ||
| title: '身份与权限', | ||
| icon: 'icon_account_outlined', | ||
| activeIcon: 'icon_account_filled', | ||
| order: 10, | ||
| permission: () => { | ||
| return ( | ||
|
|
@@ -148,6 +149,8 @@ export const systemRoutes: RouteRecordRaw = { | |
| meta: { | ||
| title: '资源管理', | ||
| icon: 'icon_project-settings-outlined', | ||
| activeIcon: 'icon_project-settings-filled', | ||
|
|
||
| order: 20, | ||
| resourceScope: 'system-resource', | ||
| permission: () => { | ||
|
|
@@ -190,6 +193,7 @@ export const systemRoutes: RouteRecordRaw = { | |
| meta: { | ||
| title: '共享资源', | ||
| icon: 'icon_folder-share_outlined', | ||
| activeIcon: 'icon_folder-share_filled', | ||
| order: 30, | ||
| resourceScope: 'system-shared', | ||
| permission: () => { | ||
|
|
@@ -228,6 +232,7 @@ export const systemRoutes: RouteRecordRaw = { | |
| meta: { | ||
| title: '对话端管理', | ||
| icon: 'icon_contacts_outlined', | ||
| activeIcon: 'icon_contacts_filled', | ||
| order: 40, | ||
| permission: () => { | ||
| return perm.system.chatUser.read() || perm.system.chatUserGroup.read() || perm.system.chatAuth.read() || perm.system.portal.read() | ||
|
|
@@ -268,6 +273,7 @@ export const systemRoutes: RouteRecordRaw = { | |
| meta: { | ||
| title: '系统设置', | ||
| icon: 'icon_setting', | ||
| activeIcon: 'icon_setting_filled', | ||
| order: 50, | ||
| permission: () => { | ||
| return perm.system.loginAuth.read() || perm.system.appearance.read() || perm.system.email.read() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Irregularities / Potential issues
Summary: main concrete issue is the stray blank line; everything else is consistency/typing/maintainability advice. |
||
|
|
||
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.
Here are my observations on this diff:
1. Bug:
resizableis applied to all right-fixed columns (behavioral change)This unconditionally disables resizing for every right-fixed column, not just the operations/action column as the new comment ("右侧固定操作列禁用调宽") implies. If a caller has a legitimate right-fixed data column, it loses resizability without consent.
Suggestions:
disableResize/isActionColumnattribute on the caller's column) rather than inferring it fromfixed === 'right'.fixedcould be a reactive expression; ifcolumn.props.fixedisundefinedat normalize time due to binding order, you may miss the case. Consider handling after resolution or via a slot-render check.2.
cloneVNodemerge semantics – resizable prop typeresizableasBoolean.{ resizable: false }is fine, but note that spreading{}in the non-matching branch means the key is simply absent — good.resizablethe caller already passed. If a caller setsresizable: trueon a right-fixed column, your code wins. Confirm that's intended; otherwise use a fallback (resizable: column.props?.resizable ?? false).3.
allow-drag-last-column="false"— likely wrong valueIn Vue templates, a static attribute
"false"is passed as the string"false", which is truthy. For a boolean prop this typically coerces totrue(or at least does not meanfalse) depending on casting. You want:otherwise the last (operations) column may still be draggable.
4. Comment vs. code mismatch
The updated doc comment now covers two unrelated concerns: "统一列配置", "右侧固定操作列禁用调宽", and "表头排序交给调用方". The function actually also does slot wrapping for sortable columns. Consider splitting these responsibilities (one helper for sortable normalization, one for fixed/resizable), which improves readability and testability.
5. Potential interaction between
sortableandresizablesortable='custom'combined withresizable:falseon the action column is fine, but ensure the header drag-to-sort and column-resize pointer handlers (@pointerdown.capture="handlePointerDown") don't conflict once resize is disabled on a specific column. Worth a manual sanity test.6. Minor: inline ternary object spread
Slightly verbose. Equivalent and clearer:
This avoids allocating throwaway
{}objects and reads linearly.7. Missing test coverage implication
The diff adds a silent global behavior (fixed-right → non-resizable). Recommend a unit test asserting:
resizable,allow-drag-last-columnis actuallyfalseat runtime (props unit test).Summary of actionable fixes
allow-drag-last-column="false"with:allow-drag-last-column="false".resizable:falsefor all right-fixed columns — make it opt-in via a dedicated prop or documented convention.