-
+
@@ -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 43339c7..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,24 +34,24 @@
- 记住账号
- 忘记账号?
+ {{ $t('pages.login.remember') }}
+ {{ $t('pages.login.forget') }}
-
+
- 请使用微信扫一扫登录
- 刷新
+ {{ $t('pages.login.wechatLogin') }}
+ {{ $t('pages.login.refresh') }}
-
+
-
+
@@ -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');
@@ -136,7 +141,7 @@ const onSubmit = async (ctx: SubmitContext) => {
try {
await userStore.login(formData.value);
- MessagePlugin.success('登陆成功');
+ MessagePlugin.success('登录成功');
const redirect = route.query.redirect as string;
const redirectUrl = redirect ? decodeURIComponent(redirect) : '/dashboard';
router.push(redirectUrl);
@@ -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/index.ts b/src/router/index.ts
index f5d6ac2..5076429 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -60,9 +60,11 @@ export const getRoutesExpanded = () => {
export const getActive = (maxLevel = 3): string => {
const route = useRoute();
+
if (!route.path) {
return '';
}
+
return route.path
.split('/')
.filter((_item: string, index: number) => index <= maxLevel && index > 0)
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' } },
},
],
},
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index fd70232..f68b4ed 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -42,7 +42,7 @@ export const useUserStore = defineStore('user', {
// }[password];
return {
code: 200,
- message: '登陆成功',
+ message: '登录成功',
data: 'main_token',
};
};
diff --git a/src/style/index.less b/src/style/index.less
index 7e37549..dfda36c 100644
--- a/src/style/index.less
+++ b/src/style/index.less
@@ -1,3 +1,2 @@
@import './font-family.less';
-
@import './reset.less';
diff --git a/src/style/layout.less b/src/style/layout.less
index e0e6e53..3e8f9bd 100644
--- a/src/style/layout.less
+++ b/src/style/layout.less
@@ -10,24 +10,20 @@
margin-left: var(--td-comp-margin-s);
}
+.t-transfer,
+.t-jumper,
.t-pagination-mini {
.t-button + .t-button {
margin-left: 0;
}
}
-.t-jumper {
- .t-button + .t-button {
- margin-left: 0;
- }
-}
-
.@{starter-prefix}-link {
color: var(--td-brand-color);
text-decoration: none;
margin-right: 24px;
cursor: pointer;
- transition: color .2s cubic-bezier(.38, 0, .24, 1);
+ transition: color 0.2s cubic-bezier(0.38, 0, 0.24, 1);
}
.left-operation-container,
@@ -45,7 +41,7 @@
}
.t-menu--dark .t-menu__operations .t-icon {
- color: rgba(255, 255, 255, 55%);
+ color: rgb(255 255 255 / 55%);
&:hover {
cursor: pointer;
@@ -129,7 +125,7 @@
top: 0;
bottom: 0;
z-index: 200;
- transition: all .3s;
+ transition: all 0.3s;
min-height: 100%;
&-mix {
@@ -176,19 +172,19 @@
&-logo-normal {
color: var(--td-brand-color);
font: var(--td-font-body-large);
- transition: all .3s;
+ transition: all 0.3s;
}
}
&-side-nav-placeholder {
flex: 1 1 232px;
min-width: 232px;
- transition: all .3s;
+ transition: all 0.3s;
&-hidden {
flex: 1 1 72px;
min-width: 72px;
- transition: all .3s;
+ transition: all 0.3s;
}
}
}
@@ -207,7 +203,7 @@
.version-container {
color: var(--td-text-color-primary);
- opacity: .4;
+ opacity: 0.4;
}
.t-menu__popup {
diff --git a/src/style/reset.less b/src/style/reset.less
index 6dcf8cd..cff1e8b 100644
--- a/src/style/reset.less
+++ b/src/style/reset.less
@@ -37,34 +37,3 @@ p {
box-sizing: border-box;
}
-.t-button-link,
-a {
- color: var(--td-brand-color);
- text-decoration: none;
- cursor: pointer;
- transition: color @anim-duration-base @anim-time-fn-easing;
-
- &:hover {
- color: var(--td-brand-color-hover);
- }
-
- &:active {
- color: var(--td-brand-color-active);
- }
-
- &--active {
- color: var(--td-brand-color-active);
- }
-
- &:focus {
- text-decoration: none;
- }
-}
-
-.t-button-link {
- margin-right: var(--td-comp-margin-xxl);
-
- &:last-child {
- margin-right: 0;
- }
-}
diff --git a/stylelint.config.js b/stylelint.config.js
index 73e3952..1e9edb5 100644
--- a/stylelint.config.js
+++ b/stylelint.config.js
@@ -2,31 +2,17 @@ module.exports = {
defaultSeverity: 'error',
extends: ['stylelint-config-standard'],
rules: {
- 'no-duplicate-selectors': null,
- 'number-leading-zero': 'never',
- 'block-no-empty': null,
- 'selector-class-pattern': null,
- 'declaration-block-no-redundant-longhand-properties': [true, { ignoreShorthands: ['/flex/'] }],
- 'custom-property-pattern': null,
- 'keyframes-name-pattern': null,
+ 'no-descending-specificity': null,
+ 'import-notation': 'string',
'no-empty-source': null,
- 'font-family-no-missing-generic-family-keyword': [
+ 'custom-property-pattern': null,
+ 'selector-class-pattern': null,
+ 'selector-pseudo-class-no-unknown': [
true,
{
- ignoreFontFamilies: ['PingFangSC-Regular', 'PingFangSC-Medium', 't'],
+ ignorePseudoClasses: ['deep'],
},
],
- 'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
- 'function-url-quotes': null,
- 'max-line-length': null,
- 'at-rule-empty-line-before': ['always', { ignore: ['after-comment'] }],
- 'declaration-colon-newline-after': null,
- 'no-descending-specificity': null,
- 'selector-type-no-unknown': null,
- 'color-function-notation': 'legacy',
- 'value-keyword-case': null,
- 'property-no-unknown': [true, { checkPrefixed: true }],
- 'import-notation': 'string',
},
overrides: [
{
diff --git a/vite.config.ts b/vite.config.ts
index fb3c96d..30737de 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,6 +1,7 @@
+import path from 'node:path';
+
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
-import path from 'path';
import { ConfigEnv, loadEnv, UserConfig } from 'vite';
import { viteMockServe } from 'vite-plugin-mock';
import svgLoader from 'vite-svg-loader';