-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/hooks/business/download.ts b/src/hooks/business/download.ts
index b3b70c14..357680d9 100644
--- a/src/hooks/business/download.ts
+++ b/src/hooks/business/download.ts
@@ -113,6 +113,10 @@ export function useDownload() {
const response = await fetch(fullUrl, requestOptions);
+ if (response.status !== 200) {
+ throw new Error(errorCodeRecord.default);
+ }
+
await handleResponse(response);
const rawHeader = response.headers.get('Download-Filename');
diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts
index c7a63252..141ec50e 100644
--- a/src/locales/langs/en-us.ts
+++ b/src/locales/langs/en-us.ts
@@ -341,6 +341,8 @@ const local: App.I18n.Schema = {
page: {
login: {
common: {
+ title: 'Modern enterprise-level multi-tenant management system',
+ subTitle: 'Provides developers with a complete enterprise management solution',
loginOrRegister: 'Login / Register',
register: 'Register',
userNamePlaceholder: 'Please enter user name',
diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts
index add50079..28902f6a 100644
--- a/src/locales/langs/zh-cn.ts
+++ b/src/locales/langs/zh-cn.ts
@@ -341,6 +341,8 @@ const local: App.I18n.Schema = {
page: {
login: {
common: {
+ title: '现代化的企业级多租户管理系统',
+ subTitle: '为开发者提供了完整的企业管理解决方案',
loginOrRegister: '登录 / 注册',
register: '注册',
userNamePlaceholder: '请输入用户名',
diff --git a/src/store/modules/route/index.ts b/src/store/modules/route/index.ts
index 14ff0f8a..f340d642 100644
--- a/src/store/modules/route/index.ts
+++ b/src/store/modules/route/index.ts
@@ -127,7 +127,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
}
// @ts-expect-error no hidden field
route.meta.hideInMenu = route.hidden;
- if (route.meta.hideInMenu && parent) {
+ if (route.meta.hideInMenu && parent && !route.meta.activeMenu) {
// @ts-expect-error parent.name is activeMenu type
route.meta.activeMenu = parent.name;
}
diff --git a/src/theme/settings.ts b/src/theme/settings.ts
index c4bad43c..4a0fc6b5 100644
--- a/src/theme/settings.ts
+++ b/src/theme/settings.ts
@@ -44,7 +44,7 @@ export const themeSettings: App.Theme.ThemeSetting = {
fixedHeaderAndTab: true,
sider: {
inverted: false,
- width: 220,
+ width: 230,
collapsedWidth: 64,
mixWidth: 90,
mixCollapsedWidth: 64,
diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts
index d90bbbdd..90b87dc4 100644
--- a/src/typings/app.d.ts
+++ b/src/typings/app.d.ts
@@ -487,6 +487,8 @@ declare namespace App {
};
login: {
common: {
+ title: string;
+ subTitle: string;
loginOrRegister: string;
register: string;
userNamePlaceholder: string;
diff --git a/src/utils/export.ts b/src/utils/export.ts
new file mode 100644
index 00000000..e8cb4630
--- /dev/null
+++ b/src/utils/export.ts
@@ -0,0 +1,71 @@
+import { utils, writeFile } from 'xlsx';
+import { isNotNull } from '@/utils/common';
+import { $t } from '@/locales';
+
+export interface ExportExcelProps
{
+ columns: NaiveUI.TableColumn>[];
+ data: NaiveUI.TableDataWithIndex[];
+ filename: string;
+ ignoreKeys?: (keyof NaiveUI.TableDataWithIndex | NaiveUI.CustomColumnKey)[];
+ dicts?: Record, string>;
+}
+
+export function exportExcel({
+ columns,
+ data,
+ filename,
+ dicts,
+ ignoreKeys = ['index', 'operate']
+}: ExportExcelProps) {
+ const exportColumns = columns.filter(col => isTableColumnHasKey(col) && !ignoreKeys?.includes(col.key));
+
+ const excelList = data.map(item => exportColumns.map(col => getTableValue(col, item, dicts)));
+
+ const titleList = exportColumns.map(col => (isTableColumnHasTitle(col) && col.title) || null);
+
+ excelList.unshift(titleList);
+
+ const workBook = utils.book_new();
+
+ const workSheet = utils.aoa_to_sheet(excelList);
+
+ workSheet['!cols'] = exportColumns.map(item => ({
+ width: Math.round(Number(item.width) / 10 || 20)
+ }));
+
+ utils.book_append_sheet(workBook, workSheet, filename);
+
+ writeFile(workBook, `${filename}.xlsx`);
+}
+
+function getTableValue(
+ col: NaiveUI.TableColumn>,
+ item: NaiveUI.TableDataWithIndex,
+ dicts?: Record, string>
+) {
+ if (!isTableColumnHasKey(col)) {
+ return null;
+ }
+
+ const { key } = col;
+
+ if (key === 'operate') {
+ return null;
+ }
+
+ if (isNotNull(dicts?.[key]) && isNotNull(item[key])) {
+ return $t(item[key] as App.I18n.I18nKey);
+ }
+
+ return item[key];
+}
+
+function isTableColumnHasKey(column: NaiveUI.TableColumn): column is NaiveUI.TableColumnWithKey {
+ return Boolean((column as NaiveUI.TableColumnWithKey).key);
+}
+
+function isTableColumnHasTitle(column: NaiveUI.TableColumn): column is NaiveUI.TableColumnWithKey & {
+ title: string;
+} {
+ return Boolean((column as NaiveUI.TableColumnWithKey).title);
+}
diff --git a/src/views/_builtin/login/index.vue b/src/views/_builtin/login/index.vue
index 788932ba..a99e21cd 100644
--- a/src/views/_builtin/login/index.vue
+++ b/src/views/_builtin/login/index.vue
@@ -39,45 +39,51 @@ const activeModule = computed(() => moduleMap[props.module || 'pwd-login']);
-
-
-
-
![]()
+
+
+
+
+
+
{{ $t('system.title') }}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
{{ $t('page.login.common.title') }}
+
{{ $t('page.login.common.subTitle') }}
+
+
+
diff --git a/src/views/_builtin/login/modules/code-login.vue b/src/views/_builtin/login/modules/code-login.vue
index 43e8eba2..4ab5fc41 100644
--- a/src/views/_builtin/login/modules/code-login.vue
+++ b/src/views/_builtin/login/modules/code-login.vue
@@ -40,6 +40,10 @@ async function handleSubmit() {
+
+ {{ $t('page.login.codeLogin.title') }}
+
+ 请输入您的手机号,我们将发送验证码到您的手机
@@ -52,15 +56,32 @@ async function handleSubmit() {
-
-
- {{ $t('common.confirm') }}
+
+
+ {{ $t('page.login.codeLogin.title') }}
-
+
{{ $t('page.login.common.back') }}
-
+
diff --git a/src/views/_builtin/login/modules/pwd-login.vue b/src/views/_builtin/login/modules/pwd-login.vue
index d42e7472..473cc127 100644
--- a/src/views/_builtin/login/modules/pwd-login.vue
+++ b/src/views/_builtin/login/modules/pwd-login.vue
@@ -124,8 +124,8 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
-
登录到您的账户
-
欢迎回来!请输入您的账户信息
+
登录到您的账户
+
欢迎回来!请输入您的账户信息
-
-
+
+
-
-
+
+
{{ $t('page.login.pwdLogin.rememberMe') }}
{{ $t('page.login.pwdLogin.forgetPassword') }}
@@ -199,7 +199,7 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
-
+
您还没有账户?
{{ $t('page.login.common.register') }}
@@ -216,13 +216,13 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
}
img {
- height: 52px;
+ height: 42px;
}
}
:deep(.n-base-selection),
:deep(.n-input) {
- --n-height: 52px !important;
+ --n-height: 42px !important;
--n-font-size: 16px !important;
--n-border-radius: 8px !important;
}
@@ -237,7 +237,7 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
}
:deep(.n-button) {
- --n-height: 52px !important;
+ --n-height: 42px !important;
--n-font-size: 18px !important;
--n-border-radius: 8px !important;
}
diff --git a/src/views/_builtin/login/modules/register.vue b/src/views/_builtin/login/modules/register.vue
index ae15f0be..c82f90c6 100644
--- a/src/views/_builtin/login/modules/register.vue
+++ b/src/views/_builtin/login/modules/register.vue
@@ -104,8 +104,8 @@ handleFetchCaptchaCode();
-
注册新账户
-
欢迎注册!请输入您的账户信息
+
注册新账户
+
欢迎注册!请输入您的账户信息
-
+
{{ $t('page.login.common.register') }}
-
+
您已有账户?
{{ $t('common.login') }}
@@ -177,7 +177,7 @@ handleFetchCaptchaCode();
:deep(.n-base-selection),
:deep(.n-input) {
- --n-height: 52px !important;
+ --n-height: 42px !important;
--n-font-size: 16px !important;
--n-border-radius: 8px !important;
}
@@ -187,7 +187,7 @@ handleFetchCaptchaCode();
}
:deep(.n-button) {
- --n-height: 52px !important;
+ --n-height: 42px !important;
--n-font-size: 18px !important;
--n-border-radius: 8px !important;
}
diff --git a/src/views/_builtin/login/modules/reset-pwd.vue b/src/views/_builtin/login/modules/reset-pwd.vue
index bcefaccd..8c8151f4 100644
--- a/src/views/_builtin/login/modules/reset-pwd.vue
+++ b/src/views/_builtin/login/modules/reset-pwd.vue
@@ -46,10 +46,10 @@ async function handleSubmit() {
-
+
{{ $t('page.login.resetPwd.title') }}
-
请输入您的手机号,我们将发送验证码到您的手机
+
请输入您的手机号,我们将发送验证码到您的手机
@@ -73,7 +73,7 @@ async function handleSubmit() {
:placeholder="$t('page.login.common.confirmPasswordPlaceholder')"
/>
-
+
{{ $t('page.login.resetPwd.title') }}
@@ -88,7 +88,7 @@ async function handleSubmit() {