Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_54851307
vue-vben-admin
提交
02d6a394
V
vue-vben-admin
项目概览
weixin_54851307
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
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,发现更多精彩内容 >>
提交
02d6a394
编写于
10月 13, 2020
作者:
N
nebv
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix missing cache of refresh page
上级
bbfb06f0
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
54 addition
and
40 deletion
+54
-40
src/hooks/web/useTabs.ts
src/hooks/web/useTabs.ts
+18
-3
src/layouts/default/index.less
src/layouts/default/index.less
+10
-8
src/router/menus/index.ts
src/router/menus/index.ts
+3
-2
src/router/menus/modules/dashboard.ts
src/router/menus/modules/dashboard.ts
+0
-0
src/router/menus/modules/demo/charts.ts
src/router/menus/modules/demo/charts.ts
+4
-4
src/router/routes/index.ts
src/router/routes/index.ts
+4
-2
src/router/routes/modules/dashboard.ts
src/router/routes/modules/dashboard.ts
+0
-0
src/router/routes/modules/demo/charts.ts
src/router/routes/modules/demo/charts.ts
+1
-1
src/router/routes/modules/demo/feat.ts
src/router/routes/modules/demo/feat.ts
+10
-9
src/settings/projectSetting.ts
src/settings/projectSetting.ts
+1
-1
src/store/modules/tab.ts
src/store/modules/tab.ts
+1
-4
src/utils/helper/envHelper.ts
src/utils/helper/envHelper.ts
+2
-6
未找到文件。
src/hooks/web/useTabs.ts
浏览文件 @
02d6a394
import
type
{
AppRouteRecordRaw
}
from
'
/@/router/types.d
'
;
import
{
useTimeout
}
from
'
/@/hooks/core/useTimeout
'
;
import
{
PageEnum
}
from
'
/@/enums/pageEnum
'
;
import
{
TabItem
,
tabStore
}
from
'
/@/store/modules/tab
'
;
...
...
@@ -64,6 +65,18 @@ export function useTabs() {
}
return
!!
show
;
}
function
getTo
(
path
:
string
):
any
{
const
routes
=
router
.
getRoutes
();
const
fn
=
(
p
:
string
):
any
=>
{
const
to
=
routes
.
find
((
item
)
=>
item
.
path
===
p
);
if
(
!
to
)
return
''
;
if
(
!
to
.
redirect
)
return
to
;
if
(
to
.
redirect
)
{
return
getTo
(
to
.
redirect
as
string
);
}
};
return
fn
(
path
);
}
return
{
initTabFn
,
refreshPage
:
()
=>
canIUseFn
()
&&
refreshPage
(
tabStore
.
getCurrentTab
),
...
...
@@ -74,11 +87,13 @@ export function useTabs() {
closeCurrent
:
()
=>
canIUseFn
()
&&
closeCurrent
(
tabStore
.
getCurrentTab
),
resetCache
:
()
=>
canIUseFn
()
&&
resetCache
(),
addTab
:
(
path
:
PageEnum
,
goTo
=
false
,
replace
=
false
)
=>
{
const
to
=
getTo
(
path
);
if
(
!
to
)
return
;
useTimeout
(()
=>
{
tabStore
.
addTabByPathAction
(
path
);
tabStore
.
addTabByPathAction
(
(
to
as
unknown
)
as
AppRouteRecordRaw
);
},
0
);
activeKeyRef
.
value
=
path
;
goTo
&&
replace
?
router
.
replace
:
router
.
push
(
path
);
activeKeyRef
.
value
=
to
.
path
;
goTo
&&
replace
?
router
.
replace
:
router
.
push
(
to
.
path
);
},
activeKeyRef
,
};
...
...
src/layouts/default/index.less
浏览文件 @
02d6a394
@import (reference) '../../design/index.less';
.default-layout {
.ant-menu-submenu .ant-menu-sub {
transition: none !important;
// transition: background 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s,
// padding 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s !important;
}
//
.ant-menu-submenu .ant-menu-sub {
//
transition: none !important;
//
// transition: background 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s,
//
// padding 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s !important;
//
}
&__content {
position: relative;
...
...
@@ -102,10 +102,12 @@
.setting-button {
top: 45%;
right: 0;
border-radius: 10px 0 0 10px;
padding: 14px;
border-radius: 6px 0 0 6px;
.svg {
width: 2em;
svg {
width: 1.2em;
height: 1.2em;
}
}
...
...
src/router/menus/index.ts
浏览文件 @
02d6a394
...
...
@@ -10,7 +10,8 @@ import { PermissionModeEnum } from '/@/enums/appEnum';
// ===========================
// ==========module import====
// ===========================
import
dashboardDemo
from
'
./modules/demo/dashboard
'
;
import
dashboard
from
'
./modules/dashboard
'
;
import
exceptionDemo
from
'
./modules/demo/exception
'
;
import
iframeDemo
from
'
./modules/demo/iframe
'
;
import
compDemo
from
'
./modules/demo/comp
'
;
...
...
@@ -22,7 +23,7 @@ import formDemo from './modules/demo/form';
import
treeDemo
from
'
./modules/demo/tree
'
;
const
menuModules
=
[
dashboard
Demo
,
dashboard
,
featDemo
,
exceptionDemo
,
iframeDemo
,
...
...
src/router/menus/modules/d
emo/d
ashboard.ts
→
src/router/menus/modules/dashboard.ts
浏览文件 @
02d6a394
文件已移动
src/router/menus/modules/demo/charts.ts
浏览文件 @
02d6a394
...
...
@@ -5,6 +5,10 @@ const menu: MenuModule = {
name
:
'
图表
'
,
path
:
'
/charts
'
,
children
:
[
{
path
:
'
/apexChart
'
,
name
:
'
ApexChart
'
,
},
{
path
:
'
/echarts
'
,
name
:
'
Echarts
'
,
...
...
@@ -23,10 +27,6 @@ const menu: MenuModule = {
},
],
},
{
path
:
'
/apexChart
'
,
name
:
'
ApexChart
'
,
},
],
},
};
...
...
src/router/routes/index.ts
浏览文件 @
02d6a394
...
...
@@ -4,9 +4,11 @@ import { DEFAULT_LAYOUT_COMPONENT, PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '
import
{
genRouteModule
}
from
'
/@/utils/helper/routeHelper
'
;
import
LoginRoute
from
'
./modules/sys
'
;
import
dashboard
from
'
./modules/dashboard
'
;
// demo
import
exceptionDemo
from
'
./modules/demo/exception
'
;
import
dashboardDemo
from
'
./modules/demo/dashboard
'
;
import
iframeDemo
from
'
./modules/demo/iframe
'
;
import
compDemo
from
'
./modules/demo/comp
'
;
import
permissionDemo
from
'
./modules/demo/permission
'
;
...
...
@@ -18,7 +20,7 @@ import treeDemo from './modules/demo/tree';
const
routeModuleList
:
AppRouteModule
[]
=
[
exceptionDemo
,
dashboard
Demo
,
dashboard
,
iframeDemo
,
compDemo
,
featDemo
,
...
...
src/router/routes/modules/d
emo/d
ashboard.ts
→
src/router/routes/modules/dashboard.ts
浏览文件 @
02d6a394
文件已移动
src/router/routes/modules/demo/charts.ts
浏览文件 @
02d6a394
...
...
@@ -7,7 +7,7 @@ export default {
path
:
'
/charts
'
,
name
:
'
Charts
'
,
component
:
PAGE_LAYOUT_COMPONENT
,
redirect
:
'
/charts/
welcome
'
,
redirect
:
'
/charts/
apexChart
'
,
meta
:
{
icon
:
'
ant-design:area-chart-outlined
'
,
title
:
'
图表库
'
,
...
...
src/router/routes/modules/demo/feat.ts
浏览文件 @
02d6a394
...
...
@@ -7,7 +7,7 @@ export default {
path
:
'
/feat
'
,
name
:
'
FeatDemo
'
,
component
:
PAGE_LAYOUT_COMPONENT
,
redirect
:
'
/feat/
tabs
'
,
redirect
:
'
/feat/
icon
'
,
meta
:
{
icon
:
'
ic:outline-featured-play-list
'
,
title
:
'
Feat
'
,
...
...
@@ -15,14 +15,6 @@ export default {
},
routes
:
[
{
path
:
'
/tabs
'
,
name
:
'
TabsDemo
'
,
component
:
()
=>
import
(
'
/@/views/demo/feat/tabs/index.vue
'
),
meta
:
{
title
:
'
标签页操作
'
,
},
},
{
path
:
'
/icon
'
,
name
:
'
IconDemo
'
,
...
...
@@ -31,6 +23,15 @@ export default {
title
:
'
图标
'
,
},
},
{
path
:
'
/tabs
'
,
name
:
'
TabsDemo
'
,
component
:
()
=>
import
(
'
/@/views/demo/feat/tabs/index.vue
'
),
meta
:
{
title
:
'
标签页操作
'
,
},
},
{
path
:
'
/context-menu
'
,
name
:
'
ContextMenuDemo
'
,
...
...
src/settings/projectSetting.ts
浏览文件 @
02d6a394
...
...
@@ -61,7 +61,7 @@ const setting: ProjectConfig = {
// 分割菜单
split
:
false
,
// 顶部菜单布局
topMenuAlign
:
'
center
'
,
topMenuAlign
:
'
start
'
,
},
// 消息配置
messageSetting
:
{
...
...
src/store/modules/tab.ts
浏览文件 @
02d6a394
...
...
@@ -181,10 +181,7 @@ class Tab extends VuexModule {
}
@
Action
addTabByPathAction
(
path
:
string
):
void
{
if
(
!
path
)
return
;
const
routes
=
router
.
getRoutes
();
const
to
=
routes
.
find
((
item
)
=>
item
.
path
===
path
);
addTabByPathAction
(
to
:
AppRouteRecordRaw
):
void
{
to
&&
this
.
commitAddTab
((
to
as
unknown
)
as
AppRouteRecordRaw
);
}
...
...
src/utils/helper/envHelper.ts
浏览文件 @
02d6a394
import
{
isDevMode
,
getEnv
}
from
'
/@/utils/env
'
;
import
{
getEnv
}
from
'
/@/utils/env
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
import
moment
from
'
moment
'
;
import
pkg
from
'
../../../package.json
'
;
const
{
globSetting
}
=
useSetting
();
// Generate cache key according to version
export
const
getStorageShortName
=
()
=>
{
const
shortTime
=
moment
().
format
(
'
MMDDHHmmss
'
);
return
`
${
globSetting
.
shortName
}
__
${
getEnv
()}${
`__
${
pkg
.
version
}
`
+
(
isDevMode
()
?
''
:
`__
${
shortTime
}
`
)
}
__`
.
toUpperCase
();
return
`
${
globSetting
.
shortName
}
__
${
getEnv
()}${
`__
${
pkg
.
version
}
`
}
__`
.
toUpperCase
();
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录