2
0

feat:配置参数问题修复,中英文适配

This commit is contained in:
zhongzm
2025-06-12 17:25:30 +08:00
parent c9b4e430e9
commit d0cca3bbfb
3 changed files with 37 additions and 11 deletions

View File

@@ -691,6 +691,14 @@ const local: any = {
retail:'Retail',
other:'Other',
updateSuccess:'Update Success',
wireless:'Wireless Features',
autoFailover:'Auto Failover',
conDetection:'Connectivity Detection',
autoRec:'AutoRecommended',
custom:'Custom',
fastRoaming:'Fast Roaming',
aiRoaming:'AI Roaming'
},
headerbanner:{
controller:'Controller Overview',

View File

@@ -691,6 +691,14 @@ const local:any = {
retail:'零售业',
other:'其他',
updateSuccess:'更新成功',
wireless:'无线功能',
autoFailover:'自动恢复',
conDetection:'连接检测',
autoRec:'自动(建议选项)',
custom:'自定义',
fastRoaming:'快速漫游',
aiRoaming:'AI漫游'
},
headerbanner:{
controller:'控制仪表盘',

View File

@@ -60,7 +60,7 @@ const { validate, validateInfos } = useForm(formData, {
'deviceAccountSetting.password': [
{ required: true, message: t('page.carddata.passwordRequired') },
{
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\!\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\@\[\\\]\^\_\`\{\|\}\~])(?!.*[\00-\040\042\077\0177]).{8,64}$/,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!#\$%&'\(\)\*\+,\-\.\/\:;\<\=\>\@\[\\\]\^_`\{\|\}\~])(?!.*[\x00-\x20\x22\x3f\x0f7]).{8,64}$/,
message: t('page.carddata.passwordInvalid')
}
]
@@ -254,6 +254,7 @@ const editFormData = ref({
autoFailoverEnable: false,
defGatewayEnable: true,
gateway: '',
fullSector: false,
fastRoamingEnable: false,
nonStickRoamingEnable: false,
aiRoamingEnable: false
@@ -291,11 +292,11 @@ function joinGatewayIp(parts: string[]) {
}
// 弹窗打开时同步分段
watch(() => editFormData.value.gateway, (val) => {
watch(() => editFormData.value.gateway, (val: any) => {
gatewayIpParts.value = splitGatewayIp(val);
}, { immediate: true });
// 分段输入时同步到gateway
watch(gatewayIpParts, (val) => {
watch(gatewayIpParts, (val: any) => {
editFormData.value.gateway = joinGatewayIp(val);
}, { deep: true });
@@ -318,6 +319,7 @@ const handleEdit = async (record: Api.DashboardSite) => {
autoFailoverEnable: meshRes.data?.mesh?.autoFailoverEnable ?? false,
defGatewayEnable: meshRes.data?.mesh?.defGatewayEnable ?? true,
gateway: meshRes.data?.mesh?.gateway ?? '',
fullSector: meshRes.data?.mesh?.fullSector ?? false,
fastRoamingEnable: roamingRes.data?.roaming?.fastRoamingEnable ?? false,
nonStickRoamingEnable: roamingRes.data?.roaming?.nonStickRoamingEnable ?? false,
aiRoamingEnable: roamingRes.data?.roaming?.aiRoamingEnable ?? false
@@ -342,11 +344,12 @@ const handleUpdateSite = async () => {
timeZone: editFormData.value.timeZone,
scenario: editFormData.value.scenario
});
// mesh 配置为嵌套结构meshEnable为true时才携带defGatewayEnablegateway
// mesh 配置为嵌套结构meshEnable为true时才携带defGatewayEnablegateway、fullSector
const meshData: any = { mesh: { meshEnable: editFormData.value.meshEnable } };
if (editFormData.value.meshEnable) {
meshData.mesh.autoFailoverEnable = editFormData.value.autoFailoverEnable;
meshData.mesh.defGatewayEnable = editFormData.value.defGatewayEnable;
meshData.mesh.fullSector = editFormData.value.fullSector;
if (editFormData.value.defGatewayEnable === false) {
meshData.mesh.gateway = editFormData.value.gateway;
}
@@ -356,6 +359,9 @@ const handleUpdateSite = async () => {
if (editFormData.value.fastRoamingEnable) {
roamingData.roaming.nonStickRoamingEnable = editFormData.value.nonStickRoamingEnable;
roamingData.roaming.aiRoamingEnable = editFormData.value.aiRoamingEnable;
}else {
roamingData.roaming.nonStickRoamingEnable=false;
roamingData.roaming.aiRoamingEnable = false;
}
await Promise.all([
updateMeshConfig(currentEditSiteId.value, meshData),
@@ -550,7 +556,7 @@ const handleUpdateSite = async () => {
<AForm
:model="editFormData"
:label-col="{ span: 6 }"
:wrapper-col="{ span: 18 }"
:wrapper-col="{ span: 24 }"
>
<AFormItem
name="name"
@@ -600,14 +606,15 @@ const handleUpdateSite = async () => {
</AFormItem>
<a-divider />
<div style="margin-bottom: 8px; font-weight: bold;">组网配置</div>
<div style="margin-bottom: 8px; font-weight: bold;">{{ t('page.carddata.wireless') }}</div>
<AFormItem>
<a-checkbox v-model:checked="editFormData.meshEnable">Mesh</a-checkbox>
</AFormItem>
<AFormItem v-if="editFormData.meshEnable" style="margin-left: 24px;">
{{t('page.carddata.conDetection')}}
<ASelect v-model:value="editFormData.defGatewayEnable" style="width: 200px;">
<ASelectOption :value="true">AutoRecommended</ASelectOption>
<ASelectOption :value="false">Custom</ASelectOption>
<ASelectOption :value="true">{{ t('page.carddata.autoRec') }}</ASelectOption>
<ASelectOption :value="false">{{ t('page.carddata.custom') }}</ASelectOption>
</ASelect>
<template v-if="editFormData.defGatewayEnable === false">
<div style="display: inline-flex; align-items: center; margin-left: 12px;">
@@ -617,16 +624,19 @@ const handleUpdateSite = async () => {
</template>
</AFormItem>
<AFormItem v-if="editFormData.meshEnable" style="margin-left: 24px;">
<a-checkbox v-model:checked="editFormData.autoFailoverEnable">Auto Failover</a-checkbox>
<a-checkbox v-model:checked="editFormData.autoFailoverEnable">{{ t('page.carddata.autoFailover') }}</a-checkbox>
</AFormItem>
<AFormItem v-if="editFormData.meshEnable" style="margin-left: 24px;">
<a-checkbox v-model:checked="editFormData.fullSector">Full-Sector DFS</a-checkbox>
</AFormItem>
<AFormItem>
<a-checkbox v-model:checked="editFormData.fastRoamingEnable">Fast Roaming</a-checkbox>
<a-checkbox v-model:checked="editFormData.fastRoamingEnable">{{ t('page.carddata.fastRoaming') }}</a-checkbox>
</AFormItem>
<AFormItem v-if="editFormData.fastRoamingEnable" style="margin-left: 24px;">
<a-checkbox v-model:checked="editFormData.nonStickRoamingEnable">Non-Stick Roaming</a-checkbox>
</AFormItem>
<AFormItem v-if="editFormData.fastRoamingEnable" style="margin-left: 24px;">
<a-checkbox v-model:checked="editFormData.aiRoamingEnable">AI Roaming</a-checkbox>
<a-checkbox v-model:checked="editFormData.aiRoamingEnable">{{ t('page.carddata.aiRoaming') }}</a-checkbox>
</AFormItem>
</AForm>
</AModal>