feat: 修改OAM配置中的同步功能为重启功能

This commit is contained in:
TsMask
2025-04-21 10:56:09 +08:00
parent 35f2950143
commit 352f7082f2
3 changed files with 17 additions and 9 deletions

View File

@@ -511,7 +511,7 @@ export default {
delTip: 'Confirm deletion of network element information data items?',
oam: {
title: 'OAM Configuration',
sync: 'Sync to NE',
restart: 'Restart NE',
oamEnable: 'Service',
oamPort: 'Port',
snmpEnable: 'Service',

View File

@@ -511,7 +511,7 @@ export default {
delTip: '确认删除网元信息数据项吗?',
oam: {
title: 'OAM配置',
sync: '同步到网元',
restart: '下发后重启网元',
oamEnable: '服务',
oamPort: '端口',
snmpEnable: '服务',

View File

@@ -4,7 +4,7 @@ import { ProModal } from 'antdv-pro-modal';
import { message, Form } from 'ant-design-vue/es';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { getOAMFile, saveOAMFile } from '@/api/ne/neInfo';
import { getOAMFile, saveOAMFile, serviceNeAction } from '@/api/ne/neInfo';
const { t } = useI18n();
const emit = defineEmits(['ok', 'cancel', 'update:open']);
const props = defineProps({
@@ -29,8 +29,8 @@ type ModalStateType = {
openByEdit: boolean;
/**标题 */
title: string;
/**是否同步 */
sync: boolean;
/**是否重启 */
restart: boolean;
/**表单数据 */
from: Record<string, any>;
/**确定按钮 loading */
@@ -41,7 +41,7 @@ type ModalStateType = {
let modalState: ModalStateType = reactive({
openByEdit: false,
title: 'OAM Configuration',
sync: true,
restart: false,
from: {
omcIP: '',
oamEnable: true,
@@ -114,12 +114,19 @@ function fnModalOk() {
neType: props.neType,
neId: props.neId,
content: from,
sync: modalState.sync,
sync: true,
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3);
emit('ok');
if (modalState.restart) {
serviceNeAction({
neType: props.neType,
neId: props.neId,
action: 'restart',
});
}
fnModalCancel();
} else {
message.error({
@@ -145,6 +152,7 @@ function fnModalOk() {
function fnModalCancel() {
modalState.openByEdit = false;
modalState.confirmLoading = false;
modalState.restart = false;
modalStateFrom.resetFields();
emit('cancel');
emit('update:open', false);
@@ -183,7 +191,7 @@ watch(
:labelWrap="true"
>
<a-form-item
:label="t('views.ne.neInfo.oam.sync')"
:label="t('views.ne.neInfo.oam.restart')"
name="sync"
:label-col="{ span: 6 }"
:labelWrap="true"
@@ -191,7 +199,7 @@ watch(
<a-switch
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
v-model:checked="modalState.sync"
v-model:checked="modalState.restart"
></a-switch>
</a-form-item>