2
0

fix:AP设备界面中英适配

This commit is contained in:
zhongzm
2025-02-07 18:30:15 +08:00
parent a974a042b0
commit 5b4f4b4ae1
4 changed files with 53 additions and 17 deletions

View File

@@ -698,6 +698,23 @@ const local: any = {
reset:'Reset',
search:'Search',
},
apdevice:{
aptitle:'AP Device Management',
online:'Online',
outline:'Offline',
apname:'Device Name',
ip:'IP',
mac:'MAC',
model:'Model',
uptime:'Online Time',
status:'Status',
total:'Total',
pledevice:'Please enter device name',
plemac:'Please enter MAC address',
search:'Search',
reset:'Reset',
},
},
form: {
required: 'Cannot be empty',

View File

@@ -698,6 +698,23 @@ const local:any = {
reset:'重置',
search:'查询',
},
apdevice:{
aptitle:'AP设备管理',
online:'在线',
outline:'离线',
apname:'设备名称',
ip:'IP地址',
mac:'MAC地址',
model:'型号',
uptime:'在线时间',
status:'状态',
total:'共',
pledevice:'请输入设备名称',
plemac:'请输入MAC地址',
search:'搜索',
reset:'重置',
},
},
form: {
required: '不能为空',

View File

@@ -8,7 +8,7 @@
@search="handleSearch"
/>
<ACard
title="AP设备管理"
:title="t('page.apdevice.aptitle')"
:bordered="false"
:body-style="{ flex: 1, overflow: 'hidden' }"
class="flex-col-stretch sm:flex-1-hidden card-wrapper"
@@ -35,7 +35,7 @@
total: mobilePagination.total,
current: searchParams.pageNum,
pageSize: searchParams.pageSize,
showTotal: (total: number) => ` ${total} `
showTotal: (total: number) => `${t('page.apdevice.total')} ${total} `
}"
:scroll="scrollConfig"
class="h-full"
@@ -48,7 +48,7 @@
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<ATag :color="record.status === 1 ? 'success' : 'error'">
{{ record.status === 1 ? '在线' : '离线' }}
{{ record.status === 1 ? t('page.apdevice.online') : t('page.apdevice.outline') }}
</ATag>
</template>
</template>
@@ -66,7 +66,8 @@ import { useElementSize } from '@vueuse/core';
import { fetchApDeviceList } from '@/service/api/auth';
import { Card as ACard, Table as ATable, Tag as ATag } from 'ant-design-vue';
import DeviceSearch from './modules/device-search.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const wrapperEl = shallowRef<HTMLElement | null>(null);
const { height: wrapperElHeight } = useElementSize(wrapperEl);
@@ -121,42 +122,42 @@ const {
{
key: 'name',
dataIndex: 'name',
title: '设备名称',
title: t('page.apdevice.apname'),
align: 'center',
width: 150
},
{
key: 'publicIp',
dataIndex: 'publicIp',
title: 'IP地址',
title: t('page.apdevice.ip'),
align: 'center',
width: 150
},
{
key: 'mac',
dataIndex: 'mac',
title: 'MAC地址',
title: t('page.apdevice.mac'),
align: 'center',
width: 180
},
{
key: 'model',
dataIndex: 'model',
title: '型号',
title: t('page.apdevice.model'),
align: 'center',
width: 150
},
{
key: 'uptime',
dataIndex: 'uptime',
title: '在线时间',
title: t('page.apdevice.uptime'),
align: 'center',
width: 180
},
{
key: 'status',
dataIndex: 'status',
title: '状态',
title: t('page.apdevice.status'),
align: 'center',
width: 100
}

View File

@@ -1,19 +1,19 @@
<template>
<ACard :bordered="false" class="search-card">
<AForm layout="inline">
<AFormItem label="设备名称">
<AFormItem :label="t('page.apdevice.apname')">
<AInput
v-model:value="model.name"
placeholder="请输入设备名称"
:placeholder="t('page.apdevice.pledevice')"
allow-clear
class="w-200px"
@pressEnter="search"
/>
</AFormItem>
<AFormItem label="MAC地址">
<AFormItem :label="t('page.apdevice.mac')">
<AInput
v-model:value="model.mac"
placeholder="请输入MAC地址"
:placeholder="t('page.apdevice.plemac')"
allow-clear
class="w-200px"
@pressEnter="search"
@@ -25,13 +25,13 @@
<template #icon>
<icon-mdi-search />
</template>
搜索
{{ t('page.apdevice.search') }}
</AButton>
<AButton @click="reset">
<template #icon>
<icon-mdi-refresh />
</template>
重置
{{ t('page.apdevice.reset') }}
</AButton>
</ASpace>
</AFormItem>
@@ -41,7 +41,8 @@
<script setup lang="ts">
import { Form as AForm, FormItem as AFormItem, Input as AInput, Button as AButton, Space as ASpace, Card as ACard } from 'ant-design-vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
interface Props {
model: {
name?: string;