diff --git a/crmeb/app/common.php b/crmeb/app/common.php index 72c84a734..e329293df 100644 --- a/crmeb/app/common.php +++ b/crmeb/app/common.php @@ -22,6 +22,7 @@ use app\services\system\lang\LangTypeServices; use app\services\system\lang\LangCodeServices; use app\services\system\lang\LangCountryServices; use think\facade\Config; +use think\facade\Log; if (!function_exists('getWorkerManUrl')) { @@ -922,61 +923,72 @@ if (!function_exists('getLang')) { */ function getLang($code, array $replace = []) { - /** @var LangCountryServices $langCountryServices */ - $langCountryServices = app()->make(LangCountryServices::class); - /** @var LangTypeServices $langTypeServices */ - $langTypeServices = app()->make(LangTypeServices::class); - /** @var LangCodeServices $langCodeServices */ - $langCodeServices = app()->make(LangCodeServices::class); + //确保获取语言的时候不会报错 + try { - $request = app()->request; - //获取接口传入的语言类型 - if (!$range = $request->header('cb-lang')) { - //没有传入则使用系统默认语言显示 - $range = $langTypeServices->cacheDriver()->remember('range_name', function () use ($langTypeServices) { - return $langTypeServices->value(['is_default' => 1], 'file_name'); - }); - if (!$range) { - //系统没有设置默认语言的话,根据浏览器语言显示,如果浏览器语言在库中找不到,则使用简体中文 - if ($request->header('accept-language') !== null) { - $range = explode(',', $request->header('accept-language'))[0]; - } else { - $range = 'zh-CN'; + /** @var LangCountryServices $langCountryServices */ + $langCountryServices = app()->make(LangCountryServices::class); + /** @var LangTypeServices $langTypeServices */ + $langTypeServices = app()->make(LangTypeServices::class); + /** @var LangCodeServices $langCodeServices */ + $langCodeServices = app()->make(LangCodeServices::class); + + $request = app()->request; + //获取接口传入的语言类型 + if (!$range = $request->header('cb-lang')) { + //没有传入则使用系统默认语言显示 + $range = $langTypeServices->cacheDriver()->remember('range_name', function () use ($langTypeServices) { + return $langTypeServices->value(['is_default' => 1], 'file_name'); + }); + if (!$range) { + //系统没有设置默认语言的话,根据浏览器语言显示,如果浏览器语言在库中找不到,则使用简体中文 + if ($request->header('accept-language') !== null) { + $range = explode(',', $request->header('accept-language'))[0]; + } else { + $range = 'zh-CN'; + } } } - } - // 获取type_id - $typeId = $langCountryServices->cacheDriver()->remember('type_id_' . $range, function () use ($langCountryServices, $range) { - return $langCountryServices->value(['code' => $range], 'type_id') ?: 1; - }, 3600); + // 获取type_id + $typeId = $langCountryServices->cacheDriver()->remember('type_id_' . $range, function () use ($langCountryServices, $range) { + return $langCountryServices->value(['code' => $range], 'type_id') ?: 1; + }, 3600); - // 获取类型 - $langData = CacheService::remember('lang_type_data', function () use ($langTypeServices) { - return $langTypeServices->getColumn(['status' => 1, 'is_del' => 0], 'file_name', 'id'); - }, 3600); + // 获取类型 + $langData = CacheService::remember('lang_type_data', function () use ($langTypeServices) { + return $langTypeServices->getColumn(['status' => 1, 'is_del' => 0], 'file_name', 'id'); + }, 3600); - // 获取缓存key - $langStr = 'lang_' . str_replace('-', '_', $langData[$typeId]); + // 获取缓存key + $langStr = 'lang_' . str_replace('-', '_', $langData[$typeId]); - //读取当前语言的语言包 - $lang = CacheService::remember($langStr, function () use ($typeId, $range, $langCodeServices) { - return $langCodeServices->getColumn(['type_id' => $typeId, 'is_admin' => 1], 'lang_explain', 'code'); - }, 3600); - //获取返回文字 - $message = (string)($lang[$code] ?? 'Code Error'); + //读取当前语言的语言包 + $lang = CacheService::remember($langStr, function () use ($typeId, $range, $langCodeServices) { + return $langCodeServices->getColumn(['type_id' => $typeId, 'is_admin' => 1], 'lang_explain', 'code'); + }, 3600); + //获取返回文字 + $message = (string)($lang[$code] ?? 'Code Error'); - //替换变量 - if (!empty($replace) && is_array($replace)) { - // 关联索引解析 - $key = array_keys($replace); - foreach ($key as &$v) { - $v = "{:{$v}}"; + //替换变量 + if (!empty($replace) && is_array($replace)) { + // 关联索引解析 + $key = array_keys($replace); + foreach ($key as &$v) { + $v = "{:{$v}}"; + } + $message = str_replace($key, $replace, $message); } - $message = str_replace($key, $replace, $message); - } - return $message; + return $message; + } catch (\Throwable $e) { + Log::error('获取语言code:' . $code . '发成错误,错误原因是:' . json_encode([ + 'file' => $e->getFile(), + 'message' => $e->getMessage(), + 'line' => $e->getLine() + ])); + return $code; + } } } diff --git a/template/admin/src/components/main/components/side-menu/side-menu.vue b/template/admin/src/components/main/components/side-menu/side-menu.vue index 433efd377..125f6d299 100644 --- a/template/admin/src/components/main/components/side-menu/side-menu.vue +++ b/template/admin/src/components/main/components/side-menu/side-menu.vue @@ -315,6 +315,7 @@ export default { color: #fff !important; border-radius: 4px; } + .ivu-menu-vertical .ivu-menu-item:hover { color: #1890ff !important; background-color: rgba(24, 144, 255, 0.1) !important; @@ -323,6 +324,14 @@ export default { color: #1890ff !important; } } + .ivu-menu-item.ivu-menu-item-active:hover { + background-color: #1890ff !important; + color: #fff !important; + border-radius: 4px; + .ivu-icon { + color: #fff !important; + } + } .ivu-menu-vertical .ivu-menu-item { padding: 10px 10px; margin-bottom: 8px; @@ -400,6 +409,14 @@ export default { color: #1890ff !important; } } + .drop-menu-a.on:hover { + background-color: #1890ff !important; + color: #fff !important; + border-radius: 4px; + .ivu-icon { + color: #fff !important; + } + } .drop-menu-a.on { background-color: #1890ff !important; color: #fff !important; diff --git a/template/admin/src/components/main/main.vue b/template/admin/src/components/main/main.vue index 94cda1d65..53e6fb155 100644 --- a/template/admin/src/components/main/main.vue +++ b/template/admin/src/components/main/main.vue @@ -41,7 +41,7 @@ - +
@@ -55,7 +55,13 @@ - + @@ -285,7 +291,7 @@ export default { .main .tag-nav-wrapper { // height: 10px; background: unset; - padding: 0 15px; + padding: 0 15px; } .open-image { display: flex; @@ -305,4 +311,17 @@ export default { .main-warper { min-height: calc(~'100vh - 166px'); } +.all-desk { + height: 100vh !important; + padding: 0 !important; + .main-content-con, + .main-warper, + .main-layout-con, + .content-wrapper { + height: 100vh !important; + } + .content-wrapper { + padding: 0; + } +} diff --git a/template/admin/src/pages/setting/devise/diyIndex.vue b/template/admin/src/pages/setting/devise/diyIndex.vue index 5a231a93e..a9baa851e 100644 --- a/template/admin/src/pages/setting/devise/diyIndex.vue +++ b/template/admin/src/pages/setting/devise/diyIndex.vue @@ -18,8 +18,8 @@
- -
+ +
@@ -33,7 +33,7 @@ {{ item.title }}
-
+
{{ item.title }} @@ -120,9 +120,7 @@ (colorTxt ? colorPickerTxt : '') + ';background-image: url(' + (picTxt ? picUrlTxt : '') + - ');height:' + - rollHeight + - 'px;' + ');height:calc(100vh - 200px)' " ref="imgContainer" > @@ -903,7 +901,9 @@ export default { .wrapper-con { /* min-width 700px; */ } - +.main .content-wrapper{ + padding: 0 !important; +} .defaultData { /* margin-left 20px; */ cursor: pointer; @@ -989,6 +989,7 @@ export default { .ivu-mt { display: flex; justify-content: space-between; + margin-bottom: 10px; } .iconfont-diy { @@ -1001,7 +1002,7 @@ export default { min-width: 1100px; display: flex; justify-content: space-between; - /* height: 84.5vh; */ + height: 100%; .left { min-width: 300px; max-width: 300px; @@ -1362,7 +1363,9 @@ export default { /deep/ .ivu-card-body { width: 100%; - padding: 0px !important; + padding:0; + height: calc(100vh - 73px); + } .rbtn { diff --git a/template/admin/src/pages/setting/storeService/speechcraft.vue b/template/admin/src/pages/setting/storeService/speechcraft.vue index cea3e7f1d..df623b45c 100644 --- a/template/admin/src/pages/setting/storeService/speechcraft.vue +++ b/template/admin/src/pages/setting/storeService/speechcraft.vue @@ -13,10 +13,10 @@ @click.native="bindMenuItem(item, index)" > {{ item.name }} -
+
-
+
编辑小组