perf: 优化快速安装配置公共参数页面

This commit is contained in:
TsMask
2024-08-01 17:34:16 +08:00
parent 3c1ee63359
commit e21a8dc898
5 changed files with 350 additions and 334 deletions

View File

@@ -1,4 +1,4 @@
import { onMounted, reactive, toRaw } from 'vue';
import { reactive, toRaw } from 'vue';
import { getPara5GFilee, savePara5GFile, updateNeInfo } from '@/api/ne/neInfo';
import useNeInfoStore from '@/store/modules/neinfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
@@ -20,7 +20,7 @@ type StateType = {
confirmLoading: boolean;
};
export function usePara5G({ t }: any) {
export function usePara5G() {
/**对象信息状态 */
let state: StateType = reactive({
from: {},
@@ -52,7 +52,7 @@ export function usePara5G({ t }: any) {
// 公共配置文件sbi的各网元IP
switch (item.neType) {
case 'OMC':
// state.from.sbi.omc_ip = item.ip;
state.from.sbi.omc_ip = item.ip;
Object.assign(state.omcInfo, item); // 主动改OMC_IP
break;
case 'IMS':
@@ -120,17 +120,15 @@ export function usePara5G({ t }: any) {
});
if (res.code === RESULT_CODE_SUCCESS) {
// 更新omc_ip
state.omcInfo.ip = state.from.sbi.omc_ip;
await updateNeInfo(toRaw(state.omcInfo));
if (state.omcInfo.id) {
state.omcInfo.ip = state.from.sbi.omc_ip;
await updateNeInfo(toRaw(state.omcInfo));
}
}
state.confirmLoading = false;
return res;
}
onMounted(() => {
fnReloadData();
});
return {
state,
fnReloadData,