-
+
@@ -27,7 +27,8 @@ import { SearchIcon } from 'tdesign-icons-vue-next';
import type { TreeNodeModel } from 'tdesign-vue-next';
import { ref } from 'vue';
-import CommonTable from '../components/CommonTable.vue';
+import CommonTable from '@/components/common-table/index.vue';
+
import { TREE_DATA } from './constants';
const filterByText = ref();
diff --git a/src/pages/login/components/Login.vue b/src/pages/login/components/Login.vue
index 3cd90b9..cf55f87 100644
--- a/src/pages/login/components/Login.vue
+++ b/src/pages/login/components/Login.vue
@@ -9,7 +9,7 @@
>
-
+
@@ -22,7 +22,7 @@
size="large"
:type="showPsw ? 'text' : 'password'"
clearable
- placeholder="请输入登录密码:admin"
+ :placeholder="`${$t('pages.login.input.password')}:admin`"
>
@@ -34,16 +34,16 @@
- 记住账号
- 忘记账号?
+ {{ $t('pages.login.remember') }}
+ {{ $t('pages.login.forget') }}
- 请使用微信扫一扫登录
- 刷新
+ {{ $t('pages.login.wechatLogin') }}
+ {{ $t('pages.login.refresh') }}
@@ -51,7 +51,7 @@
-
+
@@ -59,21 +59,25 @@
-
+
- {{ countDown == 0 ? '发送验证码' : `${countDown}秒后可重发` }}
+ {{ countDown == 0 ? $t('pages.login.sendVerification') : `${countDown}秒后可重发` }}
- 登录
+ {{ $t('pages.login.signIn') }}
- 使用账号密码登录
- 使用微信扫码登录
- 使用手机号登录
+ {{
+ $t('pages.login.accountLogin')
+ }}
+ {{
+ $t('pages.login.wechatLogin')
+ }}
+ {{ $t('pages.login.phoneLogin') }}
@@ -86,6 +90,7 @@ import { ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useCounter } from '@/hooks';
+import { t } from '@/locales';
import { useUserStore } from '@/store';
const userStore = useUserStore();
@@ -99,10 +104,10 @@ const INITIAL_DATA = {
};
const FORM_RULES: Record = {
- phone: [{ required: true, message: '手机号必填', type: 'error' }],
- account: [{ required: true, message: '账号必填', type: 'error' }],
- password: [{ required: true, message: '密码必填', type: 'error' }],
- verifyCode: [{ required: true, message: '验证码必填', type: 'error' }],
+ phone: [{ required: true, message: t('pages.login.required.phone'), type: 'error' }],
+ account: [{ required: true, message: t('pages.login.required.account'), type: 'error' }],
+ password: [{ required: true, message: t('pages.login.required.password'), type: 'error' }],
+ verifyCode: [{ required: true, message: t('pages.login.required.verification'), type: 'error' }],
};
const type = ref('password');
@@ -149,5 +154,5 @@ const onSubmit = async (ctx: SubmitContext) => {
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index 4332d3e..b7b0144 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -4,12 +4,12 @@
-
登录到
+
{{ $t('pages.login.loginTitle') }}
TDesign Starter
-
{{ type == 'register' ? '已有账号?' : '没有账号吗?' }}
+
{{ type == 'register' ? $t('pages.login.existAccount') : $t('pages.login.noAccount') }}
- {{ type == 'register' ? '登录' : '注册新账号' }}
+ {{ type == 'register' ? $t('pages.login.signIn') : $t('pages.login.createAccount') }}
@@ -19,7 +19,7 @@
-
+
diff --git a/src/pages/result/403/index.vue b/src/pages/result/403/index.vue
index 77e2433..802af00 100644
--- a/src/pages/result/403/index.vue
+++ b/src/pages/result/403/index.vue
@@ -1,6 +1,6 @@
-
- $router.push('/')">返回首页
+
+ $router.push('/')">{{ $t('pages.result.403.back') }}
diff --git a/src/router/modules/homepage.ts b/src/router/modules/homepage.ts
index 6264a48..883738a 100644
--- a/src/router/modules/homepage.ts
+++ b/src/router/modules/homepage.ts
@@ -10,7 +10,10 @@ export default [
redirect: '/dashboard/base',
name: 'dashboard',
meta: {
- title: '仪表盘',
+ title: {
+ zh_CN: '仪表盘',
+ en_US: 'Dashboard',
+ },
icon: shallowRef(DashboardIcon),
orderNo: 0,
},
@@ -20,7 +23,10 @@ export default [
name: 'DashboardBase',
component: () => import('@/pages/dashboard/base/index.vue'),
meta: {
- title: '概览仪表盘',
+ title: {
+ zh_CN: '概览仪表盘',
+ en_US: 'Overview',
+ },
},
},
{
@@ -28,7 +34,10 @@ export default [
name: 'DashboardDetail',
component: () => import('@/pages/dashboard/detail/index.vue'),
meta: {
- title: '统计报表',
+ title: {
+ zh_CN: '统计报表',
+ en_US: 'Dashboard Detail',
+ },
},
},
],
diff --git a/src/router/modules/result.ts b/src/router/modules/result.ts
index 07506f2..0cc0f38 100644
--- a/src/router/modules/result.ts
+++ b/src/router/modules/result.ts
@@ -6,55 +6,76 @@ export default [
name: 'result',
component: Layout,
redirect: '/result/success',
- meta: { title: '结果页', icon: 'check-circle' },
+ meta: {
+ title: {
+ zh_CN: '结果页',
+ en_US: 'Result',
+ },
+ icon: 'check-circle',
+ },
children: [
{
path: 'success',
name: 'ResultSuccess',
component: () => import('@/pages/result/success/index.vue'),
- meta: { title: '成功页' },
+ meta: {
+ title: {
+ zh_CN: '成功页',
+ en_US: 'Success',
+ },
+ },
},
{
path: 'fail',
name: 'ResultFail',
component: () => import('@/pages/result/fail/index.vue'),
- meta: { title: '失败页' },
+ meta: {
+ title: {
+ zh_CN: '失败页',
+ en_US: 'Fail',
+ },
+ },
},
{
path: 'network-error',
name: 'ResultNetworkError',
component: () => import('@/pages/result/network-error/index.vue'),
- meta: { title: '网络异常' },
+ meta: {
+ title: {
+ zh_CN: '网络异常',
+ en_US: 'Network Error',
+ },
+ },
},
{
path: '403',
name: 'Result403',
component: () => import('@/pages/result/403/index.vue'),
- meta: { title: '无权限' },
+ meta: { title: { zh_CN: '无权限', en_US: 'Forbidden' } },
},
{
path: '404',
name: 'Result404',
component: () => import('@/pages/result/404/index.vue'),
- meta: { title: '访问页面不存在页' },
+ meta: { title: { zh_CN: '访问页面不存在页', en_US: 'Not Found' } },
},
{
path: '500',
name: 'Result500',
component: () => import('@/pages/result/500/index.vue'),
- meta: { title: '服务器出错页' },
+ meta: { title: { zh_CN: '服务器出错页', en_US: 'Server Error' } },
},
{
path: 'browser-incompatible',
name: 'ResultBrowserIncompatible',
component: () => import('@/pages/result/browser-incompatible/index.vue'),
- meta: { title: '浏览器不兼容页' },
+ meta: { title: { zh_CN: '浏览器不兼容页', en_US: 'BrowserIncompatible' } },
},
{
path: 'maintenance',
name: 'ResultMaintenance',
component: () => import('@/pages/result/maintenance/index.vue'),
- meta: { title: '系统维护页' },
+ meta: { title: { zh_CN: '系统维护页', en_US: 'Maintenance' } },
},
],
},
diff --git a/src/router/modules/user.ts b/src/router/modules/user.ts
index 479474a..df99231 100644
--- a/src/router/modules/user.ts
+++ b/src/router/modules/user.ts
@@ -9,13 +9,13 @@ export default [
name: 'user',
component: Layout,
redirect: '/user/index',
- meta: { title: '个人页', icon: 'user-circle' },
+ meta: { title: { zh_CN: '个人中心', en_US: 'User Center' }, icon: 'user-circle' },
children: [
{
path: 'index',
name: 'UserIndex',
component: () => import('@/pages/user/index.vue'),
- meta: { title: '个人中心' },
+ meta: { title: { zh_CN: '个人中心', en_US: 'User Center' } },
},
],
},
@@ -23,14 +23,14 @@ export default [
path: '/loginRedirect',
name: 'loginRedirect',
redirect: '/login',
- meta: { title: '登录页', icon: shallowRef(LogoutIcon) },
+ meta: { title: { zh_CN: '登录页', en_US: 'Login' }, icon: shallowRef(LogoutIcon) },
component: () => import('@/layouts/blank.vue'),
children: [
{
path: 'index',
redirect: '/login',
component: () => import('@/layouts/blank.vue'),
- meta: { title: '登录中心' },
+ meta: { title: { zh_CN: '登录页', en_US: 'Login' } },
},
],
},