style: MML页面多语言

This commit is contained in:
TsMask
2023-11-10 16:52:08 +08:00
parent b8190bd640
commit 6a683f8754
6 changed files with 142 additions and 70 deletions

View File

@@ -14,6 +14,7 @@ export default {
msgSuccess: 'Success {msg}',
errorFields: 'Please fill in the required information in {num} correctly!',
tablePaginationTotal: 'A total of {total} items',
noData: "No Data",
zebra:'Tabular zebra pattern',
ok: 'Ok',
cancel: 'Cancel',
@@ -743,6 +744,39 @@ export default {
nameTip:'Please enter the position name correctly',
delSure:'Confirm to delete the data item with post number [{postId}]?',
}
},
},
mmlManage: {
cmdTitle: "Command Navigator",
cmdConsole: "consoles",
cmdOpTip: "Select the item to be operated in the left command navigation!",
cmdNoTip: "{num} no optional command operation",
require: "Mandatory parameter: {num}",
requireUn: "{display} input value is of unknown type",
requireString: "The {display} parameter value does not make sense.",
requireInt: "{display} Parameter value not in reasonable range {filter}",
requireIpv4: "{display} not a legitimate IPV4 address",
requireIpv6: "{display} Not a legitimate IPV6 address.",
requireEnum: "{display} is not a reasonable enumeration value.",
requireBool: "{display} is not a reasonable boolean value.",
clearForm: "Clear Forms",
clearLog: "Clearing logs",
exec: "Execute",
cmdAwait: "Waiting for a command to be sent",
omcOperate:{
noOMC: "No OMC network elements",
},
udmOpesrate:{
noUDM: "No UDM network elements",
},
mmlSet: {
saveText: "Save Settings",
ipadd: "Listening to IP addresses",
ipaddPlease: "Please enter the listening IP address",
port: "listening port",
portPlease: "Please enter the remote port, 0~65535",
okChange: "Interface settings saved successfully",
noChange: "No change in interface settings",
},
},
},
};

View File

@@ -14,6 +14,7 @@ export default {
msgSuccess: '{msg} 成功',
errorFields: '请正确填写 {num} 处必填信息!',
tablePaginationTotal: '总共 {total} 条',
noData: "暂无数据",
zebraL:'表格斑马纹',
ok: '确定',
cancel: '取消',
@@ -742,7 +743,40 @@ export default {
codeTip:'请正确输入岗位编码',
nameTip:'请正确输入岗位名称',
delSure:'确认删除岗位编号为 【{postId}】 的数据项?',
}
},
},
},
mmlManage: {
cmdTitle: "命令导航",
cmdConsole: "控制台",
cmdOpTip: "左侧命令导航中选择要操作项!",
cmdNoTip: "{num} 无可选命令操作",
require: "必填参数:{num}",
requireUn: "{display} 输入值是未知类型",
requireString: "{display} 参数值不合理",
requireInt: "{display} 参数值不在合理范围 {filter}",
requireIpv4: "{display} 不是合法的IPV4地址",
requireIpv6: "{display} 不是合法的IPV6地址",
requireEnum: "{display} 不是合理的枚举值",
requireBool: "{display} 不是合理的布尔类型的值",
clearForm: "清除表单",
clearLog: "清除日志",
exec: "执行",
cmdAwait: "等待发送命令",
omcOperate:{
noOMC: "暂无OMC网元",
},
udmOpesrate:{
noUDM: "暂无UDM网元",
},
mmlSet: {
saveText: "保存设置",
ipadd: "侦听IP地址",
ipaddPlease: "请输入侦听IP地址",
port: "侦听端口",
portPlease: "请输入远程端口0~65535",
okChange: "接口设置保存成功",
noChange: "接口设置无变更",
},
},
},
};

View File

@@ -39,13 +39,13 @@ const operationSetStateFrom = Form.useForm(
{
required: true,
pattern: regExpIPv4,
message: '请输入远程IP地址',
message: t('views.mmlManage.mmlSet.ipaddPlease'),
},
],
listeningPort: [
{
required: true,
message: '请输入远程端口0~65535',
message: t('views.mmlManage.mmlSet.portPlease'),
},
],
})
@@ -59,9 +59,9 @@ function fnFormOperationSetFinish() {
updateOperationSet(from)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(`接口设置保存成功`, 3);
message.success(t('views.mmlManage.mmlSet.okChange'), 3);
} else {
message.warning(`接口设置无变更`, 3);
message.warning(t('views.mmlManage.mmlSet.noChange'), 3);
}
})
.finally(() => {
@@ -105,7 +105,7 @@ onMounted(() => {
@click.prevent="fnFormOperationSetFinish"
>
<template #icon><SaveOutlined /></template>
保存设置
{{ t('views.mmlManage.mmlSet.saveText') }}
</a-button>
</a-space>
</template>
@@ -116,24 +116,24 @@ onMounted(() => {
:label-col="{ span: 6 }"
>
<a-form-item
label="侦听IP地址"
:label="t('views.mmlManage.mmlSet.ipadd')"
name="listeningAddress"
v-bind="operationSetStateFrom.validateInfos.listeningAddress"
>
<a-input
v-model:value="operationSetState.from.listeningAddress"
allow-clear
placeholder="请输入侦听IP地址"
:placeholder="t('views.mmlManage.mmlSet.ipaddPlease')"
></a-input>
</a-form-item>
<a-form-item
label="侦听端口"
:label="t('views.mmlManage.mmlSet.port')"
name="listeningPort"
v-bind="operationSetStateFrom.validateInfos.ftpLolisteningPortg"
v-bind="operationSetStateFrom.validateInfos.listeningPort"
>
<a-input-number
v-model:value="operationSetState.from.listeningPort"
placeholder="3000"
placeholder="0~65535"
:min="3000"
/>
</a-form-item>

View File

@@ -76,7 +76,7 @@ function fnSendMML() {
// 是否必填项且有效值
const notV = value === null || value === undefined || value === '';
if (item.optional === 'false' && notV) {
message.warning(`必填参数:${item.display}`, 2);
message.warning(t('views.mmlManage.require', { num: item.display }), 2);
return;
}
@@ -143,18 +143,18 @@ function ruleVerification(
const maxInt = parseInt(filterArr[1]);
const valueInt = parseInt(value);
if (valueInt < minInt || valueInt > maxInt) {
return [false, `${display} 参数值不在合理范围 ${filter}`];
return [false, t('views.mmlManage.requireInt', { display, filter })];
}
}
break;
case 'ipv4':
if (!regExpIPv4.test(value)) {
return [false, `${display} 不是合法的IPV4地址`];
return [false, t('views.mmlManage.requireIpv4', { display })];
}
break;
case 'ipv6':
if (!regExpIPv6.test(value)) {
return [false, `${display} 不是合法的IPV6地址`];
return [false, t('views.mmlManage.requireIpv6', { display })];
}
break;
case 'enum':
@@ -167,7 +167,7 @@ function ruleVerification(
}
if (!Object.keys(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的枚举值`];
return [false, t('views.mmlManage.requireEnum', { display })];
}
}
break;
@@ -181,7 +181,7 @@ function ruleVerification(
}
if (!Object.values(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的布尔类型的值`];
return [false, t('views.mmlManage.requireBool', { display })];
}
}
break;
@@ -193,7 +193,7 @@ function ruleVerification(
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$'
);
if (!rule.test(value)) {
return [false, `${display} 参数值不合理`];
return [false, t('views.mmlManage.requireString', { display })];
}
} catch (error) {
console.error(error);
@@ -206,7 +206,7 @@ function ruleVerification(
try {
let regex = new RegExp(filter);
if (!regex.test(value)) {
return [false, `${display} 参数值不合理`];
return [false, t('views.mmlManage.requireString', { display })];
}
} catch (error) {
console.error(error);
@@ -215,7 +215,7 @@ function ruleVerification(
break;
default:
return [false, `${display} 输入值是未知类型`];
return [false, t('views.mmlManage.requireUn', { display })];
}
return result;
}
@@ -275,7 +275,7 @@ function fnGetList() {
state.mmlTreeData = treeArr;
} else {
message.warning({
content: `${neType} 无可选命令操作`,
content: t('views.mmlManage.cmdNoTip', { num: neType }),
duration: 2,
});
}
@@ -305,7 +305,7 @@ onMounted(() => {
}
} else {
message.warning({
content: 'No Data',
content: t('common.noData'),
duration: 2,
});
}
@@ -318,7 +318,11 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :span="6">
<!-- 命令导航 -->
<a-card size="small" :bordered="false" title="命令导航">
<a-card
size="small"
:bordered="false"
:title="t('views.mmlManage.cmdTitle')"
>
<a-form layout="vertical" autocomplete="off">
<a-form-item name="neType">
<a-cascader
@@ -326,7 +330,7 @@ onMounted(() => {
:options="neCascaderOtions"
@change="fnNeChange"
:allow-clear="false"
placeholder="请选择网元"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
<a-form-item name="listeningPort">
@@ -350,7 +354,7 @@ onMounted(() => {
{{ state.mmlSelect.title }}
</a-typography-text>
<a-typography-text type="danger" v-else>
左侧命令导航中选择要操作项
{{ t('views.mmlManage.cmdOpTip') }}
</a-typography-text>
</template>
<!-- 插槽-卡片右侧 -->
@@ -365,7 +369,7 @@ onMounted(() => {
<template #icon>
<ClearOutlined />
</template>
清除表单
{{ t('views.mmlManage.clearForm') }}
</a-button>
<a-button
type="primary"
@@ -377,7 +381,7 @@ onMounted(() => {
<template #icon>
<SendOutlined />
</template>
执行
{{ t('views.mmlManage.exec') }}
</a-button>
</a-space>
</template>
@@ -445,7 +449,7 @@ onMounted(() => {
<!-- 命令展示 -->
<a-card
title="控制台"
:title="t('views.mmlManage.cmdConsole')"
:bordered="false"
size="small"
:body-style="{ padding: 0 }"
@@ -463,7 +467,7 @@ onMounted(() => {
<template #icon>
<ClearOutlined />
</template>
清除日志
{{ t('views.mmlManage.clearLog') }}
</a-button>
</a-space>
</template>
@@ -472,7 +476,7 @@ onMounted(() => {
v-model:value="state.mmlCmdLog"
:disabled="true"
:editor-style="{ height: '500px !important' }"
placeholder="等待发送命令"
:placeholder="t('views.mmlManage.cmdAwait')"
></CodemirrorEdite>
</a-card>
</a-col>

View File

@@ -76,7 +76,7 @@ function fnSendMML() {
// 是否必填项且有效值
const notV = value === null || value === undefined || value === '';
if (item.optional === 'false' && notV) {
message.warning(`必填参数:${item.display}`, 2);
message.warning(t('views.mmlManage.require', { num: item.display }), 2);
return;
}
@@ -142,18 +142,18 @@ function ruleVerification(
const maxInt = parseInt(filterArr[1]);
const valueInt = parseInt(value);
if (valueInt < minInt || valueInt > maxInt) {
return [false, `${display} 参数值不在合理范围 ${filter}`];
return [false, t('views.mmlManage.requireInt', { display, filter })];
}
}
break;
case 'ipv4':
if (!regExpIPv4.test(value)) {
return [false, `${display} 不是合法的IPV4地址`];
return [false, t('views.mmlManage.requireIpv4', { display })];
}
break;
case 'ipv6':
if (!regExpIPv6.test(value)) {
return [false, `${display} 不是合法的IPV6地址`];
return [false, t('views.mmlManage.requireIpv6', { display })];
}
break;
case 'enum':
@@ -166,7 +166,7 @@ function ruleVerification(
}
if (!Object.keys(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的枚举值`];
return [false, t('views.mmlManage.requireEnum', { display })];
}
}
break;
@@ -180,7 +180,7 @@ function ruleVerification(
}
if (!Object.values(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的布尔类型的值`];
return [false, t('views.mmlManage.requireBool', { display })];
}
}
break;
@@ -192,7 +192,7 @@ function ruleVerification(
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$'
);
if (!rule.test(value)) {
return [false, `${display} 参数值不合理`];
return [false, t('views.mmlManage.requireString', { display })];
}
} catch (error) {
console.error(error);
@@ -205,7 +205,7 @@ function ruleVerification(
try {
let regex = new RegExp(filter);
if (!regex.test(value)) {
return [false, `${display} 参数值不合理`];
return [false, t('views.mmlManage.requireString', { display })];
}
} catch (error) {
console.error(error);
@@ -214,7 +214,7 @@ function ruleVerification(
break;
default:
return [false, `${display} 输入值是未知类型`];
return [false, t('views.mmlManage.requireUn', { display })];
}
return result;
}
@@ -286,13 +286,13 @@ onMounted(() => {
}
} else {
message.warning({
content: `暂无OMC网元`,
content: t('views.mmlManage.omcOperate.noOMC'),
duration: 5,
});
}
} else {
message.warning({
content: `暂无网元列表数据`,
content: t('common.noData'),
duration: 2,
});
}
@@ -308,7 +308,7 @@ onMounted(() => {
<a-card
size="small"
:bordered="false"
title="命令导航"
:title="t('views.mmlManage.cmdTitle')"
:loading="state.mmlLoading"
>
<a-form layout="vertical" autocomplete="off">
@@ -316,7 +316,7 @@ onMounted(() => {
<a-select
v-model:value="state.neId"
:options="neOtions"
placeholder="请选择OMC操作命令"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
<a-form-item name="listeningPort">
@@ -340,7 +340,7 @@ onMounted(() => {
{{ state.mmlSelect.title }}
</a-typography-text>
<a-typography-text type="danger" v-else>
左侧命令导航中选择要操作项
{{ t('views.mmlManage.cmdOpTip') }}
</a-typography-text>
</template>
<!-- 插槽-卡片右侧 -->
@@ -355,7 +355,7 @@ onMounted(() => {
<template #icon>
<ClearOutlined />
</template>
清除表单
{{ t('views.mmlManage.clearForm') }}
</a-button>
<a-button
type="primary"
@@ -367,7 +367,7 @@ onMounted(() => {
<template #icon>
<SendOutlined />
</template>
执行
{{ t('views.mmlManage.exec') }}
</a-button>
</a-space>
</template>
@@ -435,7 +435,7 @@ onMounted(() => {
<!-- 命令展示 -->
<a-card
title="控制台"
:title="t('views.mmlManage.cmdConsole')"
:bordered="false"
size="small"
:body-style="{ padding: 0 }"
@@ -453,7 +453,7 @@ onMounted(() => {
<template #icon>
<ClearOutlined />
</template>
清除日志
{{ t('views.mmlManage.clearLog') }}
</a-button>
</a-space>
</template>
@@ -462,7 +462,7 @@ onMounted(() => {
v-model:value="state.mmlCmdLog"
:disabled="true"
:editor-style="{ height: '500px !important' }"
placeholder="等待发送命令"
:placeholder="t('views.mmlManage.cmdAwait')"
></CodemirrorEdite>
</a-card>
</a-col>

View File

@@ -76,7 +76,7 @@ function fnSendMML() {
// 是否必填项且有效值
const notV = value === null || value === undefined || value === '';
if (item.optional === 'false' && notV) {
message.warning(`必填参数:${item.display}`, 2);
message.warning(t('views.mmlManage.require', { num: item.display }), 2);
return;
}
@@ -142,18 +142,18 @@ function ruleVerification(
const maxInt = parseInt(filterArr[1]);
const valueInt = parseInt(value);
if (valueInt < minInt || valueInt > maxInt) {
return [false, `${display} 参数值不在合理范围 ${filter}`];
return [false, t('views.mmlManage.requireInt', { display, filter })];
}
}
break;
case 'ipv4':
if (!regExpIPv4.test(value)) {
return [false, `${display} 不是合法的IPV4地址`];
return [false, t('views.mmlManage.requireIpv4', { display })];
}
break;
case 'ipv6':
if (!regExpIPv6.test(value)) {
return [false, `${display} 不是合法的IPV6地址`];
return [false, t('views.mmlManage.requireIpv6', { display })];
}
break;
case 'enum':
@@ -166,7 +166,7 @@ function ruleVerification(
}
if (!Object.keys(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的枚举值`];
return [false, t('views.mmlManage.requireEnum', { display })];
}
}
break;
@@ -180,7 +180,7 @@ function ruleVerification(
}
if (!Object.values(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的布尔类型的值`];
return [false, t('views.mmlManage.requireBool', { display })];
}
}
break;
@@ -192,7 +192,7 @@ function ruleVerification(
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$'
);
if (!rule.test(value)) {
return [false, `${display} 参数值不合理`];
return [false, t('views.mmlManage.requireString', { display })];
}
} catch (error) {
console.error(error);
@@ -205,7 +205,7 @@ function ruleVerification(
try {
let regex = new RegExp(filter);
if (!regex.test(value)) {
return [false, `${display} 参数值不合理`];
return [false, t('views.mmlManage.requireString', { display })];
}
} catch (error) {
console.error(error);
@@ -214,7 +214,7 @@ function ruleVerification(
break;
default:
return [false, `${display} 输入值是未知类型`];
return [false, t('views.mmlManage.requireUn', { display })];
}
return result;
}
@@ -286,13 +286,13 @@ onMounted(() => {
}
} else {
message.warning({
content: `暂无UDM网元`,
content: t('views.mmlManage.udmOpesrate.noUDM'),
duration: 5,
});
}
} else {
message.warning({
content: `暂无网元列表数据`,
content: t('common.noData'),
duration: 2,
});
}
@@ -308,7 +308,7 @@ onMounted(() => {
<a-card
size="small"
:bordered="false"
title="命令导航"
:title="t('views.mmlManage.cmdTitle')"
:loading="state.mmlLoading"
>
<a-form layout="vertical" autocomplete="off">
@@ -316,7 +316,7 @@ onMounted(() => {
<a-select
v-model:value="state.neId"
:options="neOtions"
placeholder="请选择UDM操作命令"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
<a-form-item name="listeningPort">
@@ -340,7 +340,7 @@ onMounted(() => {
{{ state.mmlSelect.title }}
</a-typography-text>
<a-typography-text type="danger" v-else>
左侧命令导航中选择要操作项
{{ t('views.mmlManage.cmdOpTip') }}
</a-typography-text>
</template>
<!-- 插槽-卡片右侧 -->
@@ -355,7 +355,7 @@ onMounted(() => {
<template #icon>
<ClearOutlined />
</template>
清除表单
{{ t('views.mmlManage.clearForm') }}
</a-button>
<a-button
type="primary"
@@ -367,7 +367,7 @@ onMounted(() => {
<template #icon>
<SendOutlined />
</template>
执行
{{ t('views.mmlManage.exec') }}
</a-button>
</a-space>
</template>
@@ -435,7 +435,7 @@ onMounted(() => {
<!-- 命令展示 -->
<a-card
title="控制台"
:title="t('views.mmlManage.cmdConsole')"
:bordered="false"
size="small"
:body-style="{ padding: 0 }"
@@ -453,7 +453,7 @@ onMounted(() => {
<template #icon>
<ClearOutlined />
</template>
清除日志
{{ t('views.mmlManage.clearLog') }}
</a-button>
</a-space>
</template>
@@ -462,7 +462,7 @@ onMounted(() => {
v-model:value="state.mmlCmdLog"
:disabled="true"
:editor-style="{ height: '500px !important' }"
placeholder="等待发送命令"
:placeholder="t('views.mmlManage.cmdAwait')"
></CodemirrorEdite>
</a-card>
</a-col>