fix: 网元公共参数设置omcIP进行更新

This commit is contained in:
TsMask
2024-05-24 16:15:09 +08:00
parent 6470effbda
commit 206d3755a0
2 changed files with 35 additions and 6 deletions

View File

@@ -4,7 +4,12 @@ import { PageContainer } from 'antdv-pro-layout';
import { message } from 'ant-design-vue/lib'; import { message } from 'ant-design-vue/lib';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { getPara5GFilee, listNeInfo, savePara5GFile } from '@/api/ne/neInfo'; import {
getPara5GFilee,
listNeInfo,
savePara5GFile,
updateNeInfo,
} from '@/api/ne/neInfo';
import useNeInfoStore from '@/store/modules/neinfo'; import useNeInfoStore from '@/store/modules/neinfo';
const { t } = useI18n(); const { t } = useI18n();
@@ -20,6 +25,8 @@ type StateType = {
syncMsg: string; syncMsg: string;
/**表单数据 */ /**表单数据 */
from: Record<string, any>; from: Record<string, any>;
/**OMC信息需修改当前的IP */
omcInfo: Record<string, any>;
/**确定按钮 loading */ /**确定按钮 loading */
confirmLoading: boolean; confirmLoading: boolean;
}; };
@@ -71,6 +78,7 @@ let state: StateType = reactive({
n3iwf_ip: '172.16.5.230', n3iwf_ip: '172.16.5.230',
}, },
}, },
omcInfo: {},
confirmLoading: false, confirmLoading: false,
}); });
@@ -86,7 +94,10 @@ function fnModalOk() {
if (state.sync) { if (state.sync) {
state.syncMsg = res.msg; state.syncMsg = res.msg;
} else { } else {
message.success('Save Success'); message.success(t('views.ne.neConfPara5G.save'));
// 更新omc_ip
state.omcInfo.ip = state.from.sbi.omc_ip;
updateNeInfo(toRaw(state.omcInfo));
} }
}) })
.finally(() => { .finally(() => {
@@ -128,6 +139,10 @@ function fnGetData() {
) { ) {
for (const item of resArr[1].rows) { for (const item of resArr[1].rows) {
switch (item.neType) { switch (item.neType) {
case 'OMC':
state.from.sbi.omc_ip = item.ip;
Object.assign(state.omcInfo, item);
break;
case 'IMS': case 'IMS':
state.from.sbi.ims_ip = item.ip; state.from.sbi.ims_ip = item.ip;
break; break;
@@ -413,7 +428,11 @@ onMounted(() => {
:disabled="state.confirmLoading" :disabled="state.confirmLoading"
></a-switch> ></a-switch>
</a-form-item> </a-form-item>
<a-form-item :label="t('views.ne.neConfPara5G.syncNe')" name="syncNe" v-if="state.sync"> <a-form-item
:label="t('views.ne.neConfPara5G.syncNe')"
name="syncNe"
v-if="state.sync"
>
<a-select <a-select
v-model:value="state.syncNe" v-model:value="state.syncNe"
mode="multiple" mode="multiple"

View File

@@ -3,7 +3,7 @@ import { Modal, message } from 'ant-design-vue/lib';
import { onMounted, reactive, toRaw } from 'vue'; import { onMounted, reactive, toRaw } from 'vue';
import { fnToStepName } from '../hooks/useStep'; import { fnToStepName } from '../hooks/useStep';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import { listNeInfo, getPara5GFilee, savePara5GFile } from '@/api/ne/neInfo'; import { listNeInfo, getPara5GFilee, savePara5GFile, updateNeInfo } from '@/api/ne/neInfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { t } = useI18n(); const { t } = useI18n();
@@ -15,6 +15,8 @@ type StateType = {
saveFile: boolean; saveFile: boolean;
/**表单数据 */ /**表单数据 */
from: Record<string, any>; from: Record<string, any>;
/**OMC信息需修改当前的IP */
omcInfo: Record<string, any>;
/**确定按钮 loading */ /**确定按钮 loading */
confirmLoading: boolean; confirmLoading: boolean;
}; };
@@ -63,6 +65,7 @@ let state: StateType = reactive({
n3iwf_ip: '172.16.5.230', n3iwf_ip: '172.16.5.230',
}, },
}, },
omcInfo: {},
confirmLoading: false, confirmLoading: false,
}); });
@@ -76,9 +79,12 @@ function fnSave() {
syncNe: [], syncNe: [],
}) })
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success('Save Success'); message.success(t('views.ne.neConfPara5G.save'));
state.saveFile = true; state.saveFile = true;
// 更新omc_ip
state.omcInfo.ip = state.from.sbi.omc_ip
updateNeInfo(toRaw(state.omcInfo));
} else { } else {
message.warning(res.nsg); message.warning(res.nsg);
} }
@@ -109,6 +115,10 @@ function fnGetList() {
) { ) {
for (const item of resArr[1].rows) { for (const item of resArr[1].rows) {
switch (item.neType) { switch (item.neType) {
case 'OMC':
state.from.sbi.omc_ip = item.ip;
Object.assign(state.omcInfo, item);
break;
case 'IMS': case 'IMS':
state.from.sbi.ims_ip = item.ip; state.from.sbi.ims_ip = item.ip;
break; break;