Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
c8df1f5e
提交
c8df1f5e
authored
4月 13, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
布局设置支持保存&重置配置
上级
e71c00e6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
65 行增加
和
18 行删除
+65
-18
application-druid.yml
ruoyi-admin/src/main/resources/application-druid.yml
+1
-1
index.vue
ruoyi-ui/src/components/TopNav/index.vue
+18
-6
index.vue
ruoyi-ui/src/layout/components/Settings/index.vue
+39
-4
settings.js
ruoyi-ui/src/settings.js
+1
-1
settings.js
ruoyi-ui/src/store/modules/settings.js
+6
-6
没有找到文件。
ruoyi-admin/src/main/resources/application-druid.yml
浏览文件 @
c8df1f5e
...
@@ -43,7 +43,7 @@ spring:
...
@@ -43,7 +43,7 @@ spring:
allow
:
allow
:
url-pattern
:
/druid/*
url-pattern
:
/druid/*
# 控制台管理用户名和密码
# 控制台管理用户名和密码
login-username
:
admin
login-username
:
ruoyi
login-password
:
123456
login-password
:
123456
filter
:
filter
:
stat
:
stat
:
...
...
ruoyi-ui/src/components/TopNav/index.vue
浏览文件 @
c8df1f5e
...
@@ -30,6 +30,9 @@
...
@@ -30,6 +30,9 @@
<
script
>
<
script
>
import
{
constantRoutes
}
from
"@/router"
;
import
{
constantRoutes
}
from
"@/router"
;
// 不需要激活的路由
const
noactiveList
=
[
"/user/profile"
,
"/dict/type"
,
"/gen/edit"
,
"/job/log"
];
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -42,10 +45,13 @@ export default {
...
@@ -42,10 +45,13 @@ export default {
computed
:
{
computed
:
{
// 顶部显示菜单
// 顶部显示菜单
topMenus
()
{
topMenus
()
{
return
this
.
routers
.
map
((
menu
)
=>
({
let
topMenus
=
[];
...
menu
,
this
.
routers
.
map
((
menu
)
=>
{
children
:
undefined
,
if
(
menu
.
hidden
===
false
)
{
}));
topMenus
.
push
(
menu
);
}
});
return
topMenus
;
},
},
// 所有的路由信息
// 所有的路由信息
routers
()
{
routers
()
{
...
@@ -69,6 +75,12 @@ export default {
...
@@ -69,6 +75,12 @@ export default {
activeMenu
()
{
activeMenu
()
{
const
path
=
this
.
$route
.
path
;
const
path
=
this
.
$route
.
path
;
let
activePath
=
this
.
routers
[
0
].
path
;
let
activePath
=
this
.
routers
[
0
].
path
;
var
noactive
=
noactiveList
.
some
(
function
(
item
)
{
return
path
.
indexOf
(
item
)
!==
-
1
;
});
if
(
noactive
)
{
return
;
}
if
(
path
.
lastIndexOf
(
"/"
)
>
0
)
{
if
(
path
.
lastIndexOf
(
"/"
)
>
0
)
{
const
tmpPath
=
path
.
substring
(
1
,
path
.
length
);
const
tmpPath
=
path
.
substring
(
1
,
path
.
length
);
activePath
=
"/"
+
tmpPath
.
substring
(
0
,
tmpPath
.
indexOf
(
"/"
));
activePath
=
"/"
+
tmpPath
.
substring
(
0
,
tmpPath
.
indexOf
(
"/"
));
...
@@ -89,7 +101,7 @@ export default {
...
@@ -89,7 +101,7 @@ export default {
methods
:
{
methods
:
{
// 根据宽度计算设置显示栏数
// 根据宽度计算设置显示栏数
setVisibleNumber
()
{
setVisibleNumber
()
{
const
width
=
document
.
body
.
getBoundingClientRect
().
width
-
20
0
;
const
width
=
document
.
body
.
getBoundingClientRect
().
width
-
38
0
;
const
elWidth
=
this
.
$el
.
getBoundingClientRect
().
width
;
const
elWidth
=
this
.
$el
.
getBoundingClientRect
().
width
;
const
menuItemNodes
=
this
.
$el
.
children
;
const
menuItemNodes
=
this
.
$el
.
children
;
const
menuWidth
=
Array
.
from
(
menuItemNodes
).
map
(
const
menuWidth
=
Array
.
from
(
menuItemNodes
).
map
(
...
@@ -119,7 +131,7 @@ export default {
...
@@ -119,7 +131,7 @@ export default {
});
});
}
}
this
.
$store
.
commit
(
"SET_SIDEBAR_ROUTERS"
,
routes
);
this
.
$store
.
commit
(
"SET_SIDEBAR_ROUTERS"
,
routes
);
}
,
}
},
},
};
};
</
script
>
</
script
>
...
...
ruoyi-ui/src/layout/components/Settings/index.vue
浏览文件 @
c8df1f5e
...
@@ -62,6 +62,10 @@
...
@@ -62,6 +62,10 @@
<el-switch
v-model=
"sidebarLogo"
class=
"drawer-switch"
/>
<el-switch
v-model=
"sidebarLogo"
class=
"drawer-switch"
/>
</div>
</div>
<el-divider/>
<el-button
size=
"small"
type=
"primary"
plain
icon=
"el-icon-document-add"
@
click=
"saveSetting"
>
保存配置
</el-button>
<el-button
size=
"small"
plain
icon=
"el-icon-refresh"
@
click=
"resetSetting"
>
重置配置
</el-button>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -72,15 +76,14 @@ import ThemePicker from '@/components/ThemePicker'
...
@@ -72,15 +76,14 @@ import ThemePicker from '@/components/ThemePicker'
export
default
{
export
default
{
components
:
{
ThemePicker
},
components
:
{
ThemePicker
},
data
()
{
data
()
{
return
{}
return
{
sideTheme
:
this
.
$store
.
state
.
settings
.
sideTheme
};
},
},
computed
:
{
computed
:
{
theme
()
{
theme
()
{
return
this
.
$store
.
state
.
settings
.
theme
return
this
.
$store
.
state
.
settings
.
theme
},
},
sideTheme
()
{
return
this
.
$store
.
state
.
settings
.
sideTheme
},
fixedHeader
:
{
fixedHeader
:
{
get
()
{
get
()
{
return
this
.
$store
.
state
.
settings
.
fixedHeader
return
this
.
$store
.
state
.
settings
.
fixedHeader
...
@@ -141,6 +144,38 @@ export default {
...
@@ -141,6 +144,38 @@ export default {
key
:
'sideTheme'
,
key
:
'sideTheme'
,
value
:
val
value
:
val
})
})
this
.
sideTheme
=
val
;
},
saveSetting
()
{
const
loading
=
this
.
$loading
({
lock
:
true
,
fullscreen
:
false
,
text
:
"正在保存到本地,请稍后..."
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
});
localStorage
.
setItem
(
"layout-setting"
,
`{
"topNav":
${
this
.
topNav
}
,
"tagsView":
${
this
.
tagsView
}
,
"fixedHeader":
${
this
.
fixedHeader
}
,
"sidebarLogo":
${
this
.
sidebarLogo
}
,
"sideTheme":"
${
this
.
sideTheme
}
"
}`
);
setTimeout
(
loading
.
close
(),
1000
)
},
resetSetting
()
{
this
.
$loading
({
lock
:
true
,
fullscreen
:
false
,
text
:
"正在清除设置缓存并刷新,请稍后..."
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
});
localStorage
.
removeItem
(
"layout-setting"
)
setTimeout
(
"window.location.reload()"
,
1000
)
}
}
}
}
}
}
...
...
ruoyi-ui/src/settings.js
浏览文件 @
c8df1f5e
...
@@ -14,7 +14,7 @@ module.exports = {
...
@@ -14,7 +14,7 @@ module.exports = {
/**
/**
* 是否显示顶部导航
* 是否显示顶部导航
*/
*/
topNav
:
tru
e
,
topNav
:
fals
e
,
/**
/**
* 是否显示 tagsView
* 是否显示 tagsView
...
...
ruoyi-ui/src/store/modules/settings.js
浏览文件 @
c8df1f5e
...
@@ -3,16 +3,16 @@ import defaultSettings from '@/settings'
...
@@ -3,16 +3,16 @@ import defaultSettings from '@/settings'
const
{
sideTheme
,
showSettings
,
topNav
,
tagsView
,
fixedHeader
,
sidebarLogo
}
=
defaultSettings
const
{
sideTheme
,
showSettings
,
topNav
,
tagsView
,
fixedHeader
,
sidebarLogo
}
=
defaultSettings
const
storageSetting
=
JSON
.
parse
(
localStorage
.
getItem
(
'layout-setting'
))
||
''
const
state
=
{
const
state
=
{
theme
:
variables
.
theme
,
theme
:
variables
.
theme
,
sideTheme
:
sideTheme
,
sideTheme
:
s
torageSetting
.
sideTheme
||
s
ideTheme
,
showSettings
:
showSettings
,
showSettings
:
showSettings
,
topNav
:
topNav
,
topNav
:
storageSetting
.
topNav
===
undefined
?
topNav
:
storageSetting
.
topNav
,
tagsView
:
tagsView
,
tagsView
:
storageSetting
.
tagsView
===
undefined
?
tagsView
:
storageSetting
.
tagsView
,
fixedHeader
:
fixedHeader
,
fixedHeader
:
storageSetting
.
fixedHeader
===
undefined
?
fixedHeader
:
storageSetting
.
fixedHeader
,
sidebarLogo
:
sidebarLogo
sidebarLogo
:
s
torageSetting
.
sidebarLogo
===
undefined
?
sidebarLogo
:
storageSetting
.
s
idebarLogo
}
}
const
mutations
=
{
const
mutations
=
{
CHANGE_SETTING
:
(
state
,
{
key
,
value
})
=>
{
CHANGE_SETTING
:
(
state
,
{
key
,
value
})
=>
{
if
(
state
.
hasOwnProperty
(
key
))
{
if
(
state
.
hasOwnProperty
(
key
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论