From ec44eb99b7d5f742214016a161bd5e5e5726981c Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Fri, 23 Jan 2026 12:59:41 +0800 Subject: [PATCH 1/2] mobile --- .../static/src/js/status_bar_buttons.js | 109 +++--------------- .../static/src/scss/status_bar_buttons.scss | 89 ++------------ 2 files changed, 20 insertions(+), 178 deletions(-) diff --git a/k_ry_mobile_form/static/src/js/status_bar_buttons.js b/k_ry_mobile_form/static/src/js/status_bar_buttons.js index e87a68bcc..7941b3edf 100644 --- a/k_ry_mobile_form/static/src/js/status_bar_buttons.js +++ b/k_ry_mobile_form/static/src/js/status_bar_buttons.js @@ -42,28 +42,10 @@ patch(StatusBarButtons, { container.style.setProperty('left', '0', 'important'); container.style.setProperty('right', '0', 'important'); container.style.setProperty('z-index', '9999', 'important'); - // 强制设置背景色可见 - container.style.setProperty('background-color', '#ffffff', 'important'); - container.style.setProperty('background', '#ffffff', 'important'); - container.style.setProperty('min-height', '60px', 'important'); - container.style.setProperty('width', '100%', 'important'); - - // 同时修复容器内的按钮 - const buttons = container.querySelectorAll('button, a.btn, .btn, a[role="button"], .o_statusbar_buttons > * > button, .o_statusbar_buttons > * > a'); - buttons.forEach(button => { - button.style.setProperty('visibility', 'visible', 'important'); - button.style.setProperty('opacity', '1', 'important'); - button.style.setProperty('display', 'inline-block', 'important'); - button.style.setProperty('font-size', '14px', 'important'); - // 如果按钮没有可见的背景色,强制设置 - const computedStyle = getComputedStyle(button); - const bgColor = computedStyle.backgroundColor; - if (bgColor === 'transparent' || bgColor === 'rgba(0, 0, 0, 0)' || - (bgColor === 'rgb(255, 255, 255)' && computedStyle.color === 'rgb(255, 255, 255)')) { - button.style.setProperty('background-color', '#007bff', 'important'); - button.style.setProperty('color', '#ffffff', 'important'); - } - }); + // 确保背景色可见 + if (!container.style.backgroundColor) { + container.style.setProperty('background-color', '#ffffff', 'important'); + } }); // 隐藏桌面端按钮 @@ -110,15 +92,14 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') { container.style.setProperty('left', '0', 'important'); container.style.setProperty('right', '0', 'important'); container.style.setProperty('z-index', '9999', 'important'); - // 强制设置背景色可见 - container.style.setProperty('background-color', '#ffffff', 'important'); - container.style.setProperty('background', '#ffffff', 'important'); - container.style.setProperty('min-height', '60px', 'important'); - container.style.setProperty('width', '100%', 'important'); + // 确保背景色可见 + if (!container.style.backgroundColor || container.style.backgroundColor === 'transparent') { + container.style.setProperty('background-color', '#ffffff', 'important'); + } } - // 修复按钮的交互性和可见性 - const buttons = container.querySelectorAll('button, a.btn, .btn, a[role="button"], .o_statusbar_buttons > * > button, .o_statusbar_buttons > * > a'); + // 修复按钮的交互性 + const buttons = container.querySelectorAll('button, a.btn, .btn, a[role="button"], .o_statusbar_buttons > * > button'); buttons.forEach(button => { // 使用 setProperty 强制设置样式 button.style.setProperty('pointer-events', 'auto', 'important'); @@ -127,73 +108,9 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') { button.style.setProperty('visibility', 'visible', 'important'); button.style.setProperty('opacity', '1', 'important'); button.style.setProperty('display', 'inline-block', 'important'); - // 确保按钮有最小高度和宽度 - button.style.setProperty('min-height', '44px', 'important'); - button.style.setProperty('min-width', '60px', 'important'); - // 强制设置字体大小,确保文字可见 - button.style.setProperty('font-size', '14px', 'important'); - button.style.setProperty('font-weight', '500', 'important'); - button.style.setProperty('line-height', '1.5', 'important'); - // 强制设置内边距 - button.style.setProperty('padding', '8px 16px', 'important'); - // 确保文字对齐 - button.style.setProperty('text-align', 'center', 'important'); - button.style.setProperty('text-decoration', 'none', 'important'); - - // 检查按钮是否有背景色和文字颜色 - const computedStyle = getComputedStyle(button); - const bgColor = computedStyle.backgroundColor; - const textColor = computedStyle.color; - - // 如果背景色是透明或白色,且文字颜色也是白色或透明,强制设置颜色 - const isTransparent = bgColor === 'transparent' || bgColor === 'rgba(0, 0, 0, 0)'; - const isWhiteBg = bgColor === 'rgb(255, 255, 255)' || bgColor === '#ffffff' || bgColor === '#fff'; - const isWhiteText = textColor === 'rgb(255, 255, 255)' || textColor === '#ffffff' || textColor === '#fff'; - const isTransparentText = textColor === 'transparent' || textColor === 'rgba(0, 0, 0, 0)'; - - // 如果按钮不可见(白色背景+白色文字,或透明背景),强制设置颜色 - if (isTransparent || (isWhiteBg && (isWhiteText || isTransparentText))) { - // 根据按钮类型设置颜色 - const hasPrimary = button.classList.contains('btn-primary') || button.classList.contains('o_statusbar_status'); - const hasSecondary = button.classList.contains('btn-secondary'); - const hasSuccess = button.classList.contains('btn-success'); - const hasDanger = button.classList.contains('btn-danger'); - const hasWarning = button.classList.contains('btn-warning'); - const hasInfo = button.classList.contains('btn-info'); - - if (hasPrimary || hasSuccess) { - button.style.setProperty('background-color', '#007bff', 'important'); - button.style.setProperty('color', '#ffffff', 'important'); - button.style.setProperty('border-color', '#0056b3', 'important'); - } else if (hasSecondary) { - button.style.setProperty('background-color', '#6c757d', 'important'); - button.style.setProperty('color', '#ffffff', 'important'); - button.style.setProperty('border-color', '#545b62', 'important'); - } else if (hasDanger) { - button.style.setProperty('background-color', '#dc3545', 'important'); - button.style.setProperty('color', '#ffffff', 'important'); - button.style.setProperty('border-color', '#c82333', 'important'); - } else if (hasWarning) { - button.style.setProperty('background-color', '#ffc107', 'important'); - button.style.setProperty('color', '#212529', 'important'); - button.style.setProperty('border-color', '#e0a800', 'important'); - } else if (hasInfo) { - button.style.setProperty('background-color', '#17a2b8', 'important'); - button.style.setProperty('color', '#ffffff', 'important'); - button.style.setProperty('border-color', '#117a8b', 'important'); - } else { - // 默认蓝色按钮 - button.style.setProperty('background-color', '#007bff', 'important'); - button.style.setProperty('color', '#ffffff', 'important'); - button.style.setProperty('border-color', '#0056b3', 'important'); - } - - // 确保有边框 - if (!computedStyle.border || computedStyle.border === '0px none rgb(0, 0, 0)') { - button.style.setProperty('border', '1px solid', 'important'); - } - // 确保有圆角 - button.style.setProperty('border-radius', '4px', 'important'); + // 确保按钮有最小高度 + if (!button.style.minHeight) { + button.style.setProperty('min-height', '44px', 'important'); } }); }); diff --git a/k_ry_mobile_form/static/src/scss/status_bar_buttons.scss b/k_ry_mobile_form/static/src/scss/status_bar_buttons.scss index 8104c2d73..63b6c4850 100644 --- a/k_ry_mobile_form/static/src/scss/status_bar_buttons.scss +++ b/k_ry_mobile_form/static/src/scss/status_bar_buttons.scss @@ -8,11 +8,10 @@ html body .o_statusbar_buttons_mobile_fixed { left: 0 !important; right: 0 !important; z-index: 9999 !important; // 提高z-index,确保在最上层 - // 强制设置背景色,确保容器可见 - background-color: #ffffff !important; - background: #ffffff !important; - border-top: 1px solid #dee2e6 !important; - box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15) !important; + background-color: $o-view-background-color !important; + background: $o-view-background-color !important; // 双重保险 + border-top: 1px solid $border-color !important; + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1) !important; padding: map-get($spacers, 2) map-get($spacers, 3) !important; // 为底部悬浮栏预留空间,避免内容被遮挡(支持 iOS safe area) padding-bottom: calc(#{map-get($spacers, 2)} + env(safe-area-inset-bottom, 0px)) !important; @@ -30,11 +29,6 @@ html body .o_statusbar_buttons_mobile_fixed { overflow: visible !important; clip: auto !important; clip-path: none !important; - // 确保容器有最小高度 - min-height: 60px !important; - // 确保容器宽度 - width: 100% !important; - max-width: 100% !important; } .o_statusbar_buttons { @@ -68,7 +62,6 @@ html body .o_statusbar_buttons_mobile_fixed { text-overflow: ellipsis !important; // 确保按钮有足够的点击区域 min-height: 44px !important; - height: auto !important; // iOS Safari 修复:确保按钮可点击 cursor: pointer !important; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important; @@ -89,77 +82,9 @@ html body .o_statusbar_buttons_mobile_fixed { display: inline-block !important; visibility: visible !important; opacity: 1 !important; - // 强制设置按钮颜色和背景,确保可见性 - background-color: #007bff !important; - background: #007bff !important; - color: #ffffff !important; - // 确保文字大小可见 - font-size: 14px !important; - font-weight: 500 !important; - line-height: 1.5 !important; - // 添加边框和圆角,增强可见性 - border: 1px solid #0056b3 !important; - border-radius: 4px !important; - // 确保内边距 - padding: 8px 16px !important; - // 确保按钮内容可见 - text-align: center !important; - text-decoration: none !important; - } - - // 特殊处理不同类型的按钮,确保都有可见的样式 - > button.btn-primary, - > a.btn-primary, - > .btn-primary { - background-color: #007bff !important; - background: #007bff !important; - color: #ffffff !important; - border-color: #0056b3 !important; - } - - > button.btn-secondary, - > a.btn-secondary, - > .btn-secondary { - background-color: #6c757d !important; - background: #6c757d !important; - color: #ffffff !important; - border-color: #545b62 !important; - } - - > button.btn-success, - > a.btn-success, - > .btn-success { - background-color: #28a745 !important; - background: #28a745 !important; - color: #ffffff !important; - border-color: #1e7e34 !important; - } - - > button.btn-danger, - > a.btn-danger, - > .btn-danger { - background-color: #dc3545 !important; - background: #dc3545 !important; - color: #ffffff !important; - border-color: #c82333 !important; - } - - > button.btn-warning, - > a.btn-warning, - > .btn-warning { - background-color: #ffc107 !important; - background: #ffc107 !important; - color: #212529 !important; - border-color: #e0a800 !important; - } - - > button.btn-info, - > a.btn-info, - > .btn-info { - background-color: #17a2b8 !important; - background: #17a2b8 !important; - color: #ffffff !important; - border-color: #117a8b !important; + // 确保按钮背景和文字可见 + background-color: inherit !important; + color: inherit !important; } } } From a523e4d6f21b0888b3ddfd6e6cae18c6d09aaed5 Mon Sep 17 00:00:00 2001 From: sunjie Date: Fri, 23 Jan 2026 15:04:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=20=E6=8A=A5=E8=A1=A8=E5=88=86=E7=BB=84?= =?UTF-8?q?=202.=20=E8=8F=9C=E5=8D=95=E5=B0=8F=E7=BA=A2=E7=82=B9:=20?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=B8=8A=E6=9C=89=E5=87=BD=E6=95=B0=E5=80=BC?= =?UTF-8?q?,=20=E5=88=99=E5=88=A4=E6=96=AD=E6=A8=A1=E5=9E=8B=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=9C=89=E8=AF=A5=E6=96=B9=E6=B3=95,=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E6=89=A7=E8=A1=8C=E8=8F=9C=E5=8D=95=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=96=B9=E6=B3=95.=20=E4=BD=9C=E7=94=A8:=20?= =?UTF-8?q?=E5=A4=9A=E8=8F=9C=E5=8D=95=E6=83=85=E5=86=B5,=20=E5=8C=BA?= =?UTF-8?q?=E5=88=86.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sun_badge_menu/models/ir_ui_menu.py | 9 +++++++-- sun_badge_menu/views/ir_ui_menu.xml | 1 + .../src/components/yuthon_report/yuthon_report.js | 1 + .../components/yuthon_report/yuthon_report.xml | 15 ++++++++++++--- yuthon_report/views/att_report_view.xml | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sun_badge_menu/models/ir_ui_menu.py b/sun_badge_menu/models/ir_ui_menu.py index 9e64494b4..b8ef731a0 100644 --- a/sun_badge_menu/models/ir_ui_menu.py +++ b/sun_badge_menu/models/ir_ui_menu.py @@ -35,6 +35,8 @@ class IrUiMenu(models.Model): is_phone = fields.Boolean(string="手机菜单",default=False) is_pc = fields.Boolean(string="PC菜单",default=True) + badge_function = fields.Char(string="菜单角标计算函数") + @api.model @tools.ormcache_context('self._uid', 'debug', keys=('lang',)) def load_menus(self, debug): @@ -43,7 +45,7 @@ class IrUiMenu(models.Model): :return: the menu root :rtype: dict('children': menu_nodes) """ - fields = ['name', 'sequence', 'parent_id', 'action', 'web_icon','show_badge_count'] + fields = ['name', 'sequence', 'parent_id', 'action', 'web_icon','show_badge_count','badge_function'] menu_roots = self.get_user_roots() menu_roots_data = menu_roots.read(fields) if menu_roots else [] menu_root = { @@ -166,7 +168,10 @@ class IrUiMenu(models.Model): # 不仅仅是 form 表单,获取 model res_model = action_record.res_model if res_model in self.env: - if hasattr(self.env[res_model], 'get_menu_badge_count'): + # 先检查 menu['badge_function'] + if 'badge_function' in menu and menu['badge_function'] and hasattr(self.env[res_model], menu['badge_function']): + badge_count = getattr(self.env[res_model], menu['badge_function'])(action_record) + elif hasattr(self.env[res_model], 'get_menu_badge_count'): badge_count = self.env[res_model].get_menu_badge_count(action_record) elif hasattr(self.env[res_model], 'get_no_read_count'): badge_count = self.env[res_model].get_no_read_count() diff --git a/sun_badge_menu/views/ir_ui_menu.xml b/sun_badge_menu/views/ir_ui_menu.xml index 41f9a09f1..22f2fa443 100644 --- a/sun_badge_menu/views/ir_ui_menu.xml +++ b/sun_badge_menu/views/ir_ui_menu.xml @@ -8,6 +8,7 @@ + diff --git a/yuthon_report/static/src/components/yuthon_report/yuthon_report.js b/yuthon_report/static/src/components/yuthon_report/yuthon_report.js index 745f5619e..da3e171c7 100644 --- a/yuthon_report/static/src/components/yuthon_report/yuthon_report.js +++ b/yuthon_report/static/src/components/yuthon_report/yuthon_report.js @@ -43,6 +43,7 @@ class YouthonReport extends Component { localeText: AG_GRID_LOCALE_CN, theme:agGrid.themeMaterial, columnDefs: this.config.columns || [], + groupDefaultExpanded:1, // 分组展开 rowData: [], sideBar: true, defaultColDef: { sortable: true, filter: true, width: 200,minWidth: 150,flex: false, resizable: false }, diff --git a/yuthon_report/static/src/components/yuthon_report/yuthon_report.xml b/yuthon_report/static/src/components/yuthon_report/yuthon_report.xml index f80b10267..2c7b36882 100644 --- a/yuthon_report/static/src/components/yuthon_report/yuthon_report.xml +++ b/yuthon_report/static/src/components/yuthon_report/yuthon_report.xml @@ -7,7 +7,7 @@
-
+
未处理违约金
¥245,890.00
@@ -19,14 +19,14 @@
-
+
已收回违约金
¥1,320,560.00
▲ 8.2% 较上月
-
+
@@ -111,6 +111,15 @@
+ + +
+
+
报表名称
+
+
+ +
diff --git a/yuthon_report/views/att_report_view.xml b/yuthon_report/views/att_report_view.xml index 03e459840..3e2ac39ea 100644 --- a/yuthon_report/views/att_report_view.xml +++ b/yuthon_report/views/att_report_view.xml @@ -23,7 +23,7 @@ {"headerName": "申请原因", "field": "申请原因", "flex": 1}, {"headerName": "发起时间", "field": "发起时间", "flex": 1}, {"headerName": "最后操作时间", "field": "最后操作时间", "flex": 1}, - {"headerName": "审批状态", "field": "审批状态", "flex": 1} + {"headerName": "审批状态", "field": "审批状态", "flex": 1,'rowGroup':true} ] } }