Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
967b28c4
V
vue-vben-admin
项目概览
球球不吃虾
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
967b28c4
编写于
4月 10, 2021
作者:
V
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: persistent save tab, fix #359
上级
2037293a
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
335 addition
and
378 deletion
+335
-378
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+4
-0
build/vite/plugin/theme.ts
build/vite/plugin/theme.ts
+1
-1
src/components/Tree/src/TreeHeader.vue
src/components/Tree/src/TreeHeader.vue
+6
-1
src/enums/cacheEnum.ts
src/enums/cacheEnum.ts
+2
-0
src/router/routes/modules/demo/page.ts
src/router/routes/modules/demo/page.ts
+1
-1
src/settings/projectSetting.ts
src/settings/projectSetting.ts
+1
-1
src/store/modules/app.ts
src/store/modules/app.ts
+2
-2
src/store/modules/multipleTab.ts
src/store/modules/multipleTab.ts
+8
-1
src/utils/cache/persistent.ts
src/utils/cache/persistent.ts
+3
-0
src/views/demo/feat/ws/index.vue
src/views/demo/feat/ws/index.vue
+1
-1
types/config.d.ts
types/config.d.ts
+1
-0
yarn.lock
yarn.lock
+305
-370
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
967b28c4
...
...
@@ -13,6 +13,10 @@
-
移除
`useDebounceFn`
使用
`vueuse`
-
`useDebounceFn`
代替
-
移除
`useThrottle`
使用
`vueuse`
-
`useThrottleFn`
代替
### ✨ Features
-
标签页支持持久化保存
### ✨ Refactor
-
移除
`useElResize`
...
...
build/vite/plugin/theme.ts
浏览文件 @
967b28c4
...
...
@@ -40,7 +40,7 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
// black: '#0e1117',
// #8b949e
'
text-color-secondary
'
:
'
#8b949e
'
,
// 'border-color-base': '#30363d
',
'
border-color-base
'
:
'
#303030
'
,
// 'border-color-split': '#30363d',
'
item-active-bg
'
:
'
#111b26
'
,
},
...
...
src/components/Tree/src/TreeHeader.vue
浏览文件 @
967b28c4
<
template
>
<div
class=
"flex px-2 py-1.5 items-center b
order-b-1
"
>
<div
class=
"flex px-2 py-1.5 items-center b
asic-tree-header
"
>
<slot
name=
"headerTitle"
v-if=
"$slots.headerTitle"
></slot>
<BasicTitle
:helpMessage=
"helpMessage"
v-if=
"!$slots.headerTitle && title"
>
{{
title
}}
...
...
@@ -138,3 +138,8 @@
},
});
</
script
>
<
style
lang=
"less"
scoped
>
.basic-tree-header {
border-bottom: 1px solid @border-color-base;
}
</
style
>
src/enums/cacheEnum.ts
浏览文件 @
967b28c4
...
...
@@ -15,6 +15,8 @@ export const PROJ_CFG_KEY = 'PROJ__CFG__KEY__';
// lock info
export
const
LOCK_INFO_KEY
=
'
LOCK__INFO__KEY__
'
;
export
const
MULTIPLE_TABS_KEY
=
'
MULTIPLE_TABS__KEY__
'
;
export
const
APP_DARK_MODE_KEY_
=
'
__APP__DARK__MODE__
'
;
// base global local key
...
...
src/router/routes/modules/demo/page.ts
浏览文件 @
967b28c4
...
...
@@ -10,7 +10,7 @@ const page: AppRouteModule = {
path
:
'
/page-demo
'
,
name
:
'
PageDemo
'
,
component
:
LAYOUT
,
redirect
:
'
/page-demo/
exception
'
,
redirect
:
'
/page-demo/
form/basic
'
,
meta
:
{
icon
:
'
ion:aperture-outline
'
,
title
:
t
(
'
routes.demo.page.page
'
),
...
...
src/settings/projectSetting.ts
浏览文件 @
967b28c4
...
...
@@ -114,13 +114,13 @@ const setting: ProjectConfig = {
// Multi-label
multiTabsSetting
:
{
cache
:
false
,
// Turn on
show
:
true
,
// Is it possible to drag and drop sorting tabs
canDrag
:
true
,
// Turn on quick actions
showQuick
:
true
,
// Whether to show the refresh button
showRedo
:
true
,
// Whether to show the collapse button
...
...
src/store/modules/app.ts
浏览文件 @
967b28c4
...
...
@@ -12,7 +12,7 @@ import { resetRouter } from '/@/router';
import
{
deepMerge
}
from
'
/@/utils
'
;
interface
AppState
{
darkMode
:
ThemeEnum
;
darkMode
?
:
ThemeEnum
;
// Page loading status
pageLoading
:
boolean
;
// project config
...
...
@@ -24,7 +24,7 @@ let timeId: TimeoutHandle;
export
const
useAppStore
=
defineStore
({
id
:
'
app
'
,
state
:
():
AppState
=>
({
darkMode
:
ThemeEnum
.
LIGHT
,
darkMode
:
undefined
,
pageLoading
:
false
,
projectConfig
:
Persistent
.
getLocal
(
PROJ_CFG_KEY
),
beforeMiniInfo
:
{},
...
...
src/store/modules/multipleTab.ts
浏览文件 @
967b28c4
...
...
@@ -5,10 +5,14 @@ import { defineStore } from 'pinia';
import
{
store
}
from
'
/@/store
'
;
import
{
useGo
,
useRedo
}
from
'
/@/hooks/web/usePage
'
;
import
{
Persistent
}
from
'
/@/utils/cache/persistent
'
;
import
{
PageEnum
}
from
'
/@/enums/pageEnum
'
;
import
{
PAGE_NOT_FOUND_ROUTE
,
REDIRECT_ROUTE
}
from
'
/@/router/routes/basic
'
;
import
{
getRawRoute
}
from
'
/@/utils
'
;
import
{
MULTIPLE_TABS_KEY
}
from
'
/@/enums/cacheEnum
'
;
import
projectSetting
from
'
/@/settings/projectSetting
'
;
export
interface
MultipleTabState
{
cacheTabList
:
Set
<
string
>
;
...
...
@@ -21,13 +25,15 @@ function handleGotoPage(router: Router) {
go
(
unref
(
router
.
currentRoute
).
path
,
true
);
}
const
cacheTab
=
projectSetting
.
multiTabsSetting
.
cache
;
export
const
useMultipleTabStore
=
defineStore
({
id
:
'
app-multiple-tab
'
,
state
:
():
MultipleTabState
=>
({
// Tabs that need to be cached
cacheTabList
:
new
Set
(),
// multiple tab list
tabList
:
[],
tabList
:
cacheTab
?
Persistent
.
getLocal
(
MULTIPLE_TABS_KEY
)
||
[]
:
[],
// Index of the last moved tab
lastDragEndIndex
:
0
,
}),
...
...
@@ -135,6 +141,7 @@ export const useMultipleTabStore = defineStore({
// Add tab
this
.
tabList
.
push
(
route
);
this
.
updateCacheTab
();
cacheTab
&&
Persistent
.
setLocal
(
MULTIPLE_TABS_KEY
,
this
.
tabList
);
},
async
closeTab
(
tab
:
RouteLocationNormalized
,
router
:
Router
)
{
...
...
src/utils/cache/persistent.ts
浏览文件 @
967b28c4
import
type
{
LockInfo
,
UserInfo
}
from
'
/#/store
'
;
import
type
{
ProjectConfig
}
from
'
/#/config
'
;
import
type
{
RouteLocationNormalized
}
from
'
vue-router
'
;
import
{
createLocalStorage
,
createSessionStorage
}
from
'
/@/utils/cache
'
;
import
{
Memory
}
from
'
./memory
'
;
...
...
@@ -11,6 +12,7 @@ import {
PROJ_CFG_KEY
,
APP_LOCAL_CACHE_KEY
,
APP_SESSION_CACHE_KEY
,
MULTIPLE_TABS_KEY
,
}
from
'
/@/enums/cacheEnum
'
;
import
{
DEFAULT_CACHE_TIME
}
from
'
/@/settings/encryptionSetting
'
;
import
{
toRaw
}
from
'
vue
'
;
...
...
@@ -21,6 +23,7 @@ interface BasicStore {
[
ROLES_KEY
]:
string
[];
[
LOCK_INFO_KEY
]:
LockInfo
;
[
PROJ_CFG_KEY
]:
ProjectConfig
;
[
MULTIPLE_TABS_KEY
]:
RouteLocationNormalized
[];
}
type
LocalStore
=
BasicStore
;
...
...
src/views/demo/feat/ws/index.vue
浏览文件 @
967b28c4
...
...
@@ -37,7 +37,7 @@
<div
class=
"max-h-80 overflow-auto"
>
<ul>
<li
v-for=
"item in getList"
class=
"
border-b-1
mt-2"
:key=
"item.time"
>
<li
v-for=
"item in getList"
class=
"mt-2"
:key=
"item.time"
>
<div
class=
"flex items-center"
>
<span
class=
"mr-2 text-primary font-medium"
>
收到消息:
</span>
<span>
{{ formatToDateTime(item.time) }}
</span>
...
...
types/config.d.ts
浏览文件 @
967b28c4
...
...
@@ -33,6 +33,7 @@ export interface MenuSetting {
}
export
interface
MultiTabsSetting
{
cache
:
boolean
;
show
:
boolean
;
showQuick
:
boolean
;
canDrag
:
boolean
;
...
...
yarn.lock
浏览文件 @
967b28c4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录