优化代码

优化样式
pull/423/MERGE
Karson 2023-06-07 14:54:33 +08:00
parent fdaf86ce92
commit eb66ecb256
5 changed files with 26 additions and 16 deletions

View File

@ -121,7 +121,7 @@ if (!function_exists('build_toolbar')) {
$html = [];
foreach ($btns as $k => $v) {
//如果未定义或没有权限
if (!isset($btnAttr[$v]) || ($v !== 'refresh' && !$auth->check("{$controller}/{$v}"))) {
if (!isset($btnAttr[$v]) || ($v !== 'refresh' && !$auth->check("{$controller}/{$v}", $auth->id))) {
continue;
}
list($href, $class, $icon, $text, $title) = $btnAttr[$v];

View File

@ -30,6 +30,7 @@ return [
'You\'ve logged in, do not login again' => '你已经登录,无需重复登录',
'Username or password can not be empty' => '用户名密码不能为空',
'Username or password is incorrect' => '用户名或密码不正确',
'Username must be 3 to 30 characters' => '用户名只能由3-30位数字、字母、下划线组合',
'Username is incorrect' => '用户名不正确',
'Password is incorrect' => '密码不正确',
'Admin is forbidden' => '管理员已经被禁止登录',

View File

@ -81,15 +81,17 @@ if (!function_exists('cdnurl')) {
/**
* 获取上传资源的CDN的地址
* @param string $url 资源相对地址
* @param boolean $domain 是否显示域名 或者直接传入域名
* @param string $url 资源相对地址
* @param boolean|string $domain 是否显示域名 或者直接传入域名
* @return string
*/
function cdnurl($url, $domain = false)
{
$regex = "/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i";
$cdnurl = \think\Config::get('upload.cdnurl');
$url = preg_match($regex, $url) || ($cdnurl && stripos($url, $cdnurl) === 0) ? $url : $cdnurl . $url;
if (is_bool($domain)) {
$cdnurl = \think\Config::get('upload.cdnurl');
$url = preg_match($regex, $url) || ($cdnurl && stripos($url, $cdnurl) === 0) ? $url : $cdnurl . $url;
}
if ($domain && !preg_match($regex, $url)) {
$domain = is_bool($domain) ? request()->domain() : $domain;
$url = $domain . $url;
@ -216,7 +218,7 @@ if (!function_exists('addtion')) {
} else {
foreach ($fields as $k => $v) {
if (is_array($v)) {
$v['field'] = isset($v['field']) ? $v['field'] : $k;
$v['field'] = $v['field'] ?? $k;
} else {
$v = ['field' => $v];
}
@ -225,12 +227,12 @@ if (!function_exists('addtion')) {
}
foreach ($fieldsArr as $k => &$v) {
$v = is_array($v) ? $v : ['field' => $v];
$v['display'] = isset($v['display']) ? $v['display'] : str_replace(['_ids', '_id'], ['_names', '_name'], $v['field']);
$v['primary'] = isset($v['primary']) ? $v['primary'] : '';
$v['column'] = isset($v['column']) ? $v['column'] : 'name';
$v['model'] = isset($v['model']) ? $v['model'] : '';
$v['table'] = isset($v['table']) ? $v['table'] : '';
$v['name'] = isset($v['name']) ? $v['name'] : str_replace(['_ids', '_id'], '', $v['field']);
$v['display'] = $v['display'] ?? str_replace(['_ids', '_id'], ['_names', '_name'], $v['field']);
$v['primary'] = $v['primary'] ?? '';
$v['column'] = $v['column'] ?? 'name';
$v['model'] = $v['model'] ?? '';
$v['table'] = $v['table'] ?? '';
$v['name'] = $v['name'] ?? str_replace(['_ids', '_id'], '', $v['field']);
}
unset($v);
$ids = [];
@ -323,7 +325,7 @@ if (!function_exists('var_export_short')) {
if ($replaced) {
$dump = preg_replace_callback("/'##<(\d+)>##'/", function ($matches) use ($replaced) {
return isset($replaced[$matches[1]]) ? $replaced[$matches[1]] : "''";
return $replaced[$matches[1]] ?? "''";
}, $dump);
}

View File

@ -309,14 +309,13 @@ body.is-dialog {
html.ios-fix,
html.ios-fix body {
height: 100%;
overflow: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
html.ios-fix .wrapper,
html.ios-fix body .wrapper,
html.ios-fix .tab-pane,
html.ios-fix body .tab-pane {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.wrapper {
@ -1049,6 +1048,14 @@ form.form-horizontal .control-label {
.bootstrap-table .form-commonsearch .row > .form-group > .control-label {
white-space: nowrap;
}
.bootstrap-table .btn-commonsearch {
position: relative;
}
.bootstrap-table .btn-commonsearch > span {
position: absolute;
top: -10px;
right: -10px;
}
.bootstrap-table .table:not(.table-condensed) > tbody > tr > th,
.bootstrap-table .table:not(.table-condensed) > tfoot > tr > th,
.bootstrap-table .table:not(.table-condensed) > thead > tr > td,

View File

@ -132,7 +132,7 @@ define(['jquery', 'bootstrap'], function ($, undefined) {
return __('Common search');
},
formatCommonSubmitButton: function () {
return __('Submit');
return __('Search');
},
formatCommonResetButton: function () {
return __('Reset');