From 5613f98b902c9c26d1ef27d9cf0b0a8e6f0262a3 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 15 Sep 2022 18:32:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E8=A1=A8=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E6=93=8D=E4=BD=9C=E5=AE=B9=E5=99=A8=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lang/zh-cn.php | 1 + public/static/common/css/common.css | 5 +++-- public/static/common/js/common.js | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/app/lang/zh-cn.php b/app/lang/zh-cn.php index 4ea19219c..8a4cf4b8f 100755 --- a/app/lang/zh-cn.php +++ b/app/lang/zh-cn.php @@ -24,6 +24,7 @@ return [ 'error_text' => '异常错误', 'reminder_title' => '温馨提示', 'operate_params_error' => '操作参数有误', + 'not_operate_error' => '没有相关操作', 'select_reverse_name' => '反选', 'select_all_name' => '全选', 'loading_tips' => '加载中...', diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index b9a5e51f8..9ac18ba1b 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -798,8 +798,9 @@ button.colorpicker-submit img { * 表格-操作栏更多操作列表样式 */ .am-table-scrollable-horizontal .am-table tr .am-operate-grid-more-list .am-dropdown-content { - padding: 10px; - width: 140px; + padding: 10px 5px; + width: 75px; + text-align: center; min-width: auto; -webkit-box-shadow: 0px -2px 10px rgb(136 136 136 / 40%); -moz-box-shadow: 0px -2px 10px rgb(136 136 136 / 0.4); diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 2eb5f7ec2..d8bd4b275 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -2106,6 +2106,30 @@ function FormTableContainerInit() $(this).find('.am-grid-fixed-left').last().addClass('am-grid-fixed-left-shadow'); $(this).find('.am-grid-fixed-right').first().addClass('am-grid-fixed-right-shadow'); }); + + // 右侧操作栏更多按钮显示容器宽度处理 + $('.am-table-scrollable-horizontal .am-table tr .am-operate-grid-more-list button.am-dropdown-toggle').on('click', function() + { + var $parent = $(this).parent(); + var length = $parent.find('.am-dropdown-content .am-badge').length; + if(length == 0) + { + Prompt(window['lang_not_operate_error'] || '没有相关操作', 'warning'); + $parent.removeClass('am-active'); + $parent.find('.am-dropdown-content').remove(); + } else { + if(length > 1) + { + var width = ((length-1)*10)+30; + $parent.find('.am-dropdown-content .am-badge').each(function(k, v) + { + width += $(this).outerWidth(); + }); + $parent.find('.am-dropdown-content').css('width', width+'px'); + } + $parent.addClass('am-dropdown-flip'); + } + }); } }