From 42ab0736d10d35f54085d3f3dabe139651249012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 23 Jul 2026 18:05:17 +0800 Subject: [PATCH] =?UTF-8?q?school=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/css/ks_dashboard_ninja.scss | 3 +- .../static/src/js/dnNavBarExtend.js | 7 +- .../static/src/scss/common.scss | 346 +-------------- .../static/src/scss/header.scss | 402 +----------------- .../static/src/scss/overview.scss | 3 - 5 files changed, 22 insertions(+), 739 deletions(-) diff --git a/ks_dashboard_ninja/static/src/css/ks_dashboard_ninja.scss b/ks_dashboard_ninja/static/src/css/ks_dashboard_ninja.scss index b338670..ec445b3 100644 --- a/ks_dashboard_ninja/static/src/css/ks_dashboard_ninja.scss +++ b/ks_dashboard_ninja/static/src/css/ks_dashboard_ninja.scss @@ -460,7 +460,8 @@ margin-top:10px; content: "\f00c"; } -ul.nav li.dropdown:hover ul.dropdown-menu{ display: block; } +// 注释掉:全局规则会导致 Odoo 导航栏 dropdown 在非 dashboard 页面也被强制显示 +// ul.nav li.dropdown:hover ul.dropdown-menu{ display: block; } .df_selection_text{ display: block; diff --git a/ks_dashboard_ninja/static/src/js/dnNavBarExtend.js b/ks_dashboard_ninja/static/src/js/dnNavBarExtend.js index 60403d0..1b7bdda 100644 --- a/ks_dashboard_ninja/static/src/js/dnNavBarExtend.js +++ b/ks_dashboard_ninja/static/src/js/dnNavBarExtend.js @@ -56,7 +56,9 @@ const dnMenuIcons = { export function dnNavBarAddClasses(){ document.querySelector('body')?.classList.add('ks_body_class'); - document.querySelector('.o_main_navbar')?.classList.add('navbar', 'navbar-expand-md'); + // 注释掉:给 .o_main_navbar 添加 Bootstrap 的 navbar navbar-expand-md 类 + // 会覆盖 udoo_om_ux 主题的导航栏布局,导致样式错乱和搜索下拉框错位 + // document.querySelector('.o_main_navbar')?.classList.add('navbar', 'navbar-expand-md'); document.querySelector('.ks-mobile-burger-menu')?.classList.remove('d-none'); document.querySelector('.mobile-burger-menu-default')?.classList.add('d-none'); } @@ -65,7 +67,8 @@ export function dnNavBarAddClasses(){ export function dnNavBarRemoveClasses(){ document.querySelector('body')?.classList.remove('ks_body_class'); - document.querySelector('.o_main_navbar')?.classList.remove('navbar', 'navbar-expand-md'); + // 注释掉:对应上面的添加操作 + // document.querySelector('.o_main_navbar')?.classList.remove('navbar', 'navbar-expand-md'); document.querySelector('.ks-mobile-burger-menu')?.classList.add('d-none'); document.querySelector('.mobile-burger-menu-default')?.classList.remove('d-none'); } diff --git a/ks_dashboard_ninja/static/src/scss/common.scss b/ks_dashboard_ninja/static/src/scss/common.scss index 9ae04a1..79b3cdb 100644 --- a/ks_dashboard_ninja/static/src/scss/common.scss +++ b/ks_dashboard_ninja/static/src/scss/common.scss @@ -1,6 +1,7 @@ // @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); -* { +// 全局通配符重置限定在 dashboard 页面作用域内,避免影响其他页面(如 udoo_om_ux 主题的深色 dropdown) +body.ks_body_class * { margin: 0; padding: 0; box-sizing: border-box; @@ -64,207 +65,7 @@ body.ks_body_class { } } -// .ks_body_class .dash-dd, -.ks_body_class .o_menu_sections { - border-radius: 8px; - padding: 4px 12px; - &.show { - .o-dropdown--menu { - // transform: translateY(0px); - // top: 60px !important; - animation: fadeInSlideDown 0.4s ease forwards; - } - } - - &.header-img-dd { - .dropdown-toggle { - &::after { - display: none; - } - } - } - - &:hover { - background-color: $color-white; - } - - &.show { - .dropdown-toggle { - &::after { - transform: rotate(-180deg); - } - } - } - - @include max-768 { - padding: 16px 0 0 0; - } - - .dropdown-toggle { - // padding: 0 !important; - color: $color-black !important; - font-size: $font-16 !important; - border: none; - font-weight: $f-w-400 !important; - background: $color-white !important; - line-height: 20px !important; - - // &:hover { - // &+.o-dropdown--menu { - // display: block !important; - // } - // } - - @include max-992 { - font-size: $font-14 !important; - border-top: none !important; - } - - @include max-768 { - padding: 0 12px !important; - } - } - - .dropdown-toggle::after { - content: url(/ks_dashboard_ninja/static/images/dashboardOverview/down-arrow.svg); - display: inline-block; - margin-left: .4em; - vertical-align: 2px; - border: none !important; - transition: all 0.4s ease-in-out; - - @include max-768 { - display: none; - } - } - - .dropdown-toggle { - &.show { - &::after { - transform: rotate(-180deg); - } - } - } - -} - -.ks_body_class .ks-dropdown-menu, -.ks_body_class .o-dropdown--menu { - border-radius: 8px; - box-shadow: 0px 4px 12px 0px #00000040; - border: none !important; - width: max-content; - background-color: $color-white !important; -// overflow: hidden; - @include custom-scrollbar - @include max-768 { - box-shadow: none; - display: block !important; - width: 100%; - padding-bottom: 0 !important; - } - - .ks_dn_navbar_dd_item { - padding: 8px 16px; - font-size: $font-14; - font-weight: $f-w-400; - line-height: 16px; - text-align: left; - color: $color-paragraph; - - &.focus { - background-color: $color-white; - } - - @include max-768 { - line-height: 20px; - color: $color-black; - padding: 12px 8px 12px 28px; - } - - &:hover { - background-color: $color-FFF5F5 !important; - color: $color-6789C6 !important; - - .dash-dd-icons { - svg { - path { - fill: $color-6789C6; - } - } - - &.import-svg { - svg { - path { - stroke: $color-6789C6; - fill: none; - } - } - } - } - } - - &.active { - background-color: $color-FFF5F5; - color: $color-6789C6; - - .dash-dd-icons { - svg { - path { - fill: $color-6789C6; - } - } - - &.import-svg { - svg { - path { - stroke: $color-6789C6; - fill: none; - } - } - } - - - } - - // .dash-dd-icons { - // svg { - // path { - // fill: #04A9CC; - // } - // } - // } - - } - - .dash-dd-icons { - svg { - path { - fill: $color-4B5563; - } - } - - &.import-svg { - svg { - path { - stroke: $color-4B5563; - fill: none; - } - } - } - } - - .dash-dd-inbox { - svg { - path { - fill: #292D32; - } - } - - } - } -} // // .ks_body_class .modal-body .img-bg { @@ -744,21 +545,6 @@ body.ks_body_class { row-gap: 16px; } -.ks_body_class .o_dropdown_button { - visibility: visible !important; - - &::after { - content: url(/ks_dashboard_ninja/static/images/dashboardOverview/down-arrow.svg) !important; - display: inline-block !important; - margin-left: .255em; - vertical-align: 2px !important; - border: none !important; - transition: transform 0.4s ease-in-out; // Updated transition property - position: absolute; - top: 7px; - left: -21px; - } -} .border-none { border: none !important; @@ -1056,8 +842,8 @@ body.ks_body_class { border-radius: 8px; box-shadow: 0px 4px 12px 0px #00000040; border: none !important; - width: max-content; - background-color: $color-white !important; + // 注释掉:强制白色背景会覆盖 udoo_om_ux 主题的深色下拉框背景 + // background-color: $color-white !important; .dropdown-item { padding: 8px 16px !important; @@ -1073,11 +859,11 @@ body.ks_body_class { max-width: 240px; &.ui-state-active { - background-color: $color-white !important; + // background-color: $color-white !important; } &:hover { - background-color: $color-FFF5F5 !important; + // background-color: $color-FFF5F5 !important; } } } @@ -1364,31 +1150,6 @@ body.ks_body_class { // auto-complete-css-start -.ks_body_class .ui-autocomplete { - border-radius: 8px !important; - box-shadow: 0px 4px 12px 0px #00000040 !important; - border: none !important; - width: max-content !important; - - .ui-menu-item { - background-color: $color-white !important; - - >div { - background-color: $color-white !important; - - padding: 8px 16px; - font-size: 14px; - font-weight: 400; - line-height: 16px; - text-align: left; - color: #4b5563; - - &:hover { - background-color: #FFF5F5 !important; - } - } - } -} // chat-inbox @@ -1447,31 +1208,6 @@ body.ks_body_class { // auto-complete-css-start -.ks_body_class .ui-autocomplete { - border-radius: 8px !important; - box-shadow: 0px 4px 12px 0px #00000040 !important; - border: none !important; - width: max-content !important; - - .ui-menu-item { - background-color: $color-white !important; - - >div { - background-color: $color-white !important; - - padding: 8px 16px; - font-size: 14px; - font-weight: 400; - line-height: 16px; - text-align: left; - color: #4b5563; - - &:hover { - background-color: #FFF5F5 !important; - } - } - } -} // input-common @@ -1756,43 +1492,8 @@ body.ks_body_class { } -.ks_body_class { - .o_main_navbar { - .o-mail-DiscussSystray-class, - .o_user_menu, - .o_navbar_apps_menu, - .o-dropdown { - - .fa-clock-o, - .fa-comments, - .o_user_avatar, - .oi-apps { - display: none !important; - } - } - - .ks-comments-systray, - .ks-mail-systray, - .ks_user_avatar, - .o_navbar_apps_menu .ks-apps-menu-icon { - display: flex !important; - } - } -} - -.ks_body_class .o-dropdown--menu { - // transform: translateY(0px); - // top: 60px !important; - animation: fadeInSlideDown 0.4s ease forwards; -} - -// focus-class-overided -.ks_body_class .o-dropdown--menu .dropdown-item.focus, -.ks_body_class .o-dropdown--menu .dropdown-toggle.focus { - background-color: transparent; -} // company-name-css .encapsulated-dropdown { @@ -1957,23 +1658,6 @@ body.ks_body_class { } } -.ks_body_class .o_menu_sections .o-dropdown-item.o_nav_entry { - padding: 4px 12px !important; - color: $color-black !important; - font-size: $font-16 !important; - font-weight: $f-w-400 !important; - background: $color-white !important; - line-height: 20px !important; - - @include max-992 { - font-size: $font-14 !important; - border-top: none !important; - } - - @include max-768 { - padding: 0 12px !important; - } -} .w-fit-content { width: fit-content !important; @@ -2168,17 +1852,6 @@ body.ks_body_class { } } -.ks_body_class { - .o_menu_sections_more { - button { - background-color: $color-white !important; - - .fa-plus { - color: $color-black !important; - } - } - } -} .ks_body_class .encapsulated-kpi-tile { @@ -2806,13 +2479,6 @@ body.ks_body_class { border-radius: 16px 16px !important; } -.ks_body_class .o_searchview_facet_label { - span { - display: flex; - align-items: center; - justify-content: center; - } -} .ks_body_class .ks_chart_card_body { top: 65px !important; diff --git a/ks_dashboard_ninja/static/src/scss/header.scss b/ks_dashboard_ninja/static/src/scss/header.scss index 6e0f9e4..ebe6366 100644 --- a/ks_dashboard_ninja/static/src/scss/header.scss +++ b/ks_dashboard_ninja/static/src/scss/header.scss @@ -1,393 +1,9 @@ -.ks_body_class header { - position: sticky; - top: 0; - z-index: 10; - width: 100%; - - .o_menu_systray { - align-items: center; - } - - .o_menu_systray { - align-items: center; - } - - - .o_main_navbar { - padding: 0px 40px; - min-height: 66px; - - @include min-1600 { - min-height: 76px; - } - - /* 与主题模块冲突:ks_dashboard_ninja 将顶部导航栏设为白色,会覆盖主题深色模式下的背景色,故注释掉 (@image#1:Clipboard_Screenshot.png) */ - // background: white; - display: flex; - justify-content: space-between; - /* 与主题模块冲突:白色底部边框在深色模式下会显示为白线,故注释掉 (@image#1:Clipboard_Screenshot.png) */ - // border-bottom: 1px solid $color-E5E7EB !important; - - .o_menu_sections { - justify-content: center; - align-items: center; - - } - - // .ks-navbar-toggler { - // background-color: $color-D9F1FD; - // border-radius: 5px; - // width: 30px; - // display: flex; - // justify-content: center; - // align-items: center; - // - // &[aria-expanded="true"] { - // .hamburger { - // display: none; - // } - // - // .cross { - // display: block !important; - // } - // } - // - // &:focus { - // box-shadow: none; - // } - // } - - @include max-992 { - padding: 0px 20px; - } - - @include max-768 { - - .navbar-collapse { - position: fixed; - top: 62px; - right: -100%; - height: 100%; - width: 80%; - transition: right 0.3s ease-in-out; - background-color: $color-white; - - &.show { - right: 0; - } - } - } - - @include max-575 { - padding: 0 10px; - } - - .o_menu_brand { - /* 与主题模块冲突:强制黑色文字会覆盖主题深色模式下的导航文字颜色 (@image#1:Clipboard_Screenshot.png) */ - // color: $color-black; - font-size: $font-22; - font-weight: $f-w-400; - line-height: 30.8px; - - @include max-992 { - font-size: $font-18; - } - - @include max-575 { - font-size: $font-12; - line-height: 16px; - margin-left: 4px !important; - } - - } - - - - .user-mobile-details { - background-color: $color-bg-main; - padding: 16px 12px; - - h3 { - font-size: $font-16; - font-weight: $f-w-400; - color: $color-black; - margin-bottom: 0; - } - - .user-box { - background-color: $color-white; - border-radius: 5px; - border: 0.5px solid $color-E5E7EB; - font-size: $font-10; - font-weight: $f-w-400; - color: $color-black; - } - } - } -} - - -.ks_body_class .user-name { - font-size: $font-20; - font-weight: $f-w-500; - line-height: 32px; - min-width: 52px; - /* 与主题模块冲突:强制黑字浅蓝背景会覆盖主题深色模式下头像/用户名样式 (@image#1:Clipboard_Screenshot.png) */ - // color: $color-black; - border-radius: 10px; - // background-color: $color-D9F1FD; - padding: 7px 11px; - - @include max-768 { - border-radius: 5px; - border: 0.5px solid var(--Border-Color, #E5E7EB); - /* 与主题模块冲突:强制白色背景会覆盖主题深色模式下头像样式 (@image#1:Clipboard_Screenshot.png) */ - // background-color: $color-white; - font-size: $font-12; - font-weight: $f-w-400; - line-height: 14px; - width: 23px !important; - height: 23px; - min-width: 23px; - display: flex; - justify-content: center; - align-items: center; - padding: 7px 14px; - } -} - -.ks_body_class .o_burger_menu { - width: 69% !important; -} - -.ks_body_class .modal-backdrop.show { - opacity: 0.2; -} - -.ks_body_class .cross { - padding-left: 16px; - padding-right: 16px; -} - -// company-name-css -.ks_body_class .o_switch_company_menu { - border-radius: 50px; - border: 1px solid $color-E5E7EB; - justify-content: center; - align-items: center; - min-height: 44px; - padding: 8px 10px 8px 10px !important; - display: flex !important; - - @include max-768 { - display: none !important; - } - - .dropdown-toggle::after { - content: url(/ks_dashboard_ninja/static/images/dashboardOverview/down-arrow.svg); - display: inline-block; - margin-left: .4em; - vertical-align: 2px; - border: none !important; - transition: all 0.4s ease-in-out; - line-height: normal !important; - - @include max-768 { - display: none; - } - } - - .dropdown-toggle { - &.show { - &::after { - transform: rotate(-180deg); - } - } - } - - - .dropdown-toggle { - height: fit-content; - - - .oe_topbar_name { - font-size: $font-12; - height: 100%; - padding-right: 6px; - line-height: normal !important; - } - } - - .ks-dropdown-menu { - .border-end { - border: none !important; - } - - } - - - - .fa-check-square { - color: $color-E7495E !important; - } -} - -.ks_body_class .o_debug_manager { - button { - /* 与主题模块冲突:强制深色文字会覆盖主题深色模式下的图标/文字颜色 (@image#1:Clipboard_Screenshot.png) */ - // color: #241C1D !important; - } -} - -.ks_body_class .oe_topbar_name { - /* 与主题模块冲突:强制深色文字会覆盖主题深色模式下的顶部用户名颜色 (@image#1:Clipboard_Screenshot.png) */ - // color: #241C1D !important; -} - -.ks_body_class .o_switch_company_menu_dropdown { - .fa-check-square { - color: $color-E7495E !important; - } - - .o_switch_company_item { - height: auto !important; - - &.focus>* { - background-color: transparent; - } - - .border-end { - border: none !important; - } - - } -} - - -.ks_body_class { - .screen-info { - background-color: $color-nav-bg; - height: 56px; - display: flex; - align-items: center; - padding: 0 40px; - - @include max-992 { - padding: 0 20px; - } - - @include max-575 { - padding: 0 16px; - } - - // .ks_dashboard_top_menu-new {} - - .user-template-title { - .ks_body_class .ks_am_element.dash-dd-2 { - font-size: $font-16; - color: $color-black; - font-weight: $f-w-400; - line-height: 20px; - } - - span { - position: relative; - } - - // &::after { - // content: ''; - // display: block; - // position: absolute; - // height: 20px; - // width: 20px; - // right: 2px; - // background-image: url(../../images/icons/down-arrow.svg); - // background-repeat: no-repeat; - // top: 43%; - // transition: all 350ms ease-in-out; - // } - } - } -} -.custom-dash-collapse{ - .o_input{ - border: none; - } - .dropdown-toggle.d-flex.encapsulated-link{ - overflow: auto; - max-height: 75px; - } - .dash-default-btn{ - svg{ - fill: transparent !important; - } - } - .table-dlt-btn{ - &:hover{ - border-color: #E7495E !important; - svg{ - stroke: #E7495E !important; - } - } - } - .o-dropdown{ - .ks-nav-link{ - button{ - min-width: 150px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - text-align: left; - } - } - } - - .ks-nav-link{ - button{ - background-color: transparent; - border: none; - } - } - .dash-dd-2{ - .selcted-opt.opted{ - background-color: #F5F8FB; - padding-right: 22px; - } -.dropdown-toggle{ - &:after{ - display: none; - } - } - } - - .encapsulated-cross { - position: absolute; - top: 2px; - } -} - - -@media only screen and (max-width: 1600px) { - .custom-dash-collapse{ - .o-dropdown{ - .ks-nav-link{ - button{ - min-width: 80px; - - } - } -} -} -} -@media only screen and (max-width: 1600px) { - .custom-dash-collapse{ - .o-dropdown{ - .ks-nav-link{ - button{ - min-width: 60px; - - } - } -} -} -} \ No newline at end of file +// ============================================================= +// ks_dashboard_ninja / static / src / scss / header.scss +// ------------------------------------------------------------- +// 该文件原本定义了顶部导航栏(.o_main_navbar)和头部相关全局样式, +// 与主题模块 udoo_om_ux 严重冲突,导致顶部菜单按钮、搜索框、 +// 下拉框、用户头像样式错乱。 +// +// 已清空,相关样式由 udoo_om_ux 主题模块统一控制。 +// ============================================================= \ No newline at end of file diff --git a/ks_dashboard_ninja/static/src/scss/overview.scss b/ks_dashboard_ninja/static/src/scss/overview.scss index 6e0dbe0..8dbc0fa 100644 --- a/ks_dashboard_ninja/static/src/scss/overview.scss +++ b/ks_dashboard_ninja/static/src/scss/overview.scss @@ -471,6 +471,3 @@ opacity: 0.5; } -.ks_body_class .o_main_navbar .badge { - background-color: $color-E7495E; -} \ No newline at end of file