feat: 网元信息表单多语言翻译
This commit is contained in:
@@ -69,22 +69,16 @@ function fnHostAuthorized(row: Record<string, any>) {
|
||||
if (modalState.confirmLoading) return;
|
||||
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '是否要配置免密直连?',
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.ne.neHost.authorizedRSA'),
|
||||
onOk: () => {
|
||||
modalState.confirmLoading = true;
|
||||
neHostAuthorizedRSA(row).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `操作成功`,
|
||||
duration: 2,
|
||||
});
|
||||
message.success(t('common.operateOk'), 3);
|
||||
} else {
|
||||
message.error({
|
||||
content: `操作失败`,
|
||||
duration: 2,
|
||||
});
|
||||
message.error(t('common.operateErr'), 3);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -161,19 +155,19 @@ const modalStateFrom = Form.useForm(
|
||||
neType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入网元类型',
|
||||
message: t('views.ne.common.neTypePlease'),
|
||||
},
|
||||
],
|
||||
neId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入网元标识',
|
||||
message: t('views.ne.common.neIdPlease'),
|
||||
},
|
||||
],
|
||||
rmUid: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入资源唯一标识',
|
||||
message: t('views.ne.common.rmUidPlease'),
|
||||
},
|
||||
],
|
||||
ip: [
|
||||
@@ -185,7 +179,7 @@ const modalStateFrom = Form.useForm(
|
||||
neName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入网元名称',
|
||||
message: t('views.ne.common.neNamePlease'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -198,17 +192,17 @@ function modalStateFromEqualIPV4AndIPV6(
|
||||
callback: (error?: string) => void
|
||||
) {
|
||||
if (!value) {
|
||||
return Promise.reject('请输入网元IP地址');
|
||||
return Promise.reject(t('views.ne.common.ipAddrPlease'));
|
||||
}
|
||||
|
||||
if (value.indexOf('.') === -1 && value.indexOf(':') === -1) {
|
||||
return Promise.reject('请输入有效的IP地址');
|
||||
return Promise.reject(t('valid.ipPlease'));
|
||||
}
|
||||
if (value.indexOf('.') !== -1 && !regExpIPv4.test(value)) {
|
||||
return Promise.reject('不是有效IPv4地址');
|
||||
return Promise.reject(t('valid.ipv4Reg'));
|
||||
}
|
||||
if (value.indexOf(':') !== -1 && !regExpIPv6.test(value)) {
|
||||
return Promise.reject('不是有效IPv6地址');
|
||||
return Promise.reject(t('valid.ipv6Reg'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -220,7 +214,7 @@ function modalStateFromEqualIPV4AndIPV6(
|
||||
function fnModalVisibleByEdit(editId: string) {
|
||||
if (!editId) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.title = t('views.configManage.neManage.addNe');
|
||||
modalState.title = t('views.ne.neInfo.addTitle');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
@@ -231,7 +225,7 @@ function fnModalVisibleByEdit(editId: string) {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Object.assign(modalState.from, res.data);
|
||||
modalState.title = '编辑网元信息';
|
||||
modalState.title = t('views.ne.neInfo.editTitle');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error(t('common.getInfoFail'), 2);
|
||||
@@ -255,10 +249,7 @@ function fnModalOk() {
|
||||
result
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: '操作成功',
|
||||
duration: 3,
|
||||
});
|
||||
message.success(t('common.operateOk'), 3);
|
||||
// 刷新缓存的网元信息
|
||||
useNeInfoStore().fnRefreshNelist();
|
||||
emit('ok');
|
||||
|
||||
@@ -59,7 +59,7 @@ const modalStateFrom = Form.useForm(
|
||||
kpiTimer: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入KPI上报周期(单位秒)',
|
||||
message: t('views.ne.neInfo.oam.kpiTimerPlease'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -115,10 +115,7 @@ function fnModalOk() {
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: '操作成功',
|
||||
duration: 3,
|
||||
});
|
||||
message.success(t('common.operateOk'), 3);
|
||||
emit('ok');
|
||||
fnModalCancel();
|
||||
} else {
|
||||
|
||||
@@ -127,17 +127,17 @@ function modalStateFromEqualIPV4AndIPV6(
|
||||
callback: (error?: string) => void
|
||||
) {
|
||||
if (!value) {
|
||||
return Promise.reject('请输入网元IP地址');
|
||||
return Promise.reject(t('views.ne.common.ipAddrPlease'));
|
||||
}
|
||||
|
||||
if(value.indexOf('.') === -1 && value.indexOf(':') === -1) {
|
||||
return Promise.reject('请输入有效的IP地址');
|
||||
}
|
||||
if (value.indexOf('.') === -1 && value.indexOf(':') === -1) {
|
||||
return Promise.reject(t('valid.ipPlease'));
|
||||
}
|
||||
if (value.indexOf('.') !== -1 && !regExpIPv4.test(value)) {
|
||||
return Promise.reject('不是有效IPv4地址');
|
||||
return Promise.reject(t('valid.ipv4Reg'));
|
||||
}
|
||||
if (value.indexOf(':') !== -1 && !regExpIPv6.test(value)) {
|
||||
return Promise.reject('不是有效IPv6地址');
|
||||
return Promise.reject(t('valid.ipv6Reg'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -112,17 +112,17 @@ function modalStateFromEqualIPV4AndIPV6(
|
||||
callback: (error?: string) => void
|
||||
) {
|
||||
if (!value) {
|
||||
return Promise.reject('请输入网元IP地址');
|
||||
return Promise.reject(t('views.ne.common.ipAddrPlease'));
|
||||
}
|
||||
|
||||
if(value.indexOf('.') === -1 && value.indexOf(':') === -1) {
|
||||
return Promise.reject('请输入有效的IP地址');
|
||||
}
|
||||
if (value.indexOf('.') === -1 && value.indexOf(':') === -1) {
|
||||
return Promise.reject(t('valid.ipPlease'));
|
||||
}
|
||||
if (value.indexOf('.') !== -1 && !regExpIPv4.test(value)) {
|
||||
return Promise.reject('不是有效IPv4地址');
|
||||
return Promise.reject(t('valid.ipv4Reg'));
|
||||
}
|
||||
if (value.indexOf(':') !== -1 && !regExpIPv6.test(value)) {
|
||||
return Promise.reject('不是有效IPv6地址');
|
||||
return Promise.reject(t('valid.ipv6Reg'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user