This commit is contained in:
Silent YANG 2024-05-12 11:39:33 +08:00
parent 6911c02cef
commit 31aa5c33b5
9 changed files with 76 additions and 18 deletions

View file

@ -23,6 +23,7 @@
import { ChatIcon, QrcodeIcon, FishIcon } from 'tdesign-icons-vue-next'; import { ChatIcon, QrcodeIcon, FishIcon } from 'tdesign-icons-vue-next';
import { computed, h } from 'vue'; import { computed, h } from 'vue';
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn'; import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
import GlobalSetting from '@/components/global-setting/index.vue'; import GlobalSetting from '@/components/global-setting/index.vue';
import useLocale from '@/hooks/locale'; import useLocale from '@/hooks/locale';
import Aegis from 'aegis-web-sdk'; import Aegis from 'aegis-web-sdk';
@ -66,7 +67,7 @@
case 'zh-CN': case 'zh-CN':
return zhCN; return zhCN;
default: default:
return zhCN; return enUS;
} }
}); });
</script> </script>

View file

@ -20,10 +20,39 @@
</div> </div>
<ul class="right-side"> <ul class="right-side">
<li> <li>
<t-link href="https://txc.qq.com/products/647342" target="_blank">问题反馈</t-link> <t-link href="https://txc.qq.com/products/647342" target="_blank">{{ $t('navbar.qa') }}</t-link>
</li> </li>
<li> <li>
<a-button type="primary" @click="connectIt">{{ appStore.connectState ? '断开' : '连接' }}</a-button> <a-button type="primary" @click="connectIt">{{ appStore.connectState ? $t('navbar.disconnect') : $t('navbar.connect') }}</a-button>
</li>
<li>
<a-tooltip :content="$t('settings.language')">
<a-button
class="nav-btn"
type="outline"
:shape="'circle'"
@click="setDropDownVisible"
>
<template #icon>
<icon-language />
</template>
</a-button>
</a-tooltip>
<a-dropdown trigger="click" @select="changeLocale as any">
<div ref="triggerBtn" class="trigger-btn"></div>
<template #content>
<a-doption
v-for="item in locales"
:key="item.value"
:value="item.value"
>
<template #icon>
<icon-check v-show="item.value === currentLocale" />
</template>
{{ item.label }}
</a-doption>
</template>
</a-dropdown>
</li> </li>
<li> <li>
<a-tooltip <a-tooltip

View file

@ -29,11 +29,13 @@ import localeUserSetting from '@/views/user/setting/locale/en-US';
import localeSettings from './en-US/settings'; import localeSettings from './en-US/settings';
export default { export default {
'menu.dashboard': 'Dashboard', 'menu.dashboard': 'CPS',
'menu.cps.channel': 'Channel',
'menu.cps.settings': 'Settings',
'menu.server.dashboard': 'Dashboard-Server', 'menu.server.dashboard': 'Dashboard-Server',
'menu.server.workplace': 'Workplace-Server', 'menu.server.workplace': 'Workplace-Server',
'menu.server.monitor': 'Monitor-Server', 'menu.server.monitor': 'Monitor-Server',
'menu.list': 'List', 'menu.list': 'Tools',
'menu.result': 'Result', 'menu.result': 'Result',
'menu.exception': 'Exception', 'menu.exception': 'Exception',
'menu.form': 'Form', 'menu.form': 'Form',
@ -44,6 +46,10 @@ export default {
'menu.faq': 'FAQ', 'menu.faq': 'FAQ',
'navbar.docs': 'Docs', 'navbar.docs': 'Docs',
'navbar.action.locale': 'Switch to English', 'navbar.action.locale': 'Switch to English',
'navbar.author': 'Author: BD8DFN',
'navbar.connect': 'Connect',
'navbar.disconnect': 'Disconnect',
'navbar.qa': 'Feedback',
...localeSettings, ...localeSettings,
...localeMessageBox, ...localeMessageBox,
...localeLogin, ...localeLogin,

View file

@ -30,6 +30,8 @@ import localeSettings from './zh-CN/settings';
export default { export default {
'menu.dashboard': '写频', 'menu.dashboard': '写频',
'menu.cps.channel': '信道管理',
'menu.cps.settings': '设置管理',
'menu.server.dashboard': '仪表盘-服务端', 'menu.server.dashboard': '仪表盘-服务端',
'menu.server.workplace': '工作台-服务端', 'menu.server.workplace': '工作台-服务端',
'menu.server.monitor': '实时监控-服务端', 'menu.server.monitor': '实时监控-服务端',
@ -44,6 +46,10 @@ export default {
'menu.faq': '常见问题', 'menu.faq': '常见问题',
'navbar.docs': '文档中心', 'navbar.docs': '文档中心',
'navbar.action.locale': '切换为中文', 'navbar.action.locale': '切换为中文',
'navbar.author': '作者BD8DFN',
'navbar.connect': '连接',
'navbar.disconnect': '断开',
'navbar.qa': '问题反馈',
...localeSettings, ...localeSettings,
...localeMessageBox, ...localeMessageBox,
...localeLogin, ...localeLogin,

View file

@ -1,8 +1,8 @@
export default { export default {
path: 'https://www.vicicode.com/', path: 'https://www.vicicode.com/',
name: '作者:BD8DFN', name: 'BD8DFN',
meta: { meta: {
locale: '作者BD8DFN', locale: 'navbar.author',
requiresAuth: true, requiresAuth: true,
order: 8, order: 8,
}, },

View file

@ -27,7 +27,7 @@ const DASHBOARD: AppRouteRecordRaw = {
name: 'Channel', name: 'Channel',
component: () => import('@/views/list/search-table/index.vue'), component: () => import('@/views/list/search-table/index.vue'),
meta: { meta: {
locale: '信道管理', locale: 'menu.cps.channel',
requiresAuth: true, requiresAuth: true,
roles: ['*'], roles: ['*'],
}, },
@ -37,7 +37,7 @@ const DASHBOARD: AppRouteRecordRaw = {
name: 'Settings', name: 'Settings',
component: () => import('@/views/list/settings/index.vue'), component: () => import('@/views/list/settings/index.vue'),
meta: { meta: {
locale: '设置管理', locale: 'menu.cps.settings',
requiresAuth: true, requiresAuth: true,
roles: ['*'], roles: ['*'],
}, },

View file

@ -2,15 +2,15 @@
<a-col class="banner"> <a-col class="banner">
<a-col> <a-col>
<a-typography-title :heading="5" style="margin-top: 0"> <a-typography-title :heading="5" style="margin-top: 0">
{{ appStore.connectState ? "欢迎你~,连接成功!" : "欢迎你~,点击右上角“连接”按钮连接手台。" }} {{ appStore.connectState ? $t('workplace.welcomeSuc') : $t('workplace.welcome') }}
</a-typography-title> </a-typography-title>
</a-col> </a-col>
<a-divider class="panel-border" /> <a-divider class="panel-border" />
<a-space> <a-space>
<a-card v-show="appStore.connectState" :style="{ marginTop: '2em', marginBottom: '2em' }" title="手台信息"> <a-card v-show="appStore.connectState" :style="{ marginTop: '2em', marginBottom: '2em' }" :title="$t('workplace.info')">
当前固件版本{{ appStore.firmwareVersion }} <br /> {{ $t('workplace.current') }}{{ appStore.firmwareVersion }} <br />
匹配写频配置{{ appStore.configuration?.name }} <br /> {{ $t('workplace.writeconfig') }}{{ appStore.configuration?.name }} <br />
存储大小{{ state.eepromSize }} <a-button size="mini" type="primary" @click="checkEeprom">检测</a-button> {{ $t('workplace.eepromSize') }}{{ state.eepromSize }} <a-button size="mini" type="primary" @click="checkEeprom">{{ $t('workplace.checkIt') }}</a-button>
</a-card> </a-card>
</a-space> </a-space>
<div> <div>
@ -23,11 +23,13 @@
import { reactive } from 'vue'; import { reactive } from 'vue';
import { useAppStore } from '@/store'; import { useAppStore } from '@/store';
import { eeprom_write, eeprom_reboot, eeprom_init, eeprom_read } from '@/utils/serial.js'; import { eeprom_write, eeprom_reboot, eeprom_init, eeprom_read } from '@/utils/serial.js';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const appStore = useAppStore(); const appStore = useAppStore();
const state = reactive({ const state = reactive({
eepromSize: "点击检测按钮检测" eepromSize: t('workplace.clickCheck')
}) })
const checkEeprom = async () => { const checkEeprom = async () => {

View file

@ -1,6 +1,13 @@
export default { export default {
'menu.dashboard.workplace': 'Workplace', 'menu.dashboard.workplace': 'Basic Information',
'workplace.welcome': 'Welcome!', 'workplace.welcome': 'Welcome~, click the "Connect" button in the upper right corner to connect the UV-K5.',
'workplace.welcomeSuc': 'Welcome~, connection successful.',
'workplace.info': 'Information',
'workplace.current': 'Current Firmware Version: ',
'workplace.writeconfig': 'Write Configuration: ',
'workplace.eepromSize': 'EEPROM Size: ',
'workplace.clickCheck': 'Click the TEST button to test',
'workplace.checkIt': 'TEST',
'workplace.balance': 'Balance (CNY)', 'workplace.balance': 'Balance (CNY)',
'workplace.order.pending': 'Pending', 'workplace.order.pending': 'Pending',
'workplace.order.pendingRenewal': 'Renewal Order', 'workplace.order.pendingRenewal': 'Renewal Order',

View file

@ -1,6 +1,13 @@
export default { export default {
'menu.dashboard.workplace': '基础信息', 'menu.dashboard.workplace': '基础信息',
'workplace.welcome': '欢迎回来!', 'workplace.welcome': '欢迎你~,点击右上角“连接”按钮连接手台。',
'workplace.welcomeSuc': '欢迎你~,连接成功!',
'workplace.info': '手台信息',
'workplace.current': '当前固件版本:',
'workplace.writeconfig': '匹配写频配置:',
'workplace.eepromSize': '存储大小:',
'workplace.clickCheck': '点击检测按钮检测',
'workplace.checkIt': '检测',
'workplace.balance': '余额(元)', 'workplace.balance': '余额(元)',
'workplace.order.pending': '待支付', 'workplace.order.pending': '待支付',
'workplace.order.pendingRenewal': '待续费订单', 'workplace.order.pendingRenewal': '待续费订单',