fix: 根据配置隐藏多语言选择

This commit is contained in:
TsMask
2023-11-29 19:27:49 +08:00
parent 1784941670
commit 95fbce6b0e
9 changed files with 78 additions and 39 deletions

View File

@@ -2,11 +2,11 @@
* =============== Zh ===============
* - Nginx部署
* 删除loading.js同级下同名文件Nginx代理地址: /omc-api
*
*
* - 非Nginx部署
* 请将当前文件与loading.js同级将host变量值修改为数据服务访问地址
* !!!注意: 修改当前文件后,建议关闭浏览器后重新访问
*
*
* =============== En ===============
* - Nginx Deployment
* Delete the file with the same name under the same level of loading.js, Nginx proxy address: /omc-api
@@ -20,11 +20,22 @@
// host = ip:prot
const host = '192.168.2.166:3030';
// Service Address 服务地址
const baseUrl = `http://${host}`;
sessionStorage.setItem('baseUrl', baseUrl);
const configs = {
// internationalization 国际化禁用,默认语言选择
i18nDisable: false,
i18nDisableDefault: 'en_US',
// Service Address 服务地址
baseUrl: `http://${host}`,
// websocket Address
wsUrl: `ws://${host}`,
};
if(!configs.i18nDisable){
localStorage.setItem('cache:local:i18n', configs.i18nDisableDefault);
}
for (const key in configs) {
console.log(key, `${configs[key]}`);
sessionStorage.setItem(key, `${configs[key]}`);
}
// websocket Address
const wsUrl = `ws://${host}`;
sessionStorage.setItem('wsUrl', wsUrl);
})();

View File

@@ -26,5 +26,17 @@ export async function listIMS(query: Record<string, any>) {
data.total = rows.length;
data.rows = rows;
}
// 测试数据
// data.rows = [
// {
// activeTime: '2023-11-29 17:04:54',
// barring: 0,
// impu: 'sip:12307551232@ims.mnc000.mcc460.3gppnetwork.org',
// imsi: '460001230000002',
// msisdn: '12307551232',
// regState: 1,
// },
// ];
return data;
}

View File

@@ -8,7 +8,6 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
* @returns object
*/
export async function listN3iwf(query: Record<string, any>) {
query.nbId = query.id;
const result = await request({
url: '/api/rest/ueManagement/v1/elementType/n3iwf/objectType/ueInfo',
method: 'get',

View File

@@ -6,6 +6,7 @@ import useI18n from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
import useUserStore from '@/store/modules/user';
import useAlarmStore from '@/store/modules/alarm';
import { sessionGet } from '@/utils/cache-session-utils';
const { isFullscreen, toggle } = useFullscreen();
const { t, changeLocale, optionsLocale } = useI18n();
const userStore = useUserStore();
@@ -42,6 +43,9 @@ function fnClickHelpDoc(language?: string) {
window.open(href, '_blank');
}
// 兼容旧前端可改配置文件
const i18nDisable = sessionGet('i18nDisable') === 'false';
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
@@ -81,7 +85,11 @@ function fnChangeLocale(e: any) {
</a-button>
</a-tooltip>
<a-dropdown placement="bottom" :trigger="['click', 'hover']">
<a-dropdown
placement="bottom"
:trigger="['click', 'hover']"
v-if="!i18nDisable"
>
<a-button size="small" type="default">
{{ t('i18n') }}
<DownOutlined />

View File

@@ -8,6 +8,7 @@ import { useRouter, useRoute } from 'vue-router';
import useI18n from '@/hooks/useI18n';
import { toRaw } from 'vue';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { sessionGet } from '@/utils/cache-session-utils';
const { t, changeLocale, optionsLocale } = useI18n();
const appStore = useAppStore();
const router = useRouter();
@@ -115,6 +116,9 @@ onMounted(() => {
fnGetCaptcha();
});
// 兼容旧前端可改配置文件
const i18nDisable = sessionGet('i18nDisable') === 'false';
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
@@ -270,6 +274,7 @@ function fnChangeLocale(e: any) {
justify="space-between"
align="middle"
style="margin-top: 18px"
v-if="!i18nDisable"
>
<a-col :offset="18" :span="6">
<a-dropdown :trigger="['click', 'hover']">

View File

@@ -861,7 +861,7 @@ onMounted(() => {
:size="tableState.size"
:row-class-name="fnTableStriped"
:pagination="tablePagination"
:scroll="{ y: 450 }"
:scroll="{ y: 'calc(100vh - 480px)' }"
@change="fnTableChange"
@resizeColumn="(w:number, col:any) => (col.width = w)"
>
@@ -1293,4 +1293,8 @@ onMounted(() => {
.table :deep(.table-striped) td {
background-color: #fafafa;
}
.table :deep(.ant-pagination) {
padding: 0 24px;
}
</style>

View File

@@ -69,26 +69,26 @@ let tableColumns: ColumnsType = [
{
title: 'NodeB ID',
dataIndex: 'id',
align: 'center',
width: 2,
align: 'left',
width: 150,
},
{
title: 'NodeB Address',
dataIndex: 'address',
align: 'center',
width: 3,
title: 'UE Number',
dataIndex: 'ueNum',
align: 'left',
width: 150,
},
{
title: 'NodeB Name',
dataIndex: 'name',
align: 'left',
width: 2,
width: 150,
},
{
title: 'UE Number',
dataIndex: 'ueNum',
align: 'center',
width: 2,
title: 'NodeB Address',
dataIndex: 'address',
align: 'left',
minWidth: 150,
},
];

View File

@@ -72,38 +72,38 @@ let tableColumns: ColumnsType = [
{
title: 'IMSI',
dataIndex: 'imsi',
align: 'center',
width: 3,
align: 'left',
width: 150,
},
{
title: 'MSISDN',
dataIndex: 'msisdn',
align: 'center',
width: 3,
},
{
title: 'IMPU',
dataIndex: 'impu',
align: 'center',
width: 5,
align: 'left',
width: 150,
},
{
title: 'Barring',
dataIndex: 'barring',
align: 'center',
width: 2,
align: 'left',
width: 150,
},
{
title: 'Registration State',
dataIndex: 'regState',
align: 'center',
width: 2,
align: 'left',
width: 150,
},
{
title: 'Active Time',
dataIndex: 'activeTime',
align: 'center',
width: 3,
align: 'left',
width: 150,
},
{
title: 'IMPU',
dataIndex: 'impu',
align: 'left',
},
];

View File

@@ -1100,7 +1100,7 @@ onMounted(() => {
:size="tableState.size"
:row-class-name="fnTableStriped"
:pagination="tablePagination"
:scroll="{ x: tableColumnsDnd.length * 200, y: 450 }"
:scroll="{ x: tableColumnsDnd.length * 200, y: 'calc(100vh - 480px)' }"
@change="fnTableChange"
@resizeColumn="(w:number, col:any) => (col.width = w)"
>