Merge remote-tracking branch 'origin/main' into multi-tenant

This commit is contained in:
TsMask
2024-07-06 15:54:53 +08:00
18 changed files with 75 additions and 51 deletions

View File

@@ -11,7 +11,7 @@ VITE_APP_NAME = "Core Network EMS"
VITE_APP_CODE = "CN EMS"
# 应用版本
VITE_APP_VERSION = "2.240627"
VITE_APP_VERSION = "2.240704"
# 接口基础URL地址-不带/后缀
VITE_API_BASE_URL = "/omc-api"

View File

@@ -11,7 +11,7 @@ VITE_APP_NAME = "Core Network EMS"
VITE_APP_CODE = "CN EMS"
# 应用版本
VITE_APP_VERSION = "2.240627"
VITE_APP_VERSION = "2.240704"
# 接口基础URL地址-不带/后缀
VITE_API_BASE_URL = "/omc-api"

View File

@@ -14,23 +14,26 @@ const { t } = useI18n();
/**显示遮罩 */
const isVisible = computed(() => !['none', 'lock'].includes(maskStore.type));
// 等待指定的时间后触发事件的函数
// 用户无操作一段时间后进行锁屏
function idleTimeout(time: number, callback: Function) {
if (time === 0) return;
let timeoutId: any;
function resetTimer() {
clearTimeout(timeoutId);
timeoutId = setTimeout(callback, time);
let idleTime = 0;
function resetIdleTime() {
idleTime = 0;
}
// 监听浏览器标签是否活动
window.addEventListener('blur', useThrottleFn(resetTimer, 300));
window.addEventListener('focus', useThrottleFn(resetTimer, 300));
document.addEventListener('visibilitychange', useThrottleFn(resetTimer, 300));
// 初始化定时器
resetTimer();
// 监听用户活动事件
document.addEventListener('mousemove', useThrottleFn(resetIdleTime, 1000));
document.addEventListener('keydown', useThrottleFn(resetIdleTime, 1000));
document.addEventListener('click', useThrottleFn(resetIdleTime, 1000));
// 定时检查用户是否长时间无操作
timeoutId = setInterval(() => {
idleTime += 1000;
if (idleTime >= time) {
clearTimeout(timeoutId);
callback();
}
}, 1000);
}
/**组件实例挂载之后调用 */

View File

@@ -1,5 +1,5 @@
/**管理员-系统指定角色KEY */
export const ADMIN_ROLE_KEY = 'admin';
/**系统管理员-系统指定角色KEY */
export const ADMIN_ROLE_KEY = 'system';
/**管理员-系统指定权限 */
/**系统管理员-系统指定权限 */
export const ADMIN_PERMISSION = '*:*:*';

View File

@@ -767,11 +767,13 @@ export default {
licensePath: "License File",
licensePathTip: "Please upload license file",
upload: 'Upload',
uploadBatch: "Upload License",
uploadFile: "Upload License",
uploadChangeOk: 'Network Element renewed license successfully and is being calibrated in the background!',
uploadChangeFail: "Some network elements failed to update the license, please check whether the service terminal environment is available!",
},
neConfPara5G: {
headerTip: 'Check and save the public parameter properties of the network element before performing the installation of the network element, and make sure that the latest parameter properties are applied.',
headerTipToPage: 'Jump Installation',
save: 'Save',
reload: 'Reload',
title: 'Save Info',

View File

@@ -767,11 +767,13 @@ export default {
licensePath: "许可证文件",
licensePathTip: "请上传许可证文件",
upload: '上传',
uploadBatch: "上传许可证",
uploadFile: "上传许可证",
uploadChangeOk: '网元更新许可证成功,正在后台校验!',
uploadChangeFail: "部分网元更新许可证失败,请检查服务终端环境是否可用!",
},
neConfPara5G: {
headerTip: '进行网元安装前检查并保存网元公共参数属性,确认应用为最新参数属性',
headerTipToPage: '跳转安装',
save: '保存',
reload: '刷新',
title: '保存信息',

View File

@@ -277,6 +277,9 @@ function fnChangeData(data: any[], itemID: string) {
if (men > 100) {
men = +(men / 100).toFixed(2);
}
if (men > 100) {
men = 100;
}
sysMemUsage = men;
}

View File

@@ -45,7 +45,7 @@ let tableColumns: ColumnsType = [
title: t('common.rowId'),
dataIndex: 'num',
width: '50px',
align: 'center',
align: 'left',
customRender(opt) {
const idxNum = (tablePagination.current - 1) * tablePagination.pageSize;
return idxNum + opt.index + 1;
@@ -54,17 +54,17 @@ let tableColumns: ColumnsType = [
{
title: t('views.monitor.online.mettingId'),
dataIndex: 'tokenId',
align: 'center',
align: 'left',
},
{
title: t('views.monitor.online.account'),
dataIndex: 'userName',
align: 'center',
align: 'left',
},
{
title: t('views.monitor.online.host'),
dataIndex: 'ipaddr',
align: 'center',
align: 'left',
},
// {
// title: t('views.monitor.online.loginDes'),
@@ -74,17 +74,17 @@ let tableColumns: ColumnsType = [
{
title: t('views.monitor.online.os'),
dataIndex: 'os',
align: 'center',
align: 'left',
},
{
title: t('views.monitor.online.lib'),
dataIndex: 'browser',
align: 'center',
align: 'left',
},
{
title: t('views.monitor.online.loginTime'),
dataIndex: 'loginTime',
align: 'center',
align: 'left',
customRender(opt) {
if (+opt.value <= 0) return '';
return parseDateToStr(+opt.value);
@@ -93,7 +93,7 @@ let tableColumns: ColumnsType = [
{
title: t('common.operate'),
key: 'tokenId',
align: 'center',
align: 'left',
},
];

View File

@@ -119,8 +119,8 @@ function fnGetData() {
for (const item of resArr[1].rows) {
switch (item.neType) {
case 'OMC':
state.from.sbi.omc_ip = item.ip;
Object.assign(state.omcInfo, item);
// state.from.sbi.omc_ip = item.ip;
Object.assign(state.omcInfo, item); // 主动改OMC_IP
break;
case 'IMS':
state.from.sbi.ims_ip = item.ip;
@@ -204,6 +204,13 @@ onMounted(() => {
<template>
<PageContainer>
<template #content>
{{ t('views.ne.neConfPara5G.headerTip') }}
<RouterLink :to="{ name: 'NeQuickSetup_2142' }">
{{ t('views.ne.neConfPara5G.headerTipToPage') }}
</RouterLink>
</template>
<a-card :bordered="false">
<!-- 公共参数表单 -->
<Para5GForm v-model:data="state.from" :ne="state.hasNE"></Para5GForm>

View File

@@ -223,12 +223,6 @@ function fnModalVisibleByEdit(editId: string) {
modalState.confirmLoading = false;
hide();
if (res.code === RESULT_CODE_SUCCESS) {
// OMC没有telnet
if (res.data.neType === 'OMC') {
res.data.hosts = res.data.hosts.filter(
(s: any) => s.hostType === 'ssh'
);
}
Object.assign(modalState.from, res.data);
modalState.title = t('views.ne.neInfo.editTitle');
modalState.visibleByEdit = true;
@@ -292,10 +286,6 @@ function fnModalCancel() {
*/
function fnNeTypeChange(v: any) {
const hostsLen = modalState.from.hosts.length;
// OMC没有telnet
if (hostsLen >= 2 && v === 'OMC') {
modalState.from.hosts.splice(1, hostsLen);
}
// 网元默认只含22和4100
if (hostsLen === 3 && v !== 'UPF') {
modalState.from.hosts.pop();
@@ -626,7 +616,9 @@ onMounted(() => {
</a-divider>
<a-collapse class="collapse" ghost>
<a-collapse-panel
v-for="host in modalState.from.hosts"
v-for="host in modalState.from.hosts.filter(
(s:any) => !(s.hostType === 'telnet' && modalState.from.neType === 'OMC')
)"
:key="host.title"
:header="`${host.hostType.toUpperCase()} ${host.port}`"
>

View File

@@ -220,6 +220,12 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
* 进行表达规则校验
*/
function fnModalEditOk(from: Record<string, any>) {
// 新增时刷新列表
if (!from.id) {
fnGetList();
return;
}
// 编辑时局部更新信息
stateNeInfo(from.neType, from.neId)
.then(res => {
// 找到编辑更新的网元

View File

@@ -434,8 +434,13 @@ onMounted(() => {
"
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
{{ tableState.selectedRowOne.neType }}
<template v-if="tableState.selectedRowOne.neType">
{{ t('views.ne.neSoftware.upload') }}
{{ tableState.selectedRowOne.neType }}
</template>
<template v-else>
{{ t('views.ne.neSoftware.uploadBatch') }}
</template>
</a-button>
<a-button
type="default"

View File

@@ -528,8 +528,13 @@ onMounted(() => {
"
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
{{ tableState.selectedRowOne.neType }}
<template v-if="tableState.selectedRowOne.neType">
{{ t('views.ne.neSoftware.upload') }}
{{ tableState.selectedRowOne.neType }}
</template>
<template v-else>
{{ t('views.ne.neSoftware.uploadBatch') }}
</template>
</a-button>
<a-button
type="primary"

View File

@@ -1314,7 +1314,7 @@ onMounted(() => {
<a-form-item :label="t('views.neUser.sub.neType')" name="neId ">
<a-select
v-model:value="queryParams.neId"
:options="dict.udmSubCNType"
:options="neOtions"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>

View File

@@ -284,7 +284,7 @@ onMounted(() => {
"
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
{{ t('views.ne.neSoftware.upload') }}
{{ state.selectedRowOne.neType }}
</a-button>

View File

@@ -296,7 +296,7 @@ onMounted(() => {
@click.prevent="fnModalOpen"
>
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neLicense.uploadBatch') }}
{{ t('views.ne.neLicense.uploadFile') }}
</a-button>
<a-button

View File

@@ -184,7 +184,7 @@ type ModalStateType = {
/**对话框对象信息状态 */
let modalState: ModalStateType = reactive({
visibleBySelectUser: false,
title: t('views.system.role.selectUser'),
title: t('views.system.role.distributeUser'),
});
/**

View File

@@ -237,7 +237,6 @@ watch(
<template>
<ProModal
:drag="true"
:width="800"
:destroyOnClose="true"
:forceFullscreen="true"
:title="props.title"
@@ -302,7 +301,7 @@ watch(
:loading="tableState.loading"
:data-source="tableState.data"
:size="tableState.size"
:scroll="{ scrollToFirstRowOnChange: true, y: 400, x: 600 }"
:scroll="{ scrollToFirstRowOnChange: true }"
:pagination="tablePagination"
:row-selection="{
type: 'checkbox',