mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 22:30:19 +08:00
Compare commits
9 Commits
tauri-v1.0
...
v1.0.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55d7cc09d7 | ||
|
|
dae2aa5513 | ||
|
|
b3e9bbaeaa | ||
|
|
c89e00d194 | ||
|
|
4708eded4c | ||
|
|
145300e95c | ||
|
|
3ddb17a0f5 | ||
|
|
a8dbc03e23 | ||
|
|
c0ed1f26f7 |
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,6 +1,30 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.0.8](https://github.com/soybeanjs/soybean-admin/compare/v1.0.7...v1.0.8) (2024-04-27)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **components**:
|
||||||
|
- fix PinToggler label. fixed #407 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/407 [<samp>(c0ed1)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c0ed1f2)
|
||||||
|
- **projects**:
|
||||||
|
- text level low. #409 - by **alleycharming** in https://github.com/soybeanjs/soybean-admin/issues/409 [<samp>(3ddb1)</samp>](https://github.com/soybeanjs/soybean-admin/commit/3ddb17a)
|
||||||
|
- fix tab fixedIndex as null case - by **paynezhuang** [<samp>(4708e)</samp>](https://github.com/soybeanjs/soybean-admin/commit/4708ede)
|
||||||
|
- recovery the layout config before is mobile. fixed #408, fixed #361 - by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/408 and https://github.com/soybeanjs/soybean-admin/issues/361 [<samp>(dae2a)</samp>](https://github.com/soybeanjs/soybean-admin/commit/dae2aa5)
|
||||||
|
|
||||||
|
### 🔥 Performance
|
||||||
|
|
||||||
|
- **projects**: perf judgement the fixed tab - by @honghuangdc [<samp>(b3e9b)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b3e9bba)
|
||||||
|
|
||||||
|
### 💅 Refactors
|
||||||
|
|
||||||
|
- **projects**: `Soybean Admin` to `SoybeanAdmin` - by @honghuangdc [<samp>(a8dbc)</samp>](https://github.com/soybeanjs/soybean-admin/commit/a8dbc03)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/honghuangdc)
|
||||||
|
[paynezhuang](mailto:paynezhuang@gmail.com), [alleycharming](mailto:alleycharming@gmail.com)
|
||||||
|
|
||||||
## [v1.0.7](https://github.com/soybeanjs/soybean-admin/compare/v1.0.6...v1.0.7) (2024-04-25)
|
## [v1.0.7](https://github.com/soybeanjs/soybean-admin/compare/v1.0.6...v1.0.7) (2024-04-25)
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Soybean",
|
"name": "Soybean",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/axios",
|
"name": "@sa/axios",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/color-palette",
|
"name": "@sa/color-palette",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/hooks",
|
"name": "@sa/hooks",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/materials",
|
"name": "@sa/materials",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/fetch",
|
"name": "@sa/fetch",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/scripts",
|
"name": "@sa/scripts",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sa": "./bin.ts"
|
"sa": "./bin.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/uno-preset",
|
"name": "@sa/uno-preset",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/utils",
|
"name": "@sa/utils",
|
||||||
"version": "1.0.7",
|
"version": "1.0.8",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,7 +36,11 @@ const icon = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ButtonIcon :tooltip-content="collapsed ? $t('icon.expand') : $t('icon.collapse')" tooltip-placement="bottom-start">
|
<ButtonIcon
|
||||||
|
:tooltip-content="collapsed ? $t('icon.expand') : $t('icon.collapse')"
|
||||||
|
tooltip-placement="bottom-start"
|
||||||
|
:z-index="99"
|
||||||
|
>
|
||||||
<SvgIcon :icon="icon" />
|
<SvgIcon :icon="icon" />
|
||||||
</ButtonIcon>
|
</ButtonIcon>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const icon = computed(() => (props.pin ? 'mdi-pin-off' : 'mdi-pin'));
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ButtonIcon
|
<ButtonIcon
|
||||||
:tooltip-content="pin ? $t('icon.pin') : $t('icon.unpin')"
|
:tooltip-content="pin ? $t('icon.unpin') : $t('icon.pin')"
|
||||||
tooltip-placement="bottom-start"
|
tooltip-placement="bottom-start"
|
||||||
:z-index="100"
|
:z-index="100"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { effectScope, onScopeDispose, ref, watch } from 'vue';
|
import { effectScope, nextTick, onScopeDispose, ref, watch } from 'vue';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { breakpointsTailwind, useBreakpoints, useEventListener, useTitle } from '@vueuse/core';
|
import { breakpointsTailwind, useBreakpoints, useEventListener, useTitle } from '@vueuse/core';
|
||||||
import { useBoolean } from '@sa/hooks';
|
import { useBoolean } from '@sa/hooks';
|
||||||
@@ -87,9 +87,26 @@ export const useAppStore = defineStore(SetupStoreId.App, () => {
|
|||||||
isMobile,
|
isMobile,
|
||||||
newValue => {
|
newValue => {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
setSiderCollapse(true);
|
// backup theme setting before is mobile
|
||||||
|
localStg.set('backupThemeSettingBeforeIsMobile', {
|
||||||
|
layout: themeStore.layout.mode,
|
||||||
|
siderCollapse: siderCollapse.value
|
||||||
|
});
|
||||||
|
|
||||||
themeStore.setThemeLayout('vertical');
|
themeStore.setThemeLayout('vertical');
|
||||||
|
setSiderCollapse(true);
|
||||||
|
} else {
|
||||||
|
// when is not mobile, recover the backup theme setting
|
||||||
|
const backup = localStg.get('backupThemeSettingBeforeIsMobile');
|
||||||
|
|
||||||
|
if (backup) {
|
||||||
|
nextTick(() => {
|
||||||
|
themeStore.setThemeLayout(backup.layout);
|
||||||
|
setSiderCollapse(backup.siderCollapse);
|
||||||
|
|
||||||
|
localStg.remove('backupThemeSettingBeforeIsMobile');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
|||||||
@@ -16,17 +16,24 @@ export function getAllTabs(tabs: App.Global.Tab[], homeTab?: App.Global.Tab) {
|
|||||||
|
|
||||||
const filterHomeTabs = tabs.filter(tab => tab.id !== homeTab.id);
|
const filterHomeTabs = tabs.filter(tab => tab.id !== homeTab.id);
|
||||||
|
|
||||||
const fixedTabs = filterHomeTabs
|
const fixedTabs = filterHomeTabs.filter(isFixedTab).sort((a, b) => a.fixedIndex! - b.fixedIndex!);
|
||||||
.filter(tab => tab.fixedIndex !== undefined)
|
|
||||||
.sort((a, b) => a.fixedIndex! - b.fixedIndex!);
|
|
||||||
|
|
||||||
const remainTabs = filterHomeTabs.filter(tab => tab.fixedIndex === undefined);
|
const remainTabs = filterHomeTabs.filter(tab => !isFixedTab(tab));
|
||||||
|
|
||||||
const allTabs = [homeTab, ...fixedTabs, ...remainTabs];
|
const allTabs = [homeTab, ...fixedTabs, ...remainTabs];
|
||||||
|
|
||||||
return updateTabsLabel(allTabs);
|
return updateTabsLabel(allTabs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is fixed tab
|
||||||
|
*
|
||||||
|
* @param tab
|
||||||
|
*/
|
||||||
|
function isFixedTab(tab: App.Global.Tab) {
|
||||||
|
return tab.fixedIndex !== undefined && tab.fixedIndex !== null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get tab id by route
|
* Get tab id by route
|
||||||
*
|
*
|
||||||
@@ -177,7 +184,7 @@ export function extractTabsByAllRoutes(router: Router, tabs: App.Global.Tab[]) {
|
|||||||
* @param tabs
|
* @param tabs
|
||||||
*/
|
*/
|
||||||
export function getFixedTabs(tabs: App.Global.Tab[]) {
|
export function getFixedTabs(tabs: App.Global.Tab[]) {
|
||||||
return tabs.filter(tab => tab.fixedIndex !== undefined);
|
return tabs.filter(isFixedTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
2
src/typings/app.d.ts
vendored
2
src/typings/app.d.ts
vendored
@@ -198,7 +198,7 @@ declare namespace App {
|
|||||||
/** The tab route full path */
|
/** The tab route full path */
|
||||||
fullPath: string;
|
fullPath: string;
|
||||||
/** The tab fixed index */
|
/** The tab fixed index */
|
||||||
fixedIndex?: number;
|
fixedIndex?: number | null;
|
||||||
/**
|
/**
|
||||||
* Tab icon
|
* Tab icon
|
||||||
*
|
*
|
||||||
|
|||||||
2
src/typings/router.d.ts
vendored
2
src/typings/router.d.ts
vendored
@@ -58,7 +58,7 @@ declare module 'vue-router' {
|
|||||||
/** By default, the same route path will use one tab, if set to true, it will use multiple tabs */
|
/** By default, the same route path will use one tab, if set to true, it will use multiple tabs */
|
||||||
multiTab?: boolean;
|
multiTab?: boolean;
|
||||||
/** If set, the route will be fixed in tabs, and the value is the order of fixed tabs */
|
/** If set, the route will be fixed in tabs, and the value is the order of fixed tabs */
|
||||||
fixedIndexInTab?: number;
|
fixedIndexInTab?: number | null;
|
||||||
/** if set query parameters, it will be automatically carried when entering the route */
|
/** if set query parameters, it will be automatically carried when entering the route */
|
||||||
query?: Record<string, string>;
|
query?: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/typings/storage.d.ts
vendored
5
src/typings/storage.d.ts
vendored
@@ -32,5 +32,10 @@ declare namespace StorageType {
|
|||||||
overrideThemeFlag: string;
|
overrideThemeFlag: string;
|
||||||
/** The global tabs */
|
/** The global tabs */
|
||||||
globalTabs: App.Global.Tab[];
|
globalTabs: App.Global.Tab[];
|
||||||
|
/** The backup theme setting before is mobile */
|
||||||
|
backupThemeSettingBeforeIsMobile: {
|
||||||
|
layout: UnionKey.ThemeLayoutMode;
|
||||||
|
siderCollapse: boolean;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user